Bug 1476596 - Prevent Stumbler notification being shown after reboot. r?sdaswani
Because of the START_STICKY flag, upon boot completed, the service
would be started by the system which would trigger onStartCommand
and the notification being shown on Android Oreo+ devices without
a following call to onHandleIntent.
MozReview-Commit-ID: EldSSzRb7Zd
--- a/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/StumblerService.java
+++ b/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/StumblerService.java
@@ -147,17 +147,17 @@ public class StumblerService extends Per
.setContentTitle(getString(R.string.datareporting_stumbler_notification_title))
.setOngoing(true)
.setShowWhen(false)
.setWhen(0)
.build();
startForeground(R.id.stumblerNotification, notification);
}
- return START_STICKY;
+ return super.onStartCommand(intent, flags, startId);
}
// Called from the main thread
@Override
public void onDestroy() {
super.onDestroy();
if (!mScanManager.isScanning()) {