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

Commit 791d5515 authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Properly mark asyncStart situations" into main

parents bcfb1d75 ceb8296c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -299,6 +299,14 @@ public class ActionChain {
            mStack.removeLast();
        }

        /**
         * Temporary query. Eventually anything that needs to check this should have its own chain
         * link.
         */
        boolean isInChain() {
            return !mStack.isEmpty();
        }

        /**
         * Special handling during "gaps" in atomicity while using the async-start hack. The
         * "end" tracking needs to account for this and we also want to track/report how often
+8 −0
Original line number Diff line number Diff line
@@ -2811,6 +2811,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
        final ActivityOptions activityOptions = options != null
                ? options.getOptions(this)
                : null;
        boolean inChain;
        synchronized (mService.mGlobalLock) {
            final boolean isCallerRecents = mRecentTasks.isCallerRecents(callingUid);
            boolean moveHomeTaskForward = isCallerRecents;
@@ -2926,6 +2927,10 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
            intent = task.intent;
            intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
            userId = task.mUserId;
            inChain = mService.mChainTracker.isInChain();
            if (inChain) {
                mService.mChainTracker.pushAsyncStart();
            }
        }
        // ActivityStarter will acquire the lock where the places need, so execute the request
        // outside of the lock.
@@ -2948,6 +2953,9 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
                    task.removeIfPossible("start-from-recents");
                }
                mService.continueWindowLayout();
                if (inChain) {
                    mService.mChainTracker.popAsyncStart();
                }
            }
        }
    }