Loading services/core/java/com/android/server/wm/ActivityStarter.java +7 −3 Original line number Diff line number Diff line Loading @@ -1535,6 +1535,11 @@ class ActivityStarter { final TaskRecord taskToAffiliate = (mLaunchTaskBehind && mSourceRecord != null) ? mSourceRecord.getTaskRecord() : null; setNewTask(taskToAffiliate); if (mService.getLockTaskController().isLockTaskModeViolation( mStartActivity.getTaskRecord())) { Slog.e(TAG, "Attempted Lock Task Mode violation mStartActivity=" + mStartActivity); return START_RETURN_LOCK_TASK_MODE_VIOLATION; } } else if (mAddingToTask) { addOrReparentStartingActivity(targetTask, "adding to task"); } Loading Loading @@ -1654,9 +1659,8 @@ class ActivityStarter { final boolean isNewClearTask = (mLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK)) == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); if (mService.getLockTaskController().isInLockTaskMode() && (newTask || mService.getLockTaskController().isLockTaskModeViolation(targetTask, isNewClearTask))) { if (!newTask && mService.getLockTaskController().isLockTaskModeViolation(targetTask, isNewClearTask)) { Slog.e(TAG, "Attempted Lock Task Mode violation mStartActivity=" + mStartActivity); return START_RETURN_LOCK_TASK_MODE_VIOLATION; } Loading services/core/java/com/android/server/wm/LockTaskController.java +0 −7 Original line number Diff line number Diff line Loading @@ -279,13 +279,6 @@ public class LockTaskController { } } /** * @return true if currently in the lock task mode, otherwise, return false. */ boolean isInLockTaskMode() { return !mLockTaskModeTasks.isEmpty(); } /** * @return whether the requested task is disallowed to be launched. */ Loading services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java +0 −1 Original line number Diff line number Diff line Loading @@ -501,7 +501,6 @@ public class ActivityStarterTests extends ActivityTestsBase { final ActivityStarter starter = prepareStarter(0); final LockTaskController lockTaskController = mService.getLockTaskController(); doReturn(true).when(lockTaskController).isInLockTaskMode(); doReturn(true).when(lockTaskController).isLockTaskModeViolation(any()); final int result = starter.setReason("testTaskModeViolation").execute(); Loading Loading
services/core/java/com/android/server/wm/ActivityStarter.java +7 −3 Original line number Diff line number Diff line Loading @@ -1535,6 +1535,11 @@ class ActivityStarter { final TaskRecord taskToAffiliate = (mLaunchTaskBehind && mSourceRecord != null) ? mSourceRecord.getTaskRecord() : null; setNewTask(taskToAffiliate); if (mService.getLockTaskController().isLockTaskModeViolation( mStartActivity.getTaskRecord())) { Slog.e(TAG, "Attempted Lock Task Mode violation mStartActivity=" + mStartActivity); return START_RETURN_LOCK_TASK_MODE_VIOLATION; } } else if (mAddingToTask) { addOrReparentStartingActivity(targetTask, "adding to task"); } Loading Loading @@ -1654,9 +1659,8 @@ class ActivityStarter { final boolean isNewClearTask = (mLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK)) == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK); if (mService.getLockTaskController().isInLockTaskMode() && (newTask || mService.getLockTaskController().isLockTaskModeViolation(targetTask, isNewClearTask))) { if (!newTask && mService.getLockTaskController().isLockTaskModeViolation(targetTask, isNewClearTask)) { Slog.e(TAG, "Attempted Lock Task Mode violation mStartActivity=" + mStartActivity); return START_RETURN_LOCK_TASK_MODE_VIOLATION; } Loading
services/core/java/com/android/server/wm/LockTaskController.java +0 −7 Original line number Diff line number Diff line Loading @@ -279,13 +279,6 @@ public class LockTaskController { } } /** * @return true if currently in the lock task mode, otherwise, return false. */ boolean isInLockTaskMode() { return !mLockTaskModeTasks.isEmpty(); } /** * @return whether the requested task is disallowed to be launched. */ Loading
services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java +0 −1 Original line number Diff line number Diff line Loading @@ -501,7 +501,6 @@ public class ActivityStarterTests extends ActivityTestsBase { final ActivityStarter starter = prepareStarter(0); final LockTaskController lockTaskController = mService.getLockTaskController(); doReturn(true).when(lockTaskController).isInLockTaskMode(); doReturn(true).when(lockTaskController).isLockTaskModeViolation(any()); final int result = starter.setReason("testTaskModeViolation").execute(); Loading