Loading services/core/java/com/android/server/wm/LockTaskController.java +4 −0 Original line number Diff line number Diff line Loading @@ -652,6 +652,10 @@ public class LockTaskController { if (!isSystemCaller) { task.mLockTaskUid = callingUid; if (task.mLockTaskAuth == LOCK_TASK_AUTH_PINNABLE) { if (mLockTaskModeTasks.contains(task)) { ProtoLog.w(WM_DEBUG_LOCKTASK, "Already locked."); return; } // 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. ProtoLog.w(WM_DEBUG_LOCKTASK, "Mode default, asking user"); Loading services/tests/wmtests/src/com/android/server/wm/LockTaskControllerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,11 @@ public class LockTaskControllerTest { verifyLockTaskStarted(STATUS_BAR_MASK_PINNED, DISABLE2_NONE); // THEN screen pinning toast should be shown 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(), anyInt()); } @Test Loading Loading
services/core/java/com/android/server/wm/LockTaskController.java +4 −0 Original line number Diff line number Diff line Loading @@ -652,6 +652,10 @@ public class LockTaskController { if (!isSystemCaller) { task.mLockTaskUid = callingUid; if (task.mLockTaskAuth == LOCK_TASK_AUTH_PINNABLE) { if (mLockTaskModeTasks.contains(task)) { ProtoLog.w(WM_DEBUG_LOCKTASK, "Already locked."); return; } // 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. ProtoLog.w(WM_DEBUG_LOCKTASK, "Mode default, asking user"); Loading
services/tests/wmtests/src/com/android/server/wm/LockTaskControllerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,11 @@ public class LockTaskControllerTest { verifyLockTaskStarted(STATUS_BAR_MASK_PINNED, DISABLE2_NONE); // THEN screen pinning toast should be shown 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(), anyInt()); } @Test Loading