-
Notifications
You must be signed in to change notification settings - Fork 269
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
Support Android 14 #413
Support Android 14 #413
Conversation
I don't think the fix is correct. The action Intents are sent using The proposed fix changes behavior for Android 14+. Now, the intents must be sent using the OS and the "local" ones are ignored. Are you sure the crash in #412 was from this |
this.registerReceiver(mDfuActionReceiver, actionFilter, RECEIVER_NOT_EXPORTED); | ||
} else { | ||
manager.registerReceiver(mDfuActionReceiver, actionFilter); | ||
} | ||
// Additionally we must register this receiver as a non-local to get broadcasts from the notification actions | ||
ContextCompat.registerReceiver(this, mDfuActionReceiver, actionFilter, ContextCompat.RECEIVER_NOT_EXPORTED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the OS receiver is registered twice, as this line does the same as 1039. We're using ContextCompat
here to avoid the need for branching based on version number.
@philips77 Another crash occurred though, in a different line, because of another change in Android 14 that hasn't been managed properly on this library. New issue here: #414 |
Well... perhaps, but it also ignores all broadcasts sent using |
Since we raised `targetSdkVersion` to 34 in fad092b, attempt to upgrade Pinetime firmware on Android 14+ causes Gadgetbridge to die with "One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts" unhandled java.lang.SecurityException. This was caused by the Nordic Semi DFU library not supporting A14 until version 2.3.2 (see NordicSemiconductor/Android-DFU-Library#412 and NordicSemiconductor/Android-DFU-Library#413). So, upgraded the library to the current release 2.5.0.
Fixes Issue 412