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

Commit abf63715 authored by Gaurav Bhola's avatar Gaurav Bhola
Browse files

Improve the activity coalescing

- 2 Activities shouldn't coalesce if they have different launch bounds.
- Launch bounds can be different when activities are started in task
  views.
- When host app triggers start command for multiple activities at the
  same time, sometimes these activities coalesce into each other
  leading to an inconsistent task view state.

Fix: 274155443
Test: Tested manually on gcar-ui-portrait
Change-Id: Ib083da2d5500c81b07885630d08767d512076b66
parent 76c7fbbe
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -398,6 +398,7 @@ class ActivityMetricsLogger {
        /** Returns {@code true} if the incoming activity can belong to this transition. */
        boolean canCoalesce(ActivityRecord r) {
            return mLastLaunchedActivity.mDisplayContent == r.mDisplayContent
                    && mLastLaunchedActivity.getTask().getBounds().equals(r.getTask().getBounds())
                    && mLastLaunchedActivity.getWindowingMode() == r.getWindowingMode();
        }

@@ -646,7 +647,7 @@ class ActivityMetricsLogger {
    void notifyActivityLaunched(@NonNull LaunchingState launchingState, int resultCode,
            boolean newActivityCreated, @Nullable ActivityRecord launchedActivity,
            @Nullable ActivityOptions options) {
        if (launchedActivity == null) {
        if (launchedActivity == null || launchedActivity.getTask() == null) {
            // The launch is aborted, e.g. intent not resolved, class not found.
            abort(launchingState, "nothing launched");
            return;