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

Commit 380b39a9 authored by Louis Chang's avatar Louis Chang
Browse files

Allow activity coalescing when starting from last launched uid

When task bounds do not match, activity coalescing was not allowed.
This was initially implemented in commit abf63715 to prevent
coalescing when a host application launches multiple activities
of different apps simultaneously. This change prioritizes the
UID check before the bounds check.

Bug: 430687520
Test: start an app to Desktop, to background, start it again to bubble
Flag: EXEMPT bugfix

Change-Id: Idfbdacf51afb79e9611797a04a64e974de35caed
parent 1b71878f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -434,6 +434,10 @@ class ActivityMetricsLogger {
                    || mLastLaunchedActivity.getWindowingMode() != r.getWindowingMode()) {
                return false;
            }
            if (mLastLaunchedActivity.isUid(r.launchedFromUid)) {
                return true;
            }

            // The current task should be non-null because it is just launched. While the
            // last task can be cleared when starting activity with FLAG_ACTIVITY_CLEAR_TASK.
            final Task lastTask = mLastLaunchedActivity.getTask();
@@ -444,7 +448,8 @@ class ActivityMetricsLogger {
                }
                return lastTask.getBounds().equals(currentTask.getBounds());
            }
            return mLastLaunchedActivity.isUid(r.launchedFromUid);

            return false;
        }

        /** @return {@code true} if the activity matches a launched activity in this transition. */