summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2018-10-16 16:07:20 +0200
committerJorim Jaggi <jjaggi@google.com>2018-12-07 09:52:31 -0800
commitd0752818e565b4772d08a8eebad1200f2b082139 (patch)
tree53853deb5388dfa5385b0bac8c222df7418ebd60
parentf3867a703bdaee7d24e70c7bed41f5ffe2f4999f (diff)
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
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskManagerService.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 0967afda6d2d..4084501a4b50 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -6268,18 +6268,20 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
finishInstrumentationCallback.run();
}
- 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 (!restarting && hasVisibleActivities) {
+ mWindowManager.deferSurfaceLayout();
+ try {
+ 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();
}
- } finally {
- mWindowManager.continueSurfaceLayout();
}
}
}