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

Commit ad022307 authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

Settings: Can't unpin screen.

Unpin screen should use "Recents" key on NavigationBar. There is
no NavigationBar while The value config_showNavigationBar is false.
So it can't unpin screen.

Remove "Screen Pin" in Settings if config_showNavigationBar is
false.

CRs-Fixed: 767015

Change-Id: I8b5f561695b8ca4d92abe46751b512d840922e53
parent 28aefdf3
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@

package com.android.settings;


import android.app.Activity;
import android.app.AlertDialog;
import android.app.AppOpsManager;
@@ -434,6 +433,15 @@ public class SecuritySettings extends SettingsPreferenceFragment
        PreferenceGroup advancedCategory =
                (PreferenceGroup)root.findPreference(KEY_ADVANCED_SECURITY);
        if (advancedCategory != null) {

            boolean hasNavBar = getActivity().getResources().getBoolean(
                    com.android.internal.R.bool.config_showNavigationBar);
            Preference screenPinning =
                    advancedCategory.findPreference(KEY_SCREEN_PINNING);
            if (!hasNavBar) {
                advancedCategory.removePreference(screenPinning);
            }

            Preference manageAgents = advancedCategory.findPreference(KEY_MANAGE_TRUST_AGENTS);
            if (manageAgents != null && !mLockPatternUtils.isSecure()) {
                manageAgents.setEnabled(false);