From 1c2ffc5410751d35acdcd7d831d944485c88aaeb Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Wed, 27 Jan 2021 11:49:50 -0800 Subject: [PATCH] Apply window crop on entering PiP transition For entering PiP transition in button navigation mode, there seems to be regression causing the black background when there is no source rect hint being set. Work around this by explicitly applying window crop on the start of transition. Video: http://rcll/aaaaaabFQoRHlzixHdtY/e9o986ZD7jO0rI14rrwoRZ Bug: 178242567 Test: See video Change-Id: I89ba5a41f0d6fc7ad9873455348b22db3f364615 --- .../src/com/android/wm/shell/pip/PipAnimationController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java index aeea10d47a67d..90992fb92324b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java @@ -469,6 +469,11 @@ public class PipAnimationController { getSurfaceTransactionHelper() .alpha(tx, leash, 1f) .round(tx, leash, shouldApplyCornerRadius()); + // TODO(b/178632364): this is a work around for the black background when + // entering PiP in buttion navigation mode. + if (isInPipDirection(direction)) { + tx.setWindowCrop(leash, getStartValue()); + } tx.show(leash); tx.apply(); }