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

Commit 31f63fbf authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Avoid app pinning requests if the Task is already locked" into sc-dev...

Merge "Avoid app pinning requests if the Task is already locked" into sc-dev am: 92e535ff am: 8eb41edd am: 9d25b568 am: 0a97c13c am: 567ac720 am: 9bc35a21

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/31095990



Change-Id: I3d61db1c43ac2f1edfd4d08f3a7e216a8d31f5fb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7c163336 9bc35a21
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -652,6 +652,10 @@ public class LockTaskController {
        if (!isSystemCaller) {
        if (!isSystemCaller) {
            task.mLockTaskUid = callingUid;
            task.mLockTaskUid = callingUid;
            if (task.mLockTaskAuth == LOCK_TASK_AUTH_PINNABLE) {
            if (task.mLockTaskAuth == LOCK_TASK_AUTH_PINNABLE) {
                if (mLockTaskModeTasks.contains(task)) {
                    Slog.i(TAG_LOCKTASK, "Already locked.");
                    return;
                }
                // startLockTask() called by app, but app is not part of lock task allowlist. Show
                // startLockTask() called by app, but app is not part of lock task allowlist. Show
                // app pinning request. We will come back here with isSystemCaller true.
                // app pinning request. We will come back here with isSystemCaller true.
                ProtoLog.w(WM_DEBUG_LOCKTASK, "Mode default, asking user");
                ProtoLog.w(WM_DEBUG_LOCKTASK, "Mode default, asking user");
+5 −0
Original line number Original line Diff line number Diff line
@@ -239,6 +239,11 @@ public class LockTaskControllerTest {
        verifyLockTaskStarted(STATUS_BAR_MASK_PINNED, DISABLE2_NONE);
        verifyLockTaskStarted(STATUS_BAR_MASK_PINNED, DISABLE2_NONE);
        // THEN screen pinning toast should be shown
        // THEN screen pinning toast should be shown
        verify(mStatusBarService).showPinningEnterExitToast(eq(true /* entering */));
        verify(mStatusBarService).showPinningEnterExitToast(eq(true /* entering */));

        // WHEN the app calls startLockTaskMode while the Task is already locked
        mLockTaskController.startLockTaskMode(tr, false, TEST_UID);
        // THEN a pinning request should NOT be shown
        verify(mStatusBarManagerInternal, never()).showScreenPinningRequest(anyInt());
    }
    }


    @Test
    @Test