NordicSemiconductor / Android-DFU-Library

Device Firmware Update library and Android app
http://www.nordicsemi.com/dfu
BSD 3-Clause "New" or "Revised" License
753 stars 263 forks source link

Support Android 14 #413

Closed PavlosTze closed 8 months ago

PavlosTze commented 8 months ago

Fixes Issue 412

CLAassistant commented 8 months ago

CLA assistant check
All committers have signed the CLA.

philips77 commented 8 months ago

I don't think the fix is correct. The action Intents are sent using LocalBroadcastManager, an ancient API to make sending local broadcasts faster, as it doesn't require using the OS for that purpose. The received, as far as I know, is never registered in the OS, therefore should not be a subject for change regarding Android 14. I'll have to double check it by looking into the sources.

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 manager.registerReceiver... call?

PavlosTze commented 8 months ago

@philips77 LocalBroadcastManager is ancient, as you said, therefore doesn't have the RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED property. Also yes I'm 100% sure the crash occured because of that, as we tested 2.3.2 version already and fixed that crash.

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: https://github.com/NordicSemiconductor/Android-DFU-Library/issues/414

philips77 commented 8 months ago

Also yes I'm 100% sure the crash occured because of that, as we tested 2.3.2 version already and fixed that crash.

Well... perhaps, but it also ignores all broadcasts sent using LocalBroadcastReceiver.