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

Commit d0752818 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Only layout surfaces if applicable when app is going away

Otherwise we defer/continue layout which causes at least one
layout unnecessarily when an app without any visible activities
gets killed.

Test: Boots
Test: Kill app while in foreground

Change-Id: Id07885f57aafe63dc8fd82810d1d9118144ca938
Fixes: 117751071
parent f3867a70
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -6268,21 +6268,23 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                    finishInstrumentationCallback.run();
                }

                if (!restarting && hasVisibleActivities) {
                    mWindowManager.deferSurfaceLayout();
                    try {
                    if (!restarting && hasVisibleActivities
                            && !mRootActivityContainer.resumeFocusedStacksTopActivities()) {
                        // If there was nothing to resume, and we are not already restarting this
                        // process, but there is a visible activity that is hosted by the process...
                        // then make sure all visible activities are running, taking care of
                        // restarting this process.
                        mRootActivityContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
                        if (!mRootActivityContainer.resumeFocusedStacksTopActivities()) {
                            // If there was nothing to resume, and we are not already restarting
                            // this process, but there is a visible activity that is hosted by the
                            // process...then make sure all visible activities are running, taking
                            // care of restarting this process.
                            mRootActivityContainer.ensureActivitiesVisible(null, 0,
                                    !PRESERVE_WINDOWS);
                        }
                    } finally {
                        mWindowManager.continueSurfaceLayout();
                    }
                }
            }
        }

        @Override
        public void closeSystemDialogs(String reason) {