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

Commit e0c3d5dd authored by Winson Chung's avatar Winson Chung
Browse files

Fixing regression in what is considered a restart attempt

- CTS tests can start activities directly in the pinned stack with the
  CLEAR_TASK and NEW_TASK flags, so this check should only consider it
  a restart attempt if mReusedTask is set, as in
  setTaskFromIntentActivity(), otherwise the newly started activity
  will be triggered back into fullscreen.

Bug: 37501224
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: Ia37f9d77bfb85882e50271300234bfc6c2969f9a
parent 07672353
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ class ActivityStarter {
        }

        boolean clearedTask = (mLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK))
                == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK);
                == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK) && (mReuseTask != null);
        if (startedActivityStackId == PINNED_STACK_ID && (result == START_TASK_TO_FRONT
                || result == START_DELIVERED_TO_TOP || clearedTask)) {
            // The activity was already running in the pinned stack so it wasn't started, but either