Skip to content

Commit 5c31a5c

Browse files
author
Heemin Seog
committed
DO NOT MERGE Only set the LAYOUT flags if the window is fullscreen
This addresses an issue where toasts will be hidden due to the setting of the LAYOUT_HIDE_NAVIGATION flag. Bug: 148180738 Test: manual (adb shell settings put global policy_control "immersive.navigation=*" then try to show a toast with gravity top) Change-Id: Ic47edc5423c4daf373fc3a8bfc30af15cadd6d90
1 parent 75cf9d7 commit 5c31a5c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

services/core/java/com/android/server/wm/PolicyControl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,19 @@ static int getSystemUiVisibility(WindowState win, LayoutParams attrs) {
6767
: (attrs.systemUiVisibility | attrs.subtreeSystemUiVisibility);
6868
if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) {
6969
vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
70-
| View.SYSTEM_UI_FLAG_FULLSCREEN
71-
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
70+
| View.SYSTEM_UI_FLAG_FULLSCREEN;
71+
if (attrs.isFullscreen()) {
72+
vis |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
73+
}
7274
vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
7375
| View.STATUS_BAR_TRANSLUCENT);
7476
}
7577
if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(attrs)) {
7678
vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
77-
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
7879
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
80+
if (attrs.isFullscreen()) {
81+
vis |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
82+
}
7983
vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
8084
| View.NAVIGATION_BAR_TRANSLUCENT);
8185
}

0 commit comments

Comments
 (0)