Commit 687b1806 authored by Jonathan Scott's avatar Jonathan Scott Committed by Bryan Ferris

[RESTRICT AUTOMERGE] Make ScreenPinningSettings behaviour consistent with LockTaskController.

Bug: 127605586
Test: Manual
Change-Id: Id85632b5e6975fc5f92d6e8126a6603a07f097e1
parent 83d678bd
......@@ -115,9 +115,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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment