summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android Build Merger (Role) <noreply-android-build-merger@google.com> 2019-05-07 19:40:17 +0000
committer Android Build Merger (Role) <noreply-android-build-merger@google.com> 2019-05-07 19:40:17 +0000
commit498d367b2cfbd25c19a1c7c3b489e1113b240294 (patch)
treea0e074c72c2d9738d53e107612e63b6ec7c4f4d3
parent3f1d0ccd2df36c3818c5adb7112463501a4a0b64 (diff)
parent4938d3e51873e04e2e8b02da6ea1a1501ad24460 (diff)
[automerger] [RESTRICT AUTOMERGE] Make Lock task default behaviour consistent with Settings. am: fe9f143d2c am: 4938d3e518
Change-Id: I6a2f5b46c70720cedf377f107b77d590b297aea4
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java32
1 files changed, 20 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index c6ab9186456d..636982f0a2d6 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -3977,18 +3977,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
mLockTaskNotify = new LockTaskNotify(mService.mContext);
}
mLockTaskNotify.show(false);
- try {
- boolean shouldLockKeyguard = Settings.Secure.getInt(
- mService.mContext.getContentResolver(),
- Settings.Secure.LOCK_TO_APP_EXIT_LOCKED) != 0;
- if (mLockTaskModeState == LOCK_TASK_MODE_PINNED && shouldLockKeyguard) {
- mWindowManager.lockNow(null);
- mWindowManager.dismissKeyguard();
- new LockPatternUtils(mService.mContext)
- .requireCredentialEntry(UserHandle.USER_ALL);
- }
- } catch (SettingNotFoundException e) {
- // No setting, don't lock.
+ if (mLockTaskModeState == LOCK_TASK_MODE_PINNED && shouldLockKeyguard()) {
+ mWindowManager.lockNow(null);
+ mWindowManager.dismissKeyguard();
+ new LockPatternUtils(mService.mContext)
+ .requireCredentialEntry(UserHandle.USER_ALL);
}
} catch (RemoteException ex) {
throw new RuntimeException(ex);
@@ -4025,6 +4018,21 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
}
+ private boolean shouldLockKeyguard() {
+ // This functionality should be kept consistent with
+ // com.android.settings.security.ScreenPinningSettings (see b/127605586)
+ try {
+ return Settings.Secure.getInt(
+ mService.mContext.getContentResolver(),
+ Settings.Secure.LOCK_TO_APP_EXIT_LOCKED) != 0;
+ } catch (Settings.SettingNotFoundException e) {
+ // Log to SafetyNet for b/127605586
+ android.util.EventLog.writeEvent(0x534e4554, "127605586", -1, "");
+ LockPatternUtils lockPatternUtils = new LockPatternUtils(mService.mContext);
+ return lockPatternUtils.isSecure(mCurrentUser);
+ }
+ }
+
class ActivityContainer extends android.app.IActivityContainer.Stub {
final static int FORCE_NEW_TASK_FLAGS = FLAG_ACTIVITY_NEW_TASK |
FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION;