Bug 1200151 - Restricted profiles: Hide developer tools based on restriction. r=ally a=sylvestre
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 31 Aug 2015 13:52:32 +0200
changeset 289123 437fb42ca4364757dacaaf65a526aaf92293b28d
parent 289122 408b19349d5a8267a5e4fb90e767eed9fd2f7f52
child 289124 648c31e781680ded6dec0cf46915b7e4c9023b9a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally, sylvestre
bugs1200151
milestone42.0a2
Bug 1200151 - Restricted profiles: Hide developer tools based on restriction. r=ally a=sylvestre
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/base/restrictions/GuestProfileConfiguration.java
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -700,17 +700,17 @@ OnSharedPreferenceChangeListener
                     if (!InputOptionsUtils.supportsVoiceRecognizer(getApplicationContext(), getResources().getString(R.string.voicesearch_prompt)) &&
                             !InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 }
                 if (PREFS_DEVTOOLS.equals(key) &&
-                    RestrictedProfiles.isUserRestricted(this)) {
+                    !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 }
 
                 if (PREFS_CUSTOMIZE_HOME.equals(key)) {
                     if (!RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_CUSTOMIZE_HOME)) {
                         preferences.removePreference(pref);
--- a/mobile/android/base/restrictions/GuestProfileConfiguration.java
+++ b/mobile/android/base/restrictions/GuestProfileConfiguration.java
@@ -20,17 +20,18 @@ public class GuestProfileConfiguration i
             Restriction.DISALLOW_INSTALL_APPS,
             Restriction.DISALLOW_BROWSE_FILES,
             Restriction.DISALLOW_SHARE,
             Restriction.DISALLOW_BOOKMARK,
             Restriction.DISALLOW_ADD_CONTACTS,
             Restriction.DISALLOW_SET_IMAGE,
             Restriction.DISALLOW_MODIFY_ACCOUNTS,
             Restriction.DISALLOW_REMOTE_DEBUGGING,
-            Restriction.DISALLOW_IMPORT_SETTINGS
+            Restriction.DISALLOW_IMPORT_SETTINGS,
+            Restriction.DISALLOW_DEVELOPER_TOOLS
     );
 
     @SuppressWarnings("serial")
     private static final List<String> BANNED_SCHEMES = Arrays.asList(
             "file",
             "chrome",
             "resource",
             "jar",