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

Commit c520acac authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "[PB] Do not create windowless splash screen surface..." into main

parents 346b3a92 39a4a266
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -1361,6 +1361,8 @@ class BackNavigationController {
                                    synchronized (openTask.mWmService.mGlobalLock) {
                                        if (mRequestedStartingSurfaceId != INVALID_TASK_ID) {
                                            mStartingSurface = sc;
                                        } else {
                                            sc.release();
                                        }
                                    }
                                }
@@ -1599,12 +1601,20 @@ class BackNavigationController {
                    @NonNull ActivityRecord[] visibleOpenActivities) {
                boolean needsLaunchBehind = true;
                if (isSupportWindowlessSurface() && mShowWindowlessSurface && !mIsLaunchBehind) {
                    boolean activitiesAreDrawn = false;
                    for (int i = visibleOpenActivities.length - 1; i >= 0; --i) {
                        // If the activity hasn't stopped, it's window should remain drawn.
                        activitiesAreDrawn |= visibleOpenActivities[i].firstWindowDrawn;
                    }
                    final WindowContainer mainOpen = openAnimationAdaptor.mAdaptors[0].mTarget;
                    final TaskSnapshot snapshot = getSnapshot(mainOpen, visibleOpenActivities);
                    // Don't create starting surface if previous activities haven't stopped or
                    // the snapshot does not exist.
                    if (snapshot != null || !activitiesAreDrawn) {
                        openAnimationAdaptor.createStartingSurface(snapshot);
                    // set LaunchBehind if we are creating splash screen surface.
                    needsLaunchBehind = snapshot == null
                            && openAnimationAdaptor.mRequestedStartingSurfaceId != INVALID_TASK_ID;
                    }
                    // Only use LaunchBehind if snapshot does not exist.
                    needsLaunchBehind = snapshot == null;
                }
                if (needsLaunchBehind) {
                    for (int i = visibleOpenActivities.length - 1; i >= 0; --i) {