summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-09-10 10:30:46 -0400
committerJoe Onorato <joeo@google.com>2010-09-12 13:25:06 -0400
commit9305647eb61bb60a1f42481a0c0d208dc9bbe965 (patch)
treee778597b64e7f72131ffcdcbdc18ac9311b4c525 /packages/SystemUI
parent5af8c63e487841db70314d7d512e6bafddcbb149 (diff)
downloadframeworks_base-9305647eb61bb60a1f42481a0c0d208dc9bbe965.zip
frameworks_base-9305647eb61bb60a1f42481a0c0d208dc9bbe965.tar.gz
frameworks_base-9305647eb61bb60a1f42481a0c0d208dc9bbe965.tar.bz2
Plumb lights out mode through from the window manager to the status bar running in the system ui process.
Lights out mode itself isn't implemented. Change-Id: Ieeef0eb9ae5be23000f770e74e8ee66472f4c673
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java10
4 files changed, 36 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 2c0af65..3ef12f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -52,6 +52,8 @@ public class CommandQueue extends IStatusBar.Stub {
private static final int OP_EXPAND = 1;
private static final int OP_COLLAPSE = 2;
+ private static final int MSG_SET_LIGHTS_ON = 0x00070000;
+
private StatusBarIconList mList;
private Callbacks mCallbacks;
private Handler mHandler = new H();
@@ -75,6 +77,7 @@ public class CommandQueue extends IStatusBar.Stub {
public void disable(int state);
public void animateExpand();
public void animateCollapse();
+ public void setLightsOn(boolean on);
}
public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -143,6 +146,13 @@ public class CommandQueue extends IStatusBar.Stub {
}
}
+ public void setLightsOn(boolean on) {
+ synchronized (mList) {
+ mHandler.removeMessages(MSG_SET_LIGHTS_ON);
+ mHandler.obtainMessage(MSG_SET_LIGHTS_ON, on ? 1 : 0, 0, null).sendToTarget();
+ }
+ }
+
private final class H extends Handler {
public void handleMessage(Message msg) {
final int what = msg.what & MSG_MASK;
@@ -194,6 +204,10 @@ public class CommandQueue extends IStatusBar.Stub {
} else {
mCallbacks.animateCollapse();
}
+ break;
+ case MSG_SET_LIGHTS_ON:
+ mCallbacks.setLightsOn(msg.arg1 != 0);
+ break;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java
index 48243ff..e945981 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java
@@ -1011,6 +1011,15 @@ public class PhoneStatusBarService extends StatusBarService {
return false;
}
+ public void setLightsOn(boolean on) {
+ if (!on) {
+ // All we do for "lights out" mode on a phone is hide the status bar,
+ // which the window manager does. But we do need to hide the windowshade
+ // on our own.
+ animateCollapse();
+ }
+ }
+
private class Launcher implements View.OnClickListener {
private PendingIntent mIntent;
private String mPkg;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
index a64c3e7..695fdba 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
@@ -72,12 +72,16 @@ public abstract class StatusBarService extends Service implements CommandQueue.C
mCommandQueue = new CommandQueue(this, iconList);
mBarService = IStatusBarService.Stub.asInterface(
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
+ boolean[] lightsOn = new boolean[1];
try {
- mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications);
+ mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications,
+ lightsOn);
} catch (RemoteException ex) {
// If the system process isn't there we're doomed anyway.
}
+ setLightsOn(lightsOn[0]);
+
// Set up the initial icon state
int N = iconList.size();
int viewIndex = 0;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
index 6f74924..b33af99 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
@@ -56,8 +56,6 @@ public class TabletStatusBarService extends StatusBarService {
private static final int MAX_IMAGE_LEVEL = 10000;
-
-
int mIconSize;
H mHandler = new H();
@@ -493,6 +491,14 @@ public class TabletStatusBarService extends StatusBarService {
mHandler.sendEmptyMessage(H.MSG_CLOSE_SYSTEM_PANEL);
}
+ public void setLightsOn(boolean on) {
+ //Slog.d(TAG, "setLightsOn on=" + on);
+ if (!on) {
+ animateCollapse();
+ }
+ // TODO: implement lights out mode
+ }
+
public void notificationIconsClicked(View v) {
if (DEBUG) Slog.d(TAG, "clicked notification icons");
mHandler.removeMessages(H.MSG_CLOSE_SYSTEM_PANEL);