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
This commit is contained in:
Winson Chung
2021-05-20 20:12:40 -07:00
parent 6074ebc1d1
commit 608b5a2691
2 changed files with 7 additions and 10 deletions

View File

@@ -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);
}
}

View File

@@ -5407,17 +5407,17 @@ class Task extends WindowContainer<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