Bug 1068388 - Part 1: Clarify that Stumbler pref is Android-only. r=nalexander, r=garvank
authorRichard Newman <rnewman@mozilla.com>
Wed, 17 Sep 2014 12:31:47 -0700
changeset 206261 e2e8d945b53bc4b928143314c840847e9067a356
parent 206260 615a9b66e66f921b51b8aefd43f0b9b592fe720c
child 206262 6d4380faf42c9bb30af6030a66a2bcb37009fd3b
push id27519
push userkwierso@gmail.com
push dateFri, 19 Sep 2014 23:56:39 +0000
treeherdermozilla-central@a85324dfc960 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, garvank
bugs1068388
milestone35.0a1
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
Bug 1068388 - Part 1: Clarify that Stumbler pref is Android-only. r=nalexander, r=garvank
mobile/android/base/preferences/GeckoPreferences.java
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -105,24 +105,25 @@ OnSharedPreferenceChangeListener
     // These match keys in resources/xml*/preferences*.xml
     private static final String PREFS_SEARCH_RESTORE_DEFAULTS = NON_PREF_PREFIX + "search.restore_defaults";
     private static final String PREFS_DATA_REPORTING_PREFERENCES = NON_PREF_PREFIX + "datareporting.preferences";
     private static final String PREFS_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
     private static final String PREFS_CRASHREPORTER_ENABLED = "datareporting.crashreporter.submitEnabled";
     private static final String PREFS_MENU_CHAR_ENCODING = "browser.menu.showCharacterEncoding";
     private static final String PREFS_MP_ENABLED = "privacy.masterpassword.enabled";
     private static final String PREFS_UPDATER_AUTODOWNLOAD = "app.update.autodownload";
-    private static final String PREFS_GEO_REPORTING = "app.geo.reportdata";
+    private static final String PREFS_GEO_REPORTING = NON_PREF_PREFIX + "app.geo.reportdata";
     private static final String PREFS_GEO_LEARN_MORE = NON_PREF_PREFIX + "geo.learn_more";
     private static final String PREFS_HEALTHREPORT_LINK = NON_PREF_PREFIX + "healthreport.link";
     private static final String PREFS_DEVTOOLS_REMOTE_ENABLED = "devtools.debugger.remote-enabled";
     private static final String PREFS_DISPLAY_REFLOW_ON_ZOOM = "browser.zoom.reflowOnZoom";
     private static final String PREFS_DISPLAY_TITLEBAR_MODE = "browser.chrome.titlebarMode";
     private static final String PREFS_SYNC = NON_PREF_PREFIX + "sync";
-    private static final String PREFS_STUMBLER_ENABLED = AppConstants.ANDROID_PACKAGE_NAME + ".STUMBLER_PREF";
+
+    private static final String ACTION_STUMBLER_UPLOAD_PREF = AppConstants.ANDROID_PACKAGE_NAME + ".STUMBLER_PREF";
 
     // This isn't a Gecko pref, even if it looks like one.
     private static final String PREFS_BROWSER_LOCALE = "locale";
 
     public static final String PREFS_RESTORE_SESSION = NON_PREF_PREFIX + "restoreSession3";
     public static final String PREFS_SUGGESTED_SITES = NON_PREF_PREFIX + "home_suggested_sites";
     public static final String PREFS_NEW_TABLET_UI = NON_PREF_PREFIX + "new_tablet_ui";
 
@@ -864,36 +865,36 @@ OnSharedPreferenceChangeListener
 
     public static void broadcastHealthReportPrune(final Context context) {
         final Intent intent = new Intent(HealthReportConstants.ACTION_HEALTHREPORT_PRUNE);
         broadcastAction(context, intent);
     }
 
     /**
      * Broadcast the provided value as the value of the
-     * <code>PREFS_STUMBLER_ENABLED</code> pref.
+     * <code>PREFS_GEO_REPORTING</code> pref.
      */
     public static void broadcastStumblerPref(final Context context, final boolean value) {
-       Intent intent = new Intent(PREFS_STUMBLER_ENABLED)
+       Intent intent = new Intent(ACTION_STUMBLER_UPLOAD_PREF)
                 .putExtra("pref", PREFS_GEO_REPORTING)
                 .putExtra("branch", GeckoSharedPrefs.APP_PREFS_NAME)
                 .putExtra("enabled", value)
                 .putExtra("moz_mozilla_api_key", AppConstants.MOZ_STUMBLER_API_KEY);
        if (GeckoAppShell.getGeckoInterface() != null) {
            intent.putExtra("user_agent", GeckoAppShell.getGeckoInterface().getDefaultUAString());
        }
        if (!AppConstants.MOZILLA_OFFICIAL) {
            intent.putExtra("is_debug", true);
        }
        broadcastAction(context, intent);
     }
 
     /**
      * Broadcast the current value of the
-     * <code>PREFS_STUMBLER_ENABLED</code> pref.
+     * <code>PREFS_GEO_REPORTING</code> pref.
      */
     public static void broadcastStumblerPref(final Context context) {
         final boolean value = getBooleanPref(context, PREFS_GEO_REPORTING, false);
         broadcastStumblerPref(context, value);
     }
 
     /**
      * Return the value of the named preference in the default preferences file.
@@ -1316,32 +1317,17 @@ OnSharedPreferenceChangeListener
                         }
                     });
                 }
             }
 
             @Override
             public void prefValue(String prefName, final int value) {
                 final Preference pref = getField(prefName);
-                final CheckBoxPrefSetter prefSetter;
-                if (PREFS_GEO_REPORTING.equals(prefName)) {
-                    if (Versions.preICS) {
-                        prefSetter = new CheckBoxPrefSetter();
-                    } else {
-                        prefSetter = new TwoStatePrefSetter();
-                    }
-                    ThreadUtils.postToUiThread(new Runnable() {
-                        @Override
-                        public void run() {
-                            prefSetter.setBooleanPref(pref, value == 1);
-                        }
-                    });
-                } else {
-                    Log.w(LOGTAG, "Unhandled int value for pref [" + pref + "]");
-                }
+                Log.w(LOGTAG, "Unhandled int value for pref [" + pref + "]");
             }
 
             @Override
             public boolean isObserver() {
                 return true;
             }
 
             @Override