Backed out changeset 08b93bba921c (bug 1358117) for Android Nightly bustage. r=backout a=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 27 May 2017 14:01:55 +0200
changeset 409089 66c73b65bf2d02c59f361b89135dc56553c3e4eb
parent 409088 590a85b31999a060e30bbf31352216860ba081a9
child 409090 6e55dc36fc7b503f1eb8acac26d2e73757ffea8a
child 409102 c2302acb2d2be8ea38fe7b19fe178194f63a420e
child 409130 2ba8ded0fe690cc55a55e574effff0d41daefaad
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs1358117
milestone55.0a1
backs out08b93bba921c243b0a0485fa3a2eb925baf15b24
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 08b93bba921c (bug 1358117) for Android Nightly bustage. r=backout a=backout MozReview-Commit-ID: IgiZGwOZ3tD
mobile/android/app/mobile.js
mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaInterface.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaLeanplumImp.java
mobile/android/base/java/org/mozilla/gecko/mma/MmaStubImp.java
mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
mobile/android/thirdparty/com/leanplum/Leanplum.java
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -409,25 +409,16 @@ pref("browser.ui.zoom.force-user-scalabl
 // When removing this Nightly flag, also remember to remove the flags surrounding this feature
 // in GeckoPreferences and BrowserApp (see bug 1245930).
 #ifdef NIGHTLY_BUILD
 pref("ui.bookmark.mobilefolder.enabled", true);
 #else
 pref("ui.bookmark.mobilefolder.enabled", false);
 #endif
 
-#if MOZ_UPDATE_CHANNEL == nightly
-pref("mma.enabled", true);
-#elif MOZ_UPDATE_CHANNEL == beta
-pref("mma.enabled", true);
-#else
-pref("mma.enabled", true);
-#endif
-
-
 pref("ui.touch.radius.enabled", false);
 pref("ui.touch.radius.leftmm", 3);
 pref("ui.touch.radius.topmm", 5);
 pref("ui.touch.radius.rightmm", 3);
 pref("ui.touch.radius.bottommm", 2);
 pref("ui.touch.radius.visitedWeight", 120);
 
 pref("ui.mouse.radius.enabled", false);
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
@@ -5,45 +5,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.mma;
 
 import android.app.Application;
 import android.content.Context;
 
 import org.mozilla.gecko.MmaConstants;
-import org.mozilla.gecko.PrefsHelper;
 
 
 public class MmaDelegate {
 
-    private static final String ENABLE_PREF = "mma.enabled";
-
     private static MmaInterface mmaHelper = MmaConstants.getMma();
 
-    private static final String[] prefs = { ENABLE_PREF };
-
-
     public static void init(Application application) {
-        setupPrefHandler(application);
-    }
-
-    public static void stop() {
-        mmaHelper.stop();
+        mmaHelper.init(application);
     }
 
-    private static void setupPrefHandler(final Application application) {
-        PrefsHelper.PrefHandler handler = new PrefsHelper.PrefHandlerBase() {
-            @Override
-            public void prefValue(String pref, boolean value) {
-                if (pref.equals(ENABLE_PREF)) {
-                    if (value) {
-                        mmaHelper.init(application);
-                    } else {
-                        mmaHelper.stop();
-                    }
+    public void start(Context context) {
+        mmaHelper.start(context);
+    }
 
-                }
-            }
-        };
-        PrefsHelper.addObserver(prefs, handler);
-    }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaInterface.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaInterface.java
@@ -14,10 +14,9 @@ public interface MmaInterface {
     void init(Application application);
 
     void start(Context context);
 
     void track(String leanplumEvent);
 
     void track(String leanplumEvent, double value);
 
-    void stop();
 }
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaLeanplumImp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaLeanplumImp.java
@@ -44,14 +44,9 @@ public class MmaLeanplumImp implements M
 
     }
 
     @Override
     public void track(String leanplumEvent, double value) {
         Leanplum.track(leanplumEvent, value);
 
     }
-
-    @Override
-    public void stop() {
-        Leanplum.stop();
-    }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaStubImp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaStubImp.java
@@ -25,14 +25,9 @@ public class MmaStubImp implements MmaIn
     public void track(String leanplumEvent) {
 
     }
 
     @Override
     public void track(String leanplumEvent, double value) {
 
     }
-
-    @Override
-    public void stop() {
-
-    }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -25,17 +25,16 @@ import org.mozilla.gecko.R;
 import org.mozilla.gecko.SnackbarBuilder;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.TelemetryContract.Method;
 import org.mozilla.gecko.activitystream.ActivityStream;
 import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
 import org.mozilla.gecko.feeds.FeedService;
 import org.mozilla.gecko.feeds.action.CheckForUpdatesAction;
-import org.mozilla.gecko.mma.MmaDelegate;
 import org.mozilla.gecko.permissions.Permissions;
 import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.restrictions.Restrictions;
 import org.mozilla.gecko.tabqueue.TabQueueHelper;
 import org.mozilla.gecko.tabqueue.TabQueuePrompt;
 import org.mozilla.gecko.updater.UpdateService;
 import org.mozilla.gecko.updater.UpdateServiceHelper;
 import org.mozilla.gecko.util.BundleEventListener;
@@ -1193,19 +1192,16 @@ public class GeckoPreferences
             setCharEncodingState(((String) newValue).equals("true"));
         } else if (PREFS_UPDATER_AUTODOWNLOAD.equals(prefName)) {
             UpdateServiceHelper.setAutoDownloadPolicy(this, UpdateService.AutoDownloadPolicy.get((String) newValue));
         } else if (PREFS_UPDATER_URL.equals(prefName)) {
             UpdateServiceHelper.setUpdateUrl(this, (String) newValue);
         } else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(prefName)) {
             final Boolean newBooleanValue = (Boolean) newValue;
             AdjustConstants.getAdjustHelper().setEnabled(newBooleanValue);
-            if (!newBooleanValue) {
-                MmaDelegate.stop();
-            }
         } else if (PREFS_GEO_REPORTING.equals(prefName)) {
             if ((Boolean) newValue) {
                 enableStumbler((CheckBoxPreference) preference);
                 return false;
             } else {
                 broadcastStumblerPref(GeckoPreferences.this, false);
                 return true;
             }
--- a/mobile/android/thirdparty/com/leanplum/Leanplum.java
+++ b/mobile/android/thirdparty/com/leanplum/Leanplum.java
@@ -1016,17 +1016,17 @@ public class Leanplum {
   private static void resumeHeartbeat() {
     startHeartbeat();
   }
 
   /**
    * Call this to explicitly end the session. This should not be used in most cases, so we won't
    * make it public for now.
    */
-  public static void stop() {
+  static void stop() {
     if (Constants.isNoop()) {
       return;
     }
     if (!LeanplumInternal.hasCalledStart()) {
       Log.e("You cannot call stop before calling start");
       return;
     }