Bug 1197721 - Restricted profiles: Hide "Display" menu items in non-"split pane" settings list too. r=mhaigh a=sylvestre
authorSebastian Kaspari <s.kaspari@gmail.com>
Fri, 28 Aug 2015 13:31:45 +0200
changeset 289158 5fdfd34cc99fef36191ec59495046799d8342c84
parent 289157 cb909f354cabbc386006525881104285a841bc0b
child 289159 99be82d7ce88487bd4ae6dcd6baa003b46d9e76b
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)
reviewersmhaigh, sylvestre
bugs1197721
milestone42.0a2
Bug 1197721 - Restricted profiles: Hide "Display" menu items in non-"split pane" settings list too. r=mhaigh a=sylvestre
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/base/resources/xml-v11/preferences.xml
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -127,16 +127,17 @@ OnSharedPreferenceChangeListener
     private static final String PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED = "devtools.remote.wifi.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";
     public static final String PREFS_OPEN_URLS_IN_PRIVATE = NON_PREF_PREFIX + "openExternalURLsPrivately";
     public static final String PREFS_VOICE_INPUT_ENABLED = NON_PREF_PREFIX + "voice_input_enabled";
     public static final String PREFS_QRCODE_ENABLED = NON_PREF_PREFIX + "qrcode_enabled";
     private static final String PREFS_DEVTOOLS = NON_PREF_PREFIX + "devtools.enabled";
+    private static final String PREFS_DISPLAY = NON_PREF_PREFIX + "display.enabled";
     private static final String PREFS_CUSTOMIZE_HOME = NON_PREF_PREFIX + "customize_home";
     private static final String PREFS_TRACKING_PROTECTION_PRIVATE_BROWSING = "privacy.trackingprotection.pbmode.enabled";
     private static final String PREFS_TRACKING_PROTECTION_LEARN_MORE = NON_PREF_PREFIX + "trackingprotection.learn_more";
     private static final String PREFS_CATEGORY_PRIVATE_DATA = NON_PREF_PREFIX + "category_private_data";
 
     private static final String ACTION_STUMBLER_UPLOAD_PREF = AppConstants.ANDROID_PACKAGE_NAME + ".STUMBLER_PREF";
 
 
@@ -705,17 +706,21 @@ OnSharedPreferenceChangeListener
                     }
                 }
                 if (PREFS_DEVTOOLS.equals(key) &&
                     !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 }
-
+                if (PREFS_DISPLAY.equals(key) && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DISPLAY_SETTINGS)) {
+                    preferences.removePreference(pref);
+                    i--;
+                    continue;
+                }
                 if (PREFS_CUSTOMIZE_HOME.equals(key)) {
                     if (!RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_CUSTOMIZE_HOME)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 }
                 if (PREFS_CATEGORY_PRIVATE_DATA.equals(key)) {
--- a/mobile/android/base/resources/xml-v11/preferences.xml
+++ b/mobile/android/base/resources/xml-v11/preferences.xml
@@ -21,17 +21,18 @@
                       android:key="android.not_a_preference.customize_screen"
                       android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
         <extra android:name="resource"
                android:value="preferences_customize"/>
     </PreferenceScreen>
 
     <PreferenceScreen android:title="@string/pref_category_display"
                       android:summary="@string/pref_category_display_summary"
-                      android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
+                      android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
+                      android:key="android.not_a_preference.display.enabled" >
         <extra android:name="resource"
                android:value="preferences_display" />
     </PreferenceScreen>
 
 
     <PreferenceScreen android:title="@string/pref_category_privacy_short"
                       android:summary="@string/pref_category_privacy_summary"
                       android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >