Merge "Make ScreenPinningSettings behaviour consistent with LockTaskController." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-09 23:46:22 +00:00
committed by Android (Google) Code Review

View File

@@ -117,9 +117,13 @@ public class ScreenPinningSettings extends SettingsPreferenceFragment
} }
private boolean isScreenLockUsed() { private boolean isScreenLockUsed() {
int def = getCurrentSecurityTitle() != R.string.screen_pinning_unlock_none ? 1 : 0; // This functionality should be kept consistent with
return Settings.Secure.getInt(getContentResolver(), // com.android.server.wm.LockTaskController (see b/127605586)
Settings.Secure.LOCK_TO_APP_EXIT_LOCKED, def) != 0; 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) { private boolean setScreenLockUsed(boolean isEnabled) {