summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2018-03-21 13:48:26 +0100
committer Adrian Roos <roosa@google.com> 2018-03-21 13:48:26 +0100
commitf93b6d2717bf80f59ebf4f0bc53616949b1db920 (patch)
tree6cc33bfb7239234c48ef9df02ee72168b987e4c8
parent51d2cc45d8a7efac4e83303737ee8168fc161291 (diff)
Preserve letterbox while dragResizing
Fixes an issue where the letterbox would disappear while entering and leaving dragResizing, because this clears the hasDrawnState. To fix this, also treat preserved surfaces as ready to show for letterboxing purposes. Change-Id: I4d6e1b1a27d99542370fde8924f126eca1ea80d5 Fixes: 76008154 Test: Enable double cutout, enter split screen, go home, touch slider verify the letterbox does not flicker.
-rw-r--r--services/core/java/com/android/server/wm/AppWindowToken.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index d2ddf551fc8d..f77439e15caf 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1471,11 +1471,13 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
void layoutLetterbox(WindowState winHint) {
final WindowState w = findMainWindow();
- if (w != winHint && winHint != null && w != null) {
+ if (w == null || winHint != null && w != winHint) {
return;
}
- final boolean needsLetterbox = w != null && w.isLetterboxedAppWindow()
- && fillsParent() && w.hasDrawnLw();
+ final boolean surfaceReady = w.hasDrawnLw() // Regular case
+ || w.mWinAnimator.mSurfaceDestroyDeferred // The preserved surface is still ready.
+ || w.isDragResizeChanged(); // Waiting for relayoutWindow to call preserveSurface.
+ final boolean needsLetterbox = w.isLetterboxedAppWindow() && fillsParent() && surfaceReady;
if (needsLetterbox) {
if (mLetterbox == null) {
mLetterbox = new Letterbox(() -> makeChildSurface(null));