Skip to content

Upgrade Paho to use AndroidX ServiceTestRule for unit tests - #502

Open
BlaidddDrwg wants to merge 6 commits into
eclipse-paho:masterfrom
BlaidddDrwg:introducing-paho
Open

Upgrade Paho to use AndroidX ServiceTestRule for unit tests#502
BlaidddDrwg wants to merge 6 commits into
eclipse-paho:masterfrom
BlaidddDrwg:introducing-paho

Conversation

@BlaidddDrwg

@BlaidddDrwg BlaidddDrwg commented Mar 18, 2024

Copy link
Copy Markdown
  • [ X] You have signed the Eclipse ECA. Took some time to reflect in Github, though.
  • [ X] All of your commits have been signed-off with the correct email address (The same one that you used to sign the CLA)
  • [ X] If This PR fixes an issue, that you reference the issue below :
  1. Fix tests to use the newer AndroidX library and the ServiceTestRule instead of the older (and now deprecated) ServiceTestCase, which is no longer supported. (Issue Upgrade to AndroidX SDK #503)
  2. Issue Solution of PendingIntent FLAG_IMMUTABLE exception on Android version 31 #485 Adds the "IMMUTABLE flag to the pending intent, in order to work properly on older SDKs.

These commits should ideally be squashed together, to remove all the details of my experimentation and understanding the codebase, but I'm not sure how to do it at this point.

…rror:

Process: Ohana.hvman.io, PID: 1989
java.lang.IllegalArgumentException: Ohana.hvman.io: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:408)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:688)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:675)
at org.eclipse.paho.android.service.AlarmPingSender.start(AlarmPingSender.java:76)
at org.eclipse.paho.client.mqttv3.internal.ClientState.connected(ClientState.java:1214)
at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1050)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151)
at java.lang.Thread.run(Thread.java:1012)
@BlaidddDrwg BlaidddDrwg changed the title Introducing paho Upgrade Paho to use AndroidX ServiceTestRule for unit tests Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant