summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorge Gil <jorgegil@google.com> 2024-11-12 23:12:29 +0000
committer Jorge Gil <jorgegil@google.com> 2024-11-12 23:12:29 +0000
commit8273c50a2c2eef634cc66a2a0190a2ec060061f3 (patch)
treebf7080bf82696ba95f26cf2885ada02e3648be92
parentf9f9096203dbe4a3da6afbf27074e9a4a8e9b987 (diff)
Fix TaskInfo#requestedVisibleTypes update conditions
1) Force a task info changed dispatch whenever the window's requested visible types change, otherwise WMShell window decorations might show the wrong UI if it's out of sync with the true window state. 2) Obtain the requested types from top app window *excluding* the starting window Flag: com.android.window.flags.enable_fully_immersive_in_desktop Fix: 375509830 Test: open Candy Crush in desktop, immersive icon is shown on launch without having to move the window first to trigger an update Change-Id: I23eca5da60fcb5f9b167c64be7b8aaa94139a3ba
-rw-r--r--services/core/java/com/android/server/wm/Session.java4
-rw-r--r--services/core/java/com/android/server/wm/Task.java3
2 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java
index 1bb4c41e79e0..0f66b93ca273 100644
--- a/services/core/java/com/android/server/wm/Session.java
+++ b/services/core/java/com/android/server/wm/Session.java
@@ -706,6 +706,10 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
win.setRequestedVisibleTypes(requestedVisibleTypes);
win.getDisplayContent().getInsetsPolicy().onRequestedVisibleTypesChanged(win,
imeStatsToken);
+ final Task task = win.getTask();
+ if (task != null) {
+ task.dispatchTaskInfoChangedIfNeeded(/* forced= */ true);
+ }
} else {
EmbeddedWindowController.EmbeddedWindow embeddedWindow = null;
if (android.view.inputmethod.Flags.refactorInsetsController()) {
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 352dc528f815..dbc3b76c22a1 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -3436,7 +3436,8 @@ class Task extends TaskFragment {
info.isSleeping = shouldSleepActivities();
info.isTopActivityTransparent = top != null && !top.fillsParent();
info.lastNonFullscreenBounds = topTask.mLastNonFullscreenBounds;
- final WindowState windowState = top != null ? top.findMainWindow() : null;
+ final WindowState windowState = top != null
+ ? top.findMainWindow(/* includeStartingApp= */ false) : null;
info.requestedVisibleTypes = (windowState != null && Flags.enableFullyImmersiveInDesktop())
? windowState.getRequestedVisibleTypes() : WindowInsets.Type.defaultVisible();
AppCompatUtils.fillAppCompatTaskInfo(this, info, top);