Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Paho to use AndroidX ServiceTestRule for unit tests #502

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

BlaidddDrwg
Copy link

@BlaidddDrwg BlaidddDrwg commented Mar 18, 2024

  • [ 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.

None yet

1 participant