am dd73ee4d: Add a config resource to enable translucent bars globally.

* commit 'dd73ee4d0a33aa9a423b80471aec6d1ec81a6c82':
  Add a config resource to enable translucent bars globally.
This commit is contained in:
Daniel Sandler
2013-10-14 17:18:15 -07:00
committed by Android Git Automerger
3 changed files with 17 additions and 7 deletions

View File

@ -588,6 +588,9 @@
<!-- Disable lockscreen translucent decor by default --> <!-- Disable lockscreen translucent decor by default -->
<bool name="config_enableLockScreenTranslucentDecor">false</bool> <bool name="config_enableLockScreenTranslucentDecor">false</bool>
<!-- Enable translucent decor by default -->
<bool name="config_enableTranslucentDecor">true</bool>
<!-- Enable puk unlockscreen by default. <!-- Enable puk unlockscreen by default.
If unlock screen is disabled, the puk should be unlocked through Emergency Dialer --> If unlock screen is disabled, the puk should be unlocked through Emergency Dialer -->
<bool name="config_enable_puk_unlock_screen">true</bool> <bool name="config_enable_puk_unlock_screen">true</bool>

View File

@ -1295,6 +1295,7 @@
<java-symbol type="bool" name="config_enableLockBeforeUnlockScreen" /> <java-symbol type="bool" name="config_enableLockBeforeUnlockScreen" />
<java-symbol type="bool" name="config_enableLockScreenRotation" /> <java-symbol type="bool" name="config_enableLockScreenRotation" />
<java-symbol type="bool" name="config_enableLockScreenTranslucentDecor" /> <java-symbol type="bool" name="config_enableLockScreenTranslucentDecor" />
<java-symbol type="bool" name="config_enableTranslucentDecor" />
<java-symbol type="bool" name="config_lidControlsSleep" /> <java-symbol type="bool" name="config_lidControlsSleep" />
<java-symbol type="bool" name="config_reverseDefaultRotation" /> <java-symbol type="bool" name="config_reverseDefaultRotation" />
<java-symbol type="bool" name="config_showNavigationBar" /> <java-symbol type="bool" name="config_showNavigationBar" />

View File

@ -297,6 +297,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int mCurrentAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
boolean mHasSoftInput = false; boolean mHasSoftInput = false;
boolean mTouchExplorationEnabled = false; boolean mTouchExplorationEnabled = false;
boolean mTranslucentDecorEnabled = true;
int mPointerLocationMode = 0; // guarded by mLock int mPointerLocationMode = 0; // guarded by mLock
@ -901,6 +902,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.integer.config_lidNavigationAccessibility); com.android.internal.R.integer.config_lidNavigationAccessibility);
mLidControlsSleep = mContext.getResources().getBoolean( mLidControlsSleep = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_lidControlsSleep); com.android.internal.R.bool.config_lidControlsSleep);
mTranslucentDecorEnabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enableTranslucentDecor);
readConfigurationDependentBehaviors(); readConfigurationDependentBehaviors();
// register for dock events // register for dock events
@ -2703,7 +2706,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean immersiveSticky = (sysui & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0; boolean immersiveSticky = (sysui & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) != 0;
boolean navAllowedHidden = immersive || immersiveSticky; boolean navAllowedHidden = immersive || immersiveSticky;
navTranslucent &= !immersiveSticky; // transient trumps translucent navTranslucent &= !immersiveSticky; // transient trumps translucent
navTranslucent &= isTranslucentNavigationAllowed(); navTranslucent &= areTranslucentBarsAllowed();
// When the navigation bar isn't visible, we put up a fake // When the navigation bar isn't visible, we put up a fake
// input window to catch all touch events. This way we can // input window to catch all touch events. This way we can
@ -2824,6 +2827,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean statusBarTransient = (sysui & View.STATUS_BAR_TRANSIENT) != 0; boolean statusBarTransient = (sysui & View.STATUS_BAR_TRANSIENT) != 0;
boolean statusBarTranslucent = (sysui & View.STATUS_BAR_TRANSLUCENT) != 0; boolean statusBarTranslucent = (sysui & View.STATUS_BAR_TRANSLUCENT) != 0;
statusBarTranslucent &= areTranslucentBarsAllowed();
// If the status bar is hidden, we don't want to cause // If the status bar is hidden, we don't want to cause
// windows behind it to scroll. // windows behind it to scroll.
@ -5116,8 +5120,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
vis = (vis & ~flags) | (oldVis & flags); vis = (vis & ~flags) | (oldVis & flags);
} }
if (!isTranslucentNavigationAllowed()) { if (!areTranslucentBarsAllowed()) {
vis &= ~View.NAVIGATION_BAR_TRANSLUCENT; vis &= ~(View.NAVIGATION_BAR_TRANSLUCENT | View.STATUS_BAR_TRANSLUCENT);
} }
// update status bar // update status bar
@ -5182,11 +5186,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} }
/** /**
* @return whether the navigation bar can be made translucent, e.g. touch * @return whether the navigation or status bar can be made translucent
* exploration is not enabled *
* This should return true unless touch exploration is not enabled or
* R.boolean.config_enableTranslucentDecor is false.
*/ */
private boolean isTranslucentNavigationAllowed() { private boolean areTranslucentBarsAllowed() {
return !mTouchExplorationEnabled; return mTranslucentDecorEnabled && !mTouchExplorationEnabled;
} }
// Use this instead of checking config_showNavigationBar so that it can be consistently // Use this instead of checking config_showNavigationBar so that it can be consistently