diff options
author | David van Tonder <david.vantonder@gmail.com> | 2013-06-24 12:42:48 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-06-24 12:42:48 -0700 |
commit | 41ef818e08ebb13cedf999c347ed79d75d938364 (patch) | |
tree | c048a5ed5b77ff4277297ba5898718b886bde586 /src | |
parent | 855a3fcab6da25b84e82af767a1d1afb7106a827 (diff) | |
parent | 39f48c03d70d7df08520e9a042160accfdb6e2e6 (diff) | |
download | packages_apps_settings-41ef818e08ebb13cedf999c347ed79d75d938364.zip packages_apps_settings-41ef818e08ebb13cedf999c347ed79d75d938364.tar.gz packages_apps_settings-41ef818e08ebb13cedf999c347ed79d75d938364.tar.bz2 |
Merge "Make system UI settings work for multi-user (2/2)" into cm-10.1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/cyanogenmod/SystemSettings.java | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/com/android/settings/cyanogenmod/SystemSettings.java b/src/com/android/settings/cyanogenmod/SystemSettings.java index 0b0d29c..7be4e03 100644 --- a/src/com/android/settings/cyanogenmod/SystemSettings.java +++ b/src/com/android/settings/cyanogenmod/SystemSettings.java @@ -26,6 +26,7 @@ import android.os.UserHandle; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.PreferenceCategory; import android.preference.PreferenceScreen; import android.provider.Settings; import android.util.Log; @@ -74,6 +75,9 @@ public class SystemSettings extends SettingsPreferenceFragment implements boolean removeKeys = false; boolean removeNavbar = false; + PreferenceCategory navbarCategory = + (PreferenceCategory) findPreference(KEY_NAVIGATION_BAR_CATEGORY); + IWindowManager windowManager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); try { @@ -86,6 +90,13 @@ public class SystemSettings extends SettingsPreferenceFragment implements // Do nothing } + if (removeKeys) { + prefScreen.removePreference(findPreference(KEY_HARDWARE_KEYS)); + } + if (removeNavbar) { + prefScreen.removePreference(navbarCategory); + } + // Determine which user is logged in mIsPrimary = UserHandle.myUserId() == UserHandle.USER_OWNER; if (mIsPrimary) { @@ -99,27 +110,9 @@ public class SystemSettings extends SettingsPreferenceFragment implements mBatteryPulse = null; } } - - // Act on the above - if (removeKeys) { - prefScreen.removePreference(findPreference(KEY_HARDWARE_KEYS)); - } - if (removeNavbar) { - prefScreen.removePreference(findPreference(KEY_NAVIGATION_BAR)); - prefScreen.removePreference(findPreference(KEY_NAVIGATION_RING)); - prefScreen.removePreference(findPreference(KEY_NAVIGATION_BAR_CATEGORY)); - } } else { // Secondary user is logged in, remove all primary user specific preferences prefScreen.removePreference(findPreference(KEY_BATTERY_LIGHT)); - prefScreen.removePreference(findPreference(KEY_HARDWARE_KEYS)); - prefScreen.removePreference(findPreference(KEY_NAVIGATION_BAR)); - prefScreen.removePreference(findPreference(KEY_NAVIGATION_RING)); - prefScreen.removePreference(findPreference(KEY_NAVIGATION_BAR_CATEGORY)); - prefScreen.removePreference(findPreference(KEY_STATUS_BAR)); - prefScreen.removePreference(findPreference(KEY_QUICK_SETTINGS)); - prefScreen.removePreference(findPreference(KEY_POWER_MENU)); - prefScreen.removePreference(findPreference(KEY_NOTIFICATION_DRAWER)); } // Preferences that applies to all users |