diff options
Diffstat (limited to 'src/com/android/settings/cyanogenmod')
-rw-r--r-- | src/com/android/settings/cyanogenmod/PowerMenu.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/settings/cyanogenmod/PowerMenu.java b/src/com/android/settings/cyanogenmod/PowerMenu.java index 3d74d87..44a195c 100644 --- a/src/com/android/settings/cyanogenmod/PowerMenu.java +++ b/src/com/android/settings/cyanogenmod/PowerMenu.java @@ -18,6 +18,7 @@ package com.android.settings.cyanogenmod; import android.content.res.Resources; import android.os.Bundle; +import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; import android.preference.CheckBoxPreference; @@ -26,6 +27,8 @@ import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceScreen; import android.provider.Settings; +import android.util.Log; +import android.view.WindowManagerGlobal; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; @@ -71,6 +74,16 @@ public class PowerMenu extends SettingsPreferenceFragment implements mExpandedDesktopPref.setValue(String.valueOf(expandedDesktopValue)); updateExpandedDesktopSummary(expandedDesktopValue); + // Hide no-op "Status bar visible" mode on devices without navbar + try { + if (!WindowManagerGlobal.getWindowManagerService().hasNavigationBar()) { + mExpandedDesktopPref.setEntries(R.array.expanded_desktop_entries_no_navbar); + mExpandedDesktopPref.setEntryValues(R.array.expanded_desktop_values_no_navbar); + } + } catch (RemoteException e) { + Log.e(TAG, "Error getting navigation bar status"); + } + mProfilesPref = (CheckBoxPreference) findPreference(KEY_PROFILES); mProfilesPref.setChecked((Settings.System.getInt(getContentResolver(), Settings.System.POWER_MENU_PROFILES_ENABLED, 1) == 1)); @@ -159,6 +172,9 @@ public class PowerMenu extends SettingsPreferenceFragment implements Settings.System.putInt(getContentResolver(), Settings.System.POWER_MENU_EXPANDED_DESKTOP_ENABLED, 0); mExpandedDesktopPref.setSummary(res.getString(R.string.expanded_desktop_disabled)); + // Disable expanded desktop if enabled + Settings.System.putInt(getContentResolver(), + Settings.System.EXPANDED_DESKTOP_STATE, 0); } else if (value == 1) { Settings.System.putInt(getContentResolver(), Settings.System.POWER_MENU_EXPANDED_DESKTOP_ENABLED, 1); |