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
This commit is contained in:
Heemin Seog
2020-01-24 16:26:38 -08:00
parent 75cf9d73ec
commit 5c31a5c18d

View File

@@ -67,15 +67,19 @@ class PolicyControl {
: (attrs.systemUiVisibility | attrs.subtreeSystemUiVisibility);
if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) {
vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
| View.SYSTEM_UI_FLAG_FULLSCREEN;
if (attrs.isFullscreen()) {
vis |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
}
vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.STATUS_BAR_TRANSLUCENT);
}
if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(attrs)) {
vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
if (attrs.isFullscreen()) {
vis |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION;
}
vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.NAVIGATION_BAR_TRANSLUCENT);
}