diff options
author | David van Tonder <david.vantonder@gmail.com> | 2013-03-26 20:14:03 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-03-26 20:14:03 -0700 |
commit | 27692ae1c919770057e3f68c1e640d80d65219f4 (patch) | |
tree | 2ebd6942e065ec6ae8d69cadada3f2998e2ddb60 /src/com/android/settings/cyanogenmod | |
parent | ec47c7911b4b64753352c71f665cdc982c7e1a08 (diff) | |
parent | 1a3de05f22f5a94a352ec4aae7fa3e9a1e316a40 (diff) | |
download | packages_apps_settings-27692ae1c919770057e3f68c1e640d80d65219f4.zip packages_apps_settings-27692ae1c919770057e3f68c1e640d80d65219f4.tar.gz packages_apps_settings-27692ae1c919770057e3f68c1e640d80d65219f4.tar.bz2 |
Merge "Settings: remove Pie control for devices without navbar" into cm-10.1
Diffstat (limited to 'src/com/android/settings/cyanogenmod')
-rw-r--r-- | src/com/android/settings/cyanogenmod/SystemSettings.java | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/com/android/settings/cyanogenmod/SystemSettings.java b/src/com/android/settings/cyanogenmod/SystemSettings.java index 889dc04..9e05b71 100644 --- a/src/com/android/settings/cyanogenmod/SystemSettings.java +++ b/src/com/android/settings/cyanogenmod/SystemSettings.java @@ -62,6 +62,23 @@ public class SystemSettings extends SettingsPreferenceFragment { addPreferencesFromResource(R.xml.system_settings); PreferenceScreen prefScreen = getPreferenceScreen(); + // Only show the hardware keys config on a device that does not have a navbar + // and the navigation bar config on phones that has a navigation bar + boolean removeKeys = false; + boolean removeNavbar = false; + + IWindowManager windowManager = IWindowManager.Stub.asInterface( + ServiceManager.getService(Context.WINDOW_SERVICE)); + try { + if (windowManager.hasNavigationBar()) { + removeKeys = true; + } else { + removeNavbar = true; + } + } catch (RemoteException e) { + // Do nothing + } + // Determine which user is logged in mIsPrimary = UserHandle.myUserId() == UserHandle.USER_OWNER; if (mIsPrimary) { @@ -76,22 +93,6 @@ public class SystemSettings extends SettingsPreferenceFragment { } } - // Only show the hardware keys config on a device that does not have a navbar - // and the navigation bar config on phones that has a navigation bar - boolean removeKeys = false; - boolean removeNavbar = false; - IWindowManager windowManager = IWindowManager.Stub.asInterface( - ServiceManager.getService(Context.WINDOW_SERVICE)); - try { - if (windowManager.hasNavigationBar()) { - removeKeys = true; - } else { - removeNavbar = true; - } - } catch (RemoteException e) { - // Do nothing - } - // Act on the above if (removeKeys) { prefScreen.removePreference(findPreference(KEY_HARDWARE_KEYS)); @@ -126,6 +127,11 @@ public class SystemSettings extends SettingsPreferenceFragment { // Pie controls mPieControl = (PreferenceScreen) findPreference(KEY_PIE_CONTROL); + if (mPieControl != null && removeNavbar) { + // Remove on devices without a navbar to start with + prefScreen.removePreference(mPieControl); + mPieControl = null; + } // Don't display the lock clock preference if its not installed removePreferenceIfPackageNotInstalled(findPreference(KEY_LOCK_CLOCK)); |