diff options
Diffstat (limited to 'src/com/android/settings/cyanogenmod/SystemSettings.java')
-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)); |