summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorim Jaggi <jjaggi@google.com> 2017-08-04 18:06:56 +0200
committer Jorim Jaggi <jjaggi@google.com> 2017-08-04 18:25:11 +0200
commit1f83308556cb5bb0df3fb64f03b9b68f0aad6c0d (patch)
tree4d36d7c685fdcc5d8c32d7daf31cf612bf2f3592
parentc0c9324fcb03c85ef7bed2d997c441119823d31c (diff)
Defer updating dim layers if layout is deferred
When a translucent activity is on top of launcher and the activity is animated away, we update the layers too early in case the activity window is dimming. After starting the launcher, launcher is on top of activity already in the hierarchy, but we haven't started the transtion yet which would prevent the launcher to be visible on top of activity by the anim layer adjustment. To fix this, we prevent updating the layers if layout is currently deferred. Ideally we would do the whole activityStart in one surface transaction but that's way too risky at this point. Test: Open translucent dimming activity over launcher, press home, ensure no flickering. Test: go/wm-smoke Change-Id: I72b8f5f555b555646121355c19cf7813e4f8d7a3 Fixes: 64206558
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java5
-rw-r--r--services/core/java/com/android/server/wm/WindowSurfacePlacer.java4
2 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 58819144949e..1ec90b0c0a50 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -2036,6 +2036,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (dc == null) {
return;
}
+
+ // If layout is currently deferred, we want to hold of with updating the layers.
+ if (mService.mWindowPlacerLocked.isLayoutDeferred()) {
+ return;
+ }
final DimLayer.DimLayerUser dimLayerUser = getDimLayerUser();
if (dimLayerUser != null && dc.mDimLayerController.isDimming(dimLayerUser, mWinAnimator)) {
// Force an animation pass just to update the mDimLayer layer.
diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
index 690989251f61..581b0447dafc 100644
--- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
+++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java
@@ -127,6 +127,10 @@ class WindowSurfacePlacer {
}
}
+ boolean isLayoutDeferred() {
+ return mDeferDepth > 0;
+ }
+
final void performSurfacePlacement() {
performSurfacePlacement(false /* force */);
}