From d137a1dba045925ed6a20f1fad80fbbdb79c04e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ciche=C5=84ski?= Date: Tue, 16 May 2023 00:27:36 +0000 Subject: [PATCH] Set alpha to 0 on attach to avoid flicker at transition start. Otherwise there is a race condition risk of rendering it for one frame before it actually gets the first call to onAnimationUpdate. Change-Id: Ifcf7103a78631c6c1408735acf3eb13888ae8dea Test: manual, 20x enter Maps PiP without the repro of overlay flicker Bug: 281711939 --- .../Shell/src/com/android/wm/shell/pip/PipContentOverlay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java index 9fa57cacb11f5..c701b9581ca21 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipContentOverlay.java @@ -206,6 +206,7 @@ public abstract class PipContentOverlay { tx.show(mLeash); tx.setLayer(mLeash, Integer.MAX_VALUE); tx.setBuffer(mLeash, mBitmap.getHardwareBuffer()); + tx.setAlpha(mLeash, 0f); tx.reparent(mLeash, parentLeash); tx.apply(); }