Bug 1156546 - Remove "Developer Tools" preference category when in Guest Mode. r=liuche

This commit is contained in:
Nick Rosbrook 2015-07-07 11:55:18 -07:00
parent 4dbb23b545
commit b83577f5d5
3 changed files with 13 additions and 2 deletions

View File

@ -127,9 +127,11 @@ OnSharedPreferenceChangeListener
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 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";
@ -692,6 +694,13 @@ OnSharedPreferenceChangeListener
continue;
}
}
if (PREFS_DEVTOOLS.equals(key) &&
RestrictedProfiles.isUserRestricted()) {
preferences.removePreference(pref);
i--;
continue;
}
setupPreferences((PreferenceGroup) pref, prefs);
} else {
pref.setOnPreferenceChangeListener(this);

View File

@ -55,7 +55,8 @@
<PreferenceScreen android:title="@string/pref_category_devtools"
android:summary="@string/pref_developer_remotedebugging"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:key="android.not_a_preference.devtools.enabled" >
<extra android:name="resource"
android:value="preferences_devtools"/>
</PreferenceScreen>

View File

@ -72,7 +72,8 @@
</intent>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_devtools"
android:summary="@string/pref_developer_remotedebugging" >
android:summary="@string/pref_developer_remotedebugging"
android:key="android.not_a_preference.devtools.enabled" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="@string/android_package_name"
android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >