DisplayCutout: Do not letterbox LAYOUT_FULLSCREEN windows
Bug: 65689439
Test: atest PhoneWindowManagerLayoutTest
Change-Id: I34fd6421461127954483b5eb2d7ee7540ce6491c
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 3473b7d..628e6da 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1406,13 +1406,13 @@
mLetterbox.setDimensions(mPendingTransaction, getParent().getBounds(), w.mFrame);
} else if (mLetterbox != null) {
final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
+ // Make sure we have a transaction here, in case we're called outside of a transaction.
+ // This does not use mPendingTransaction, because SurfaceAnimator uses a
+ // global transaction in onAnimationEnd.
SurfaceControl.openTransaction();
try {
mLetterbox.hide(t);
} finally {
- // TODO: This should use pendingTransaction eventually, but right now things
- // happening on the animation finished callback are happening on the global
- // transaction.
SurfaceControl.mergeToGlobalTransaction(t);
SurfaceControl.closeTransaction();
}