Bug 1253876 - Back out PushService integration to not burn aurora. r=me
authorNick Alexander <nalexander@mozilla.com>
Sun, 06 Mar 2016 20:43:22 -0800
changeset 286984 a75d87f4cf527815e6271932676800138c27da70
parent 286983 6f37ab432cf08ea6d729161d205d686ffacbff0b
child 287009 68d3781deda0d4d58ec9877862830db89669b3a5
child 287013 fd095cbb65ad0d4e20c10f7a1c1c3e7dcf3abdab
push idunknown
push userunknown
push dateunknown
reviewersme
bugs1253876
milestone47.0a1
Bug 1253876 - Back out PushService integration to not burn aurora. r=me Sadly, this needs to be conditional to not burn builds where MOZ_ANDROID_GCM is not defined -- such as aurora. As uplift is soon, this will have to be relanded behind a conditional abstraction (just like Adjust). MozReview-Commit-ID: 80gBojadDic
mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
@@ -8,17 +8,16 @@ import org.mozilla.gecko.AdjustConstants
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.db.LocalBrowserDB;
 import org.mozilla.gecko.dlc.DownloadContentService;
 import org.mozilla.gecko.home.HomePanelsManager;
 import org.mozilla.gecko.lwt.LightweightTheme;
 import org.mozilla.gecko.mdns.MulticastDNSManager;
-import org.mozilla.gecko.push.PushService;
 import org.mozilla.gecko.util.Clipboard;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.app.Application;
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.content.res.Configuration;
@@ -161,37 +160,16 @@ public class GeckoApplication extends Ap
                 return new LocalBrowserDB(profileName);
             }
         });
 
         GeckoService.register();
 
         super.onCreate();
 
-        if (AppConstants.MOZ_ANDROID_GCM) {
-            // TODO: only run in main process.
-            ThreadUtils.postToBackgroundThread(new Runnable() {
-                @Override
-                public void run() {
-                    // It's fine to throw GCM initialization onto a background thread; the registration process requires
-                    // network access, so is naturally asynchronous.  This, of course, races against Gecko page load of
-                    // content requiring GCM-backed services, like Web Push.  There's nothing to be done here.
-                    PushService.createInstance(context);
-                    PushService.registerGeckoEventListener();
-
-                    try {
-                        PushService.getInstance().onStartup();
-                    } catch (Exception e) {
-                        Log.e(LOG_TAG, "Got exception during startup; ignoring.", e);
-                        return;
-                    }
-                }
-            });
-        }
-
         if (AppConstants.MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE) {
             DownloadContentService.startStudy(this);
         }
     }
 
     public boolean isApplicationInBackground() {
         return mInBackground;
     }