diff options
author | Daniel Sandler <dsandler@android.com> | 2013-10-15 04:01:53 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-15 04:01:53 -0700 |
commit | 22090928374d798a8ba5b7408dcc916094254634 (patch) | |
tree | 56dc51ce38f8a63066ac10e2251b074bee3f7d71 /policy | |
parent | ed7f4589c8f9b814f317c71f6f49f1bf84ca2adb (diff) | |
parent | c963dfb27a160d50b5ed23fd6d296aec0bd0472b (diff) | |
download | frameworks_base-22090928374d798a8ba5b7408dcc916094254634.zip frameworks_base-22090928374d798a8ba5b7408dcc916094254634.tar.gz frameworks_base-22090928374d798a8ba5b7408dcc916094254634.tar.bz2 |
am c963dfb2: am 596b1f86: am dd73ee4d: Add a config resource to enable translucent bars globally.
* commit 'c963dfb27a160d50b5ed23fd6d296aec0bd0472b':
Add a config resource to enable translucent bars globally.
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index f0356c3..4ac5d1c 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -300,6 +300,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; boolean mHasSoftInput = false; boolean mTouchExplorationEnabled = false; + boolean mTranslucentDecorEnabled = true; int mPointerLocationMode = 0; // guarded by mLock @@ -904,6 +905,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { com.android.internal.R.integer.config_lidNavigationAccessibility); mLidControlsSleep = mContext.getResources().getBoolean( com.android.internal.R.bool.config_lidControlsSleep); + mTranslucentDecorEnabled = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_enableTranslucentDecor); readConfigurationDependentBehaviors(); // register for dock events @@ -2708,7 +2711,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean immersiveSticky = (sysui & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0; boolean navAllowedHidden = immersive || immersiveSticky; navTranslucent &= !immersiveSticky; // transient trumps translucent - navTranslucent &= isTranslucentNavigationAllowed(); + navTranslucent &= areTranslucentBarsAllowed(); // When the navigation bar isn't visible, we put up a fake // input window to catch all touch events. This way we can @@ -2829,6 +2832,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean statusBarTransient = (sysui & View.STATUS_BAR_TRANSIENT) != 0; boolean statusBarTranslucent = (sysui & View.STATUS_BAR_TRANSLUCENT) != 0; + statusBarTranslucent &= areTranslucentBarsAllowed(); // If the status bar is hidden, we don't want to cause // windows behind it to scroll. @@ -5124,8 +5128,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { vis = (vis & ~flags) | (oldVis & flags); } - if (!isTranslucentNavigationAllowed()) { - vis &= ~View.NAVIGATION_BAR_TRANSLUCENT; + if (!areTranslucentBarsAllowed()) { + vis &= ~(View.NAVIGATION_BAR_TRANSLUCENT | View.STATUS_BAR_TRANSLUCENT); } // update status bar @@ -5190,11 +5194,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** - * @return whether the navigation bar can be made translucent, e.g. touch - * exploration is not enabled + * @return whether the navigation or status bar can be made translucent + * + * This should return true unless touch exploration is not enabled or + * R.boolean.config_enableTranslucentDecor is false. */ - private boolean isTranslucentNavigationAllowed() { - return !mTouchExplorationEnabled; + private boolean areTranslucentBarsAllowed() { + return mTranslucentDecorEnabled && !mTouchExplorationEnabled; } // Use this instead of checking config_showNavigationBar so that it can be consistently |