Bug 1197721 - Restricted profiles: Hide "Display" menu items in non-"split pane" settings list too. r=mhaigh
authorSebastian Kaspari <s.kaspari@gmail.com>
Fri, 28 Aug 2015 13:31:45 +0200
changeset 293133 b4ca0600cbe11f7536e4356dab3423efa263ee09
parent 293132 ee9881d7a21c1e3aab8285dde3914be8e25db1e0
child 293134 40b4be91ecf052a7f713990cdf7cdfcad5b16540
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1197721
milestone43.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 1197721 - Restricted profiles: Hide "Display" menu items in non-"split pane" settings list too. r=mhaigh
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";
 
 
@@ -706,17 +707,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" >