Bug 1184683 - GeckoPreferences: Pass current context to RestrictedProfiles instead of relying on GeckoAppShell. r=ally
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 20 Jul 2015 11:55:32 +0200
changeset 254115 f1382c7f4e8276f4f991797036a28ff40a3f42e0
parent 254114 8e6cd43760b3b7d78db25a82bb704b4bc9ab132f
child 254116 b787fd6ee92bb0096f5cf439c061c9e1ea644bdf
push id29089
push userryanvm@gmail.com
push dateWed, 22 Jul 2015 20:29:27 +0000
treeherdermozilla-central@7abecce35aca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs1184683
milestone42.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 1184683 - GeckoPreferences: Pass current context to RestrictedProfiles instead of relying on GeckoAppShell. r=ally
mobile/android/base/RestrictedProfiles.java
mobile/android/base/preferences/GeckoPreferences.java
--- a/mobile/android/base/RestrictedProfiles.java
+++ b/mobile/android/base/RestrictedProfiles.java
@@ -176,17 +176,17 @@ public class RestrictedProfiles {
         return true;
     }
 
     @WrapElementForJNI
     public static boolean isUserRestricted() {
         return isUserRestricted(GeckoAppShell.getContext());
     }
 
-    private static boolean isUserRestricted(final Context context) {
+    public static boolean isUserRestricted(final Context context) {
         // Guest mode is supported in all Android versions.
         if (getInGuest()) {
             return true;
         }
 
         if (Versions.preJBMR2) {
             return false;
         }
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -692,17 +692,17 @@ OnSharedPreferenceChangeListener
                     if (!AppConstants.NIGHTLY_BUILD || (!InputOptionsUtils.supportsVoiceRecognizer(getApplicationContext(), getResources().getString(R.string.voicesearch_prompt)) &&
                             !InputOptionsUtils.supportsQrCodeReader(getApplicationContext()))) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 }
                 if (PREFS_DEVTOOLS.equals(key) &&
-                    RestrictedProfiles.isUserRestricted()) {
+                    RestrictedProfiles.isUserRestricted(this)) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 }
 
                 setupPreferences((PreferenceGroup) pref, prefs);
             } else {
                 pref.setOnPreferenceChangeListener(this);