summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/cyanogenmod/SystemSettings.java
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2013-06-21 08:34:07 +0200
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-06-22 14:15:05 -0700
commit39f48c03d70d7df08520e9a042160accfdb6e2e6 (patch)
treeb5896e30d3dcc043922353a8ab39b03950c6a895 /src/com/android/settings/cyanogenmod/SystemSettings.java
parentafb635c9956b03f8303d89ab7022cb88b8eec75e (diff)
downloadpackages_apps_settings-39f48c03d70d7df08520e9a042160accfdb6e2e6.zip
packages_apps_settings-39f48c03d70d7df08520e9a042160accfdb6e2e6.tar.gz
packages_apps_settings-39f48c03d70d7df08520e9a042160accfdb6e2e6.tar.bz2
Make system UI settings work for multi-user (2/2)
Change-Id: I88ab9fa0cb7791c5f9d859ab6531346f2aa55193
Diffstat (limited to 'src/com/android/settings/cyanogenmod/SystemSettings.java')
-rw-r--r--src/com/android/settings/cyanogenmod/SystemSettings.java29
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