From 1f15fd36b9779447b60992115d0a1de211518380 Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 10 Feb 2022 16:20:13 -0800 Subject: [PATCH] Fix pip fixed-rotation with shell-transitions Bug: 217560545 Test: enter pip from landscape app NOT via gesture. Change-Id: I7986fbf6fbe542f0b9d43a157e0fcd811c3641a0 --- .../src/com/android/wm/shell/pip/PipAnimationController.java | 2 +- .../Shell/src/com/android/wm/shell/transition/Transitions.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 e61617281286c..77fd228af286f 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 @@ -620,7 +620,7 @@ public class PipAnimationController { setCurrentValue(bounds); final Rect insets = computeInsets(fraction); final float degree, x, y; - if (Transitions.ENABLE_SHELL_TRANSITIONS) { + if (Transitions.SHELL_TRANSITIONS_ROTATION) { if (rotationDelta == ROTATION_90) { degree = 90 * (1 - fraction); x = fraction * (end.left - start.left) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java index 86b73fc30ca85..efb52a5b4644c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java @@ -74,6 +74,8 @@ public class Transitions implements RemoteCallable { /** Set to {@code true} to enable shell transitions. */ public static final boolean ENABLE_SHELL_TRANSITIONS = SystemProperties.getBoolean("persist.debug.shell_transit", false); + public static final boolean SHELL_TRANSITIONS_ROTATION = ENABLE_SHELL_TRANSITIONS + && SystemProperties.getBoolean("persist.debug.shell_transit_rotate", false); /** Transition type for exiting PIP via the Shell, via pressing the expand button. */ public static final int TRANSIT_EXIT_PIP = TRANSIT_FIRST_CUSTOM + 1;