From 608b5a26919b46b99480bb247486d8af12d27b05 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 20 May 2021 20:12:40 -0700 Subject: [PATCH] Fix issue with updating canAffectSystemUiFlags when swiping up with PIP - The previous change reverted to resetting the flag when cleaning up the task, so we can remove the other path to reset the flag - The original intent was to reset the flag when entering PIP, so it should be in the likelyResolvedMode == WINDOWING_MODE_PINNED block and not the currentMode == WINDOWING_MODE_PINNED block Bug: 184703546 Test: Verify when entering PIP that we set canAffectSysUiFlags=false on transferring the leash, and then back to true when it enters PIP Change-Id: I4c3ef81b6cecde14117a4d75ae1423456ff65f6a --- .../server/wm/RecentsAnimationController.java | 3 --- services/core/java/com/android/server/wm/Task.java | 14 +++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index 737e7d10c3b44..2feb8a7439304 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -1163,9 +1163,6 @@ public class RecentsAnimationController implements DeathRecipient { // Apply the task's pending transaction in case it is detached and its transaction // is not reachable. mTask.getPendingTransaction().apply(); - - // Reset whether this task can affect the sysui flags - mTask.setCanAffectSystemUiFlags(true); } } diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 93fc4f2a31494..039422d2c6a4e 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -5407,17 +5407,17 @@ class Task extends WindowContainer { : WINDOWING_MODE_FULLSCREEN; } if (currentMode == WINDOWING_MODE_PINNED) { + mRootWindowContainer.notifyActivityPipModeChanged(null); + } + if (likelyResolvedMode == WINDOWING_MODE_PINNED) { // In the case that we've disabled affecting the SysUI flags as a part of seamlessly // transferring the transform on the leash to the task, reset this state once we've // actually entered pip setCanAffectSystemUiFlags(true); - mRootWindowContainer.notifyActivityPipModeChanged(null); - } - if (likelyResolvedMode == WINDOWING_MODE_PINNED - && taskDisplayArea.getRootPinnedTask() != null) { - - // Can only have 1 pip at a time, so replace an existing pip - taskDisplayArea.getRootPinnedTask().dismissPip(); + if (taskDisplayArea.getRootPinnedTask() != null) { + // Can only have 1 pip at a time, so replace an existing pip + taskDisplayArea.getRootPinnedTask().dismissPip(); + } } if (likelyResolvedMode != WINDOWING_MODE_FULLSCREEN && topActivity != null && !topActivity.noDisplay