summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Daniel Sandler <dsandler@google.com> 2010-07-21 11:45:48 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-07-21 11:45:48 -0700
commit2814c571ce79f02170c883ff1a7c61264fe73e5c (patch)
tree740838e5ad69257caf4cfec901612f4202350424
parent679fc4e9850489ce46a378ce3c22bc036dfa6409 (diff)
parent4042744bf8e5630690b479a9447bc6aff8c279fe (diff)
Merge "Disable hiding of the system bar on xlarge devices."
-rw-r--r--core/res/res/values-xlarge/config.xml1
-rw-r--r--core/res/res/values/config.xml1
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java25
3 files changed, 21 insertions, 6 deletions
diff --git a/core/res/res/values-xlarge/config.xml b/core/res/res/values-xlarge/config.xml
index 2640662e627f..c5a53b2418f3 100644
--- a/core/res/res/values-xlarge/config.xml
+++ b/core/res/res/values-xlarge/config.xml
@@ -23,5 +23,6 @@
<!-- Component to be used as the status bar service. Must implement the IStatusBar
interface. This name is in the ComponentName flattened format (package/class) -->
<string name="config_statusBarComponent">com.android.systemui/com.android.systemui.statusbar.tablet.TabletStatusBarService</string>
+ <bool name="config_statusBarCanHide">false</bool>
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index b37d8874b7f5..cf2b42361e4d 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -23,6 +23,7 @@
<!-- Component to be used as the status bar service. Must implement the IStatusBar
interface. This name is in the ComponentName flattened format (package/class) -->
<string name="config_statusBarComponent">com.android.systemui/com.android.systemui.statusbar.PhoneStatusBarService</string>
+ <bool name="config_statusBarCanHide">true</bool>
<!-- Do not translate. Defines the slots for the right-hand side icons. That is to say, the
icons in the status bar that are not notifications. -->
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 767f38da79ce..cb7fe06dcb2f 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -192,6 +192,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean mSafeMode;
WindowState mStatusBar = null;
+ boolean mStatusBarCanHide;
final ArrayList<WindowState> mStatusBarPanels = new ArrayList<WindowState>();
WindowState mKeyguard = null;
KeyguardViewMediator mKeyguardMediator;
@@ -546,6 +547,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.array.config_safeModeDisabledVibePattern);
mSafeModeEnabledVibePattern = getLongIntArray(mContext.getResources(),
com.android.internal.R.array.config_safeModeEnabledVibePattern);
+
+ // Note: the Configuration is not stable here, so we cannot load mStatusBarCanHide from
+ // config_statusBarCanHide because the latter depends on the screen size
}
public void updateSettings() {
@@ -954,6 +958,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
}
mStatusBar = win;
+
+ // The Configuration will be stable by now, so we can load this
+ mStatusBarCanHide = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_statusBarCanHide);
+
break;
case TYPE_STATUS_BAR_PANEL:
mContext.enforceCallingOrSelfPermission(
@@ -1212,7 +1221,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset) {
final int fl = attrs.flags;
- if ((fl &
+ if (mStatusBarCanHide && (fl &
(FLAG_LAYOUT_IN_SCREEN | FLAG_FULLSCREEN | FLAG_LAYOUT_INSET_DECOR))
== (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
contentInset.set(mCurLeft, mCurTop, mW - mCurRight, mH - mCurBottom);
@@ -1340,7 +1349,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
attrs.gravity = Gravity.BOTTOM;
mDockLayer = win.getSurfaceLayer();
} else {
- if ((fl &
+ if (mStatusBarCanHide && (fl &
(FLAG_LAYOUT_IN_SCREEN | FLAG_FULLSCREEN | FLAG_LAYOUT_INSET_DECOR))
== (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
// This is the case for a normal activity window: we want it
@@ -1372,7 +1381,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
vf.right = mCurRight;
vf.bottom = mCurBottom;
}
- } else if ((fl & FLAG_LAYOUT_IN_SCREEN) != 0) {
+ } else if (mStatusBarCanHide && (fl & FLAG_LAYOUT_IN_SCREEN) != 0) {
// A window that has requested to fill the entire screen just
// gets everything, period.
pf.left = df.left = cf.left = 0;
@@ -1516,9 +1525,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean hideStatusBar =
(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
if (hideStatusBar) {
- if (DEBUG_LAYOUT) Log.v(TAG, "Hiding status bar");
- if (mStatusBar.hideLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
- hiding = true;
+ if (mStatusBarCanHide) {
+ if (DEBUG_LAYOUT) Log.v(TAG, "Hiding status bar");
+ if (mStatusBar.hideLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;
+ hiding = true;
+ } else if (localLOGV) {
+ Log.v(TAG, "Preventing status bar from hiding by policy");
+ }
} else {
if (DEBUG_LAYOUT) Log.v(TAG, "Showing status bar");
if (mStatusBar.showLw(true)) changes |= FINISH_LAYOUT_REDO_LAYOUT;