Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0649ceb authored by Clara Bayarri's avatar Clara Bayarri
Browse files

Work Challenge unlock to home instead of locked app

When a Work Challenge is in place and we are unlocking the device
to a foreground work app that should be locked, take the user to the
home screen instead to avoid them seeing two lock screens in a row.

Bug: 26579952
Change-Id: I6220aac730fbb1da3c3042d0f232cb9cbb18ec4b
parent 3dbb412c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11265,9 +11265,13 @@ public final class ActivityManagerService extends ActivityManagerNative
                    + android.Manifest.permission.DEVICE_POWER);
        }
        final int user = UserHandle.myUserId();
        synchronized(this) {
            long ident = Binder.clearCallingIdentity();
            try {
                if (!shown && mStackSupervisor.isFocusedUserLockedProfile()) {
                    startHomeActivityLocked(user, "setLockScreenShown");
                }
                if (DEBUG_LOCKSCREEN) logLockScreen(" shown=" + shown);
                mLockScreenShown = shown ? LOCK_SCREEN_SHOWN : LOCK_SCREEN_HIDDEN;
                updateSleepIfNeededLocked();
+6 −0
Original line number Diff line number Diff line
@@ -692,6 +692,12 @@ public final class ActivityStackSupervisor implements DisplayListener {
        return null;
    }

    boolean isFocusedUserLockedProfile() {
        final int userId = mFocusedStack.topRunningActivityLocked().userId;
        return userId != UserHandle.myUserId()
                && mService.mUserController.shouldConfirmCredentials(userId);
    }

    void setNextTaskIdForUserLocked(int taskId, int userId) {
        final int currentTaskId = mCurTaskIdForUser.get(userId, -1);
        if (taskId > currentTaskId) {