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

Commit cccc56b0 authored by Jonathan Scott's avatar Jonathan Scott
Browse files

Make ScreenPinningSettings behaviour consistent with LockTaskController.

Bug: 127605586
Test: Manual
Change-Id: I1d79fb529cfaf921657ef9eaca01b8a6a4e2dfef
parent c962ea09
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -117,9 +117,13 @@ public class ScreenPinningSettings extends SettingsPreferenceFragment
    }

    private boolean isScreenLockUsed() {
        int def = getCurrentSecurityTitle() != R.string.screen_pinning_unlock_none ? 1 : 0;
        return Settings.Secure.getInt(getContentResolver(),
                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED, def) != 0;
        // This functionality should be kept consistent with
        // com.android.server.wm.LockTaskController (see b/127605586)
        int defaultValueIfSettingNull = mLockPatternUtils.isSecure(UserHandle.myUserId()) ? 1 : 0;
        return Settings.Secure.getInt(
                getContentResolver(),
                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED,
                defaultValueIfSettingNull) != 0;
    }

    private boolean setScreenLockUsed(boolean isEnabled) {