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
--- 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;
}