We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be49535 commit a17d794Copy full SHA for a17d794
lib/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java
@@ -1922,7 +1922,12 @@ private void startForeground() {
1922
// Any additional configuration?
1923
updateForegroundNotification(builder);
1924
1925
- startForeground(NOTIFICATION_ID, builder.build());
+ try {
1926
+ startForeground(NOTIFICATION_ID, builder.build());
1927
+ } catch (final SecurityException e) {
1928
+ loge("Service cannot be started in foreground", e);
1929
+ logi("Starting DFU service in background instead");
1930
+ }
1931
}
1932
1933
/**
0 commit comments