setDisableNotification(true) not working anymore
See original GitHub issueHi,
it seems that the value of .setDisableNotification(true) from the DfuServiceInitiator is not taken into account and therefore the null value returned by the getNotificationTarget() in the DfuService class extending the DfuBaseService crash the application.
FATAL EXCEPTION: IntentService[DfuBaseService]
Process: com.example.myapplication, PID: 31396
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference
    at android.content.ComponentName.<init>(ComponentName.java:129)
    at android.content.Intent.<init>(Intent.java:4449)
    at no.nordicsemi.android.dfu.DfuBaseService.startForeground(DfuBaseService.java:1500)
    at no.nordicsemi.android.dfu.DfuBaseService.onHandleIntent(DfuBaseService.java:925)
    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.os.HandlerThread.run(HandlerThread.java:61)
It works well with the dfu 1.3.X and 1.4.X
System:
Android 6.0.1
compileSdkVersion 26
buildToolsVersion '26.0.2'
minSdkVersion 18
targetSdkVersion 25
dfu 1.5.X
Issue Analytics
- State:
 - Created 6 years ago
 - Comments:10 (5 by maintainers)
 
Top Results From Across the Web
DFU lockup fixed in SDK 16.0? - Nordic Q&A - Nordic DevZone ...
Hi Nordic SDK15.2 based application and bootloader running on NRF52840 based UBlox module. We have the following symptoms happening in the field: -...
Read more >android-dfu-library from NordicSemiconductor - GithubHelp
When I used the DFU to upgrading the firmware.The process before the transmission of Firmware packets is all normal.But,When Firmware packet being transmitted...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, but that’s a “foreground service” notification. This is because the DFU service is by default started as a foreground service to avoid it being killed on Oreo+ before it finishes. You may disable foreground with setForegrond(false) on the initiator, but if you want the dfu to also work when your app is closed (i.e. user clicks a notification with msg that new fw is available), we recommend leaving it. Or you may enabled foreground only on Oreo+.
Fix will be available in the next relase.