summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-26 00:55:58 -0700
committerDianne Hackborn <hackbod@google.com>2011-05-26 10:46:19 -0700
commit81e56d535c853d73ff537357da5b935f51cb779d (patch)
treeb0d69765bbefecbdeeadebc24b7e57f902af84b9 /packages
parent42f8094c066209a65b09d53611ef5c93daba4c51 (diff)
downloadframeworks_base-81e56d535c853d73ff537357da5b935f51cb779d.zip
frameworks_base-81e56d535c853d73ff537357da5b935f51cb779d.tar.gz
frameworks_base-81e56d535c853d73ff537357da5b935f51cb779d.tar.bz2
Rework how we decide whether to use system or status bar.
The PhoneWindowManager is now responsible for determing this, since it needs to do this before we can generate the configuration since we need to take into account the system bar size we will use. Also the Display should now report the screen height without including the system bar. Change-Id: I82dfcc5e327e4d13d82c373c6c870f557a99b757
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/values-large/config.xml7
-rw-r--r--packages/SystemUI/res/values/config.xml10
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIService.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java4
4 files changed, 21 insertions, 16 deletions
diff --git a/packages/SystemUI/res/values-large/config.xml b/packages/SystemUI/res/values-large/config.xml
index 299ab97..4014f8d 100644
--- a/packages/SystemUI/res/values-large/config.xml
+++ b/packages/SystemUI/res/values-large/config.xml
@@ -20,14 +20,7 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources>
- <integer name="config_status_bar_position">1</integer>
-
- <!-- 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" translatable="false">com.android.systemui.statusbar.tablet.TabletStatusBar</string>
-
<!-- Whether or not we show the number in the bar. -->
<bool name="config_statusBarShowNumber">false</bool>
-
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 05ed089..bb59794 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -25,16 +25,14 @@
data icon on devices -->
<bool name="config_hspa_data_distinguishable">false</bool>
- <!-- The location of the status bar.
- 0 - top
- 1 - bottom
- -->
- <integer name="config_status_bar_position">0</integer>
-
<!-- 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" translatable="false">com.android.systemui.statusbar.phone.PhoneStatusBar</string>
+ <!-- Component to be used as the system bar service. Must implement the IStatusBar
+ interface. This name is in the ComponentName flattened format (package/class) -->
+ <string name="config_systemBarComponent" translatable="false">com.android.systemui.statusbar.tablet.TabletStatusBar</string>
+
<!-- Whether or not we show the number in the bar. -->
<bool name="config_statusBarShowNumber">true</bool>
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIService.java b/packages/SystemUI/src/com/android/systemui/SystemUIService.java
index 870acd3..d7a5056 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIService.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIService.java
@@ -27,7 +27,10 @@ import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Binder;
import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
import android.util.Slog;
+import android.view.IWindowManager;
public class SystemUIService extends Service {
static final String TAG = "SystemUIService";
@@ -36,7 +39,7 @@ public class SystemUIService extends Service {
* The class names of the stuff to start.
*/
final Object[] SERVICES = new Object[] {
- R.string.config_statusBarComponent,
+ 0, // system bar or status bar, filled in below.
com.android.systemui.power.PowerUI.class,
};
@@ -62,6 +65,17 @@ public class SystemUIService extends Service {
@Override
public void onCreate() {
+ // Pick status bar or system bar.
+ IWindowManager wm = IWindowManager.Stub.asInterface(
+ ServiceManager.getService(Context.WINDOW_SERVICE));
+ try {
+ SERVICES[0] = wm.canStatusBarHide()
+ ? R.string.config_statusBarComponent
+ : R.string.config_systemBarComponent;
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Failing checking whether status bar can hide", e);
+ }
+
final int N = SERVICES.length;
mServices = new SystemUI[N];
for (int i=0; i<N; i++) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 6f16914..172aaa1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -330,10 +330,10 @@ public class TabletStatusBar extends StatusBar implements
final Resources res = mContext.getResources();
mNaturalBarHeight = res.getDimensionPixelSize(
- com.android.internal.R.dimen.status_bar_height);
+ com.android.internal.R.dimen.system_bar_height);
int newIconSize = res.getDimensionPixelSize(
- com.android.internal.R.dimen.status_bar_icon_size);
+ com.android.internal.R.dimen.system_bar_icon_size);
int newIconHPadding = res.getDimensionPixelSize(
R.dimen.status_bar_icon_padding);