Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec47c791 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Gerrit Code Review
Browse files

Settings: removed "Status bar visible" expanded desktop setting for devices without navbar

On devices without navigation bar, expanded desktop is only useful
for hiding the status bar when the apps don't hide them.
"Status bar visible" setting is a no-op.

Change-Id: I16a31ec6e10c7ed11600e3b1a1d9b631f31af55e
parent 0063e159
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1239,6 +1239,16 @@
        <item>2</item>
    </string-array>

    <string-array name="expanded_desktop_entries_no_navbar" translatable="false">
        <item>@string/expanded_desktop_disabled</item>
        <item>@string/expanded_desktop_no_status_bar</item>
    </string-array>

    <string-array name="expanded_desktop_values_no_navbar" translatable="false">
        <item>0</item>
        <item>2</item>
    </string-array>

    <!-- Quick pulldown -->
    <string-array name="quick_pulldown_entries" translatable="false">
        <item>@string/quick_pulldown_off</item>
+13 −0
Original line number Diff line number Diff line
@@ -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));