question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setDisableNotification(true) not working anymore

See original GitHub issue

Hi, 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:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
philips77commented, Nov 30, 2017

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+.

1reaction
philips77commented, Nov 16, 2017

Fix will be available in the next relase.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found