diff options
| author | 2023-03-03 18:03:54 +0800 | |
|---|---|---|
| committer | 2023-03-03 18:03:54 +0800 | |
| commit | d4193b97a2092dbd0ba669fc46e9ddae07efe71e (patch) | |
| tree | 6d1db1e5f40e9a6edce95e1fa3f7228782e2a32d | |
| parent | d460dea0a1341ceb020fe5f8378e91b80eca6181 (diff) | |
Let navigation bar has control if it is focused
Previously, we let the top fullscreen app window stay in immersive mode
when a non-app window gets the focus. However, in some cases, the
navigation bar source window needs to stay visible, and it will make
itself focusable. This CL lets it has control if it is focused.
Fix: 271373861
Test: Swipe to show transient taskbar and long press on the icon.
See if taskbar stays visible.
Change-Id: Ifb0fff483b1787db34d3b00a3728dd6cf6fa7bb5
| -rw-r--r-- | services/core/java/com/android/server/wm/InsetsPolicy.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java index 210a7d9538c7..c1f2b2be3ea7 100644 --- a/services/core/java/com/android/server/wm/InsetsPolicy.java +++ b/services/core/java/com/android/server/wm/InsetsPolicy.java @@ -580,6 +580,13 @@ class InsetsPolicy { // Notification shade has control anyways, no reason to force anything. return focusedWin; } + if (focusedWin != null) { + final InsetsSourceProvider provider = focusedWin.getControllableInsetProvider(); + if (provider != null && provider.getSource().getType() == Type.navigationBars()) { + // Navigation bar has control if it is focused. + return focusedWin; + } + } if (mPolicy.isForceShowNavigationBarEnabled() && focusedWin != null && focusedWin.getActivityType() == ACTIVITY_TYPE_STANDARD) { // When "force show navigation bar" is enabled, it means both force visible is true, and |