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

Commit 76c89da6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix MixedProfileOwnerTest#testLockTask_emergencyDialer failure"

parents def5db74 a3e6b89a
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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");
        }
@@ -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;
        }
+0 −7
Original line number Diff line number Diff line
@@ -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.
     */
+0 −1
Original line number Diff line number Diff line
@@ -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();