Bug 1155237 - Part 2: Make upload service non-sticky. r=rnewman, a=sledru
authorGarvan Keeley <gkeeley@mozilla.com>
Tue, 21 Apr 2015 10:45:19 -0400
changeset 260242 645fc5aa6a49
parent 260241 1ec2ee773b51
child 260243 db41e8e267ed
push id724
push userryanvm@gmail.com
push date2015-04-23 01:08 +0000
treeherdermozilla-release@db41e8e267ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, sledru
bugs1155237
milestone38.0
Bug 1155237 - Part 2: Make upload service non-sticky. r=rnewman, a=sledru
mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
--- a/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
+++ b/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
@@ -35,20 +35,22 @@ public class UploadAlarmReceiver extends
     private static boolean sIsAlreadyScheduled;
 
     public UploadAlarmReceiver() {}
 
     public static class UploadAlarmService extends IntentService {
 
         public UploadAlarmService(String name) {
             super(name);
+            // makes the service START_NOT_STICKY, that is, the service is not auto-restarted
+            setIntentRedelivery(false);
         }
 
         public UploadAlarmService() {
-            super(LOG_TAG);
+            this(LOG_TAG);
         }
 
         @Override
         protected void onHandleIntent(Intent intent) {
             if (intent == null) {
                 return;
             }
             boolean isRepeating = intent.getBooleanExtra(EXTRA_IS_REPEATING, true);