diff options
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 7 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PolicyControl.java | 23 |
2 files changed, 16 insertions, 14 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index c0f8414..ada649d 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2569,7 +2569,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset) { final int fl = PolicyControl.getWindowFlags(null, attrs); - final int systemUiVisibility = (attrs.systemUiVisibility|attrs.subtreeSystemUiVisibility); + final int sysuiVis = PolicyControl.getSystemUiVisibility(null, attrs); + final int systemUiVisibility = (sysuiVis | attrs.subtreeSystemUiVisibility); if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) == (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) { @@ -2953,7 +2954,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { final int fl = PolicyControl.getWindowFlags(win, attrs); final int sim = attrs.softInputMode; - final int sysUiFl = PolicyControl.getSystemUiVisibility(win); + final int sysUiFl = PolicyControl.getSystemUiVisibility(win, null); final Rect pf = mTmpParentFrame; final Rect df = mTmpDisplayFrame; @@ -5078,7 +5079,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { return 0; } - int tmpVisibility = PolicyControl.getSystemUiVisibility(win) + int tmpVisibility = PolicyControl.getSystemUiVisibility(win, null) & ~mResettingSystemUiFlags & ~mForceClearedSystemUiFlags; if (mForcingShowNavBar && win.getSurfaceLayer() < mForcingShowNavBarLayer) { diff --git a/policy/src/com/android/internal/policy/impl/PolicyControl.java b/policy/src/com/android/internal/policy/impl/PolicyControl.java index 4f355dd..ffdb520 100644 --- a/policy/src/com/android/internal/policy/impl/PolicyControl.java +++ b/policy/src/com/android/internal/policy/impl/PolicyControl.java @@ -61,16 +61,17 @@ public class PolicyControl { private static Filter sImmersiveStatusFilter; private static Filter sImmersiveNavigationFilter; - public static int getSystemUiVisibility(WindowState win) { - int vis = win.getSystemUiVisibility(); - if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(win)) { + public static int getSystemUiVisibility(WindowState win, LayoutParams attrs) { + attrs = attrs != null ? attrs : win.getAttrs(); + int vis = win != null ? win.getSystemUiVisibility() : attrs.systemUiVisibility; + if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) { vis |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; vis &= ~(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.STATUS_BAR_TRANSLUCENT); } - if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(win)) { + 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; @@ -81,20 +82,22 @@ public class PolicyControl { } public static int getWindowFlags(WindowState win, LayoutParams attrs) { - int flags = (attrs != null ? attrs : win.getAttrs()).flags; - if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(win)) { + attrs = attrs != null ? attrs : win.getAttrs(); + int flags = attrs.flags; + if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) { flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; flags &= ~(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } - if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(win)) { + if (sImmersiveNavigationFilter != null && sImmersiveNavigationFilter.matches(attrs)) { flags &= ~WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; } return flags; } public static int adjustClearableFlags(WindowState win, int clearableFlags) { - if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(win)) { + final LayoutParams attrs = win != null ? win.getAttrs() : null; + if (sImmersiveStatusFilter != null && sImmersiveStatusFilter.matches(attrs)) { clearableFlags &= ~View.SYSTEM_UI_FLAG_FULLSCREEN; } return clearableFlags; @@ -187,9 +190,7 @@ public class PolicyControl { mBlacklist = blacklist; } - boolean matches(WindowState win) { - if (win == null) return false; - LayoutParams attrs = win.getAttrs(); + boolean matches(LayoutParams attrs) { if (attrs == null) return false; boolean isApp = attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW; |