OSDN Git Service

[RESTRICT AUTOMERGE] Make ScreenPinningSettings behaviour consistent with lock tasks.
authorJonathan Scott <scottjonathan@google.com>
Tue, 7 May 2019 16:20:00 +0000 (17:20 +0100)
committerNikoli Cartagena <dargeren@google.com>
Mon, 10 Jun 2019 18:35:30 +0000 (11:35 -0700)
Bug: 127605586
Test: Manual
Change-Id: I4186c2d57b42b6e3d27013f2c9708fca56c561fe
Merged-In: I1cdd82bea4dc9e4182694b061a7746aa83dabdfe
(cherry picked from commit b985aa2f2930e30218bdd1cf1161453b7e622418)

src/com/android/settings/ScreenPinningSettings.java

index fb28dfb..9ff4893 100644 (file)
@@ -106,9 +106,11 @@ public class ScreenPinningSettings extends SettingsPreferenceFragment
     }
 
     private boolean isScreenLockUsed() {
-        int def = getCurrentSecurityTitle() != R.string.screen_pinning_unlock_none ? 1 : 0;
+        // This functionality should be kept consistent with
+        // com.android.server.am.ActivityStackSupervisor (see b/127605586)
+        int defaultValueIfSettingNull = mLockPatternUtils.isSecure(UserHandle.myUserId()) ? 1 : 0;
         return Settings.Secure.getInt(getContentResolver(),
-                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED, def) != 0;
+                Settings.Secure.LOCK_TO_APP_EXIT_LOCKED, defaultValueIfSettingNull) != 0;
     }
 
     private boolean setScreenLockUsed(boolean isEnabled) {