From 588a3337419d33005555d80594256b364593b35f Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Wed, 18 Jan 2017 18:46:42 +0000 Subject: [PATCH] Launch work lock scrim as clear_top not single_top SINGLE_TOP is only guaranteed to work within the current task stack. If multiple stacks are inactive in the background (eg. temporarily switching from freeform mode to fullscreen mode by maximising one activity) some tasks might get missed out and stay visible. Test: manual -- start two work activities, one in fullscreen & one in freeform. start a personal Test: activity in freeform too. switch to the fullscreen work app and lock the profile using Test: `adb shell service call trust 6 i32 $USER_ID i32 1` Test: __outcome after change__ Test: a) locking work profile should bring up the work password prompt in fullscreen Test: b) skipping the prompt and switching to the personal freeform app should keep the freeform Test: work app hidden by WorkLockActivity Test: __outcome before change__ Test: Only (a) happened, for step (b) the work app was still visible Bug: 31001762 Change-Id: I5979c5b12670a21c7bcd59e222fc518d395e3e29 --- packages/SystemUI/AndroidManifest.xml | 1 - .../systemui/keyguard/WorkLockActivityController.java | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index ff76c56fe94e9..e7e09805ce9f2 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -496,7 +496,6 @@ android:label="@string/accessibility_desc_work_lock" android:permission="android.permission.MANAGE_USERS" android:exported="false" - android:launchMode="singleTop" android:excludeFromRecents="true" android:stateNotNeeded="true" android:resumeWhilePausing="true" diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/WorkLockActivityController.java b/packages/SystemUI/src/com/android/systemui/keyguard/WorkLockActivityController.java index 2c41a0886445a..e6483f6332bac 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/WorkLockActivityController.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/WorkLockActivityController.java @@ -42,9 +42,8 @@ public class WorkLockActivityController { Intent intent = new Intent(KeyguardManager.ACTION_CONFIRM_DEVICE_CREDENTIAL_WITH_USER) .setComponent(new ComponentName(mContext, WorkLockActivity.class)) .putExtra(Intent.EXTRA_USER_ID, userId) - .addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS - | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT - | Intent.FLAG_ACTIVITY_SINGLE_TOP); + .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT + | Intent.FLAG_ACTIVITY_CLEAR_TOP); final ActivityOptions options = ActivityOptions.makeBasic(); options.setLaunchTaskId(taskId);