diff options
3 files changed, 16 insertions, 26 deletions
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index e3862ffae1a5..045c24fe3b92 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -35,7 +35,7 @@ interface IStatusBarService // You need the STATUS_BAR_SERVICE permission void registerStatusBar(IStatusBar callbacks, out StatusBarIconList iconList, out List<IBinder> notificationKeys, out List<StatusBarNotification> notifications); - void visibilityChanged(boolean visible); + void onPanelRevealed(); void onNotificationClick(String pkg, String tag, int id); void onNotificationError(String pkg, String tag, int id, String message); void onClearAllNotifications(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java index ae974002890d..d93a6c908fe2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/PhoneStatusBarService.java @@ -153,6 +153,7 @@ public class PhoneStatusBarService extends StatusBarService { TrackingView mTrackingView; WindowManager.LayoutParams mTrackingParams; int mTrackingPosition; // the position of the top of the tracking view. + private boolean mPanelSlightlyVisible; // ticker private Ticker mTicker; @@ -1297,8 +1298,15 @@ public class PhoneStatusBarService extends StatusBarService { // because the window itself extends below the content view. mExpandedParams.y = -disph; } - visibilityChanged(visible); mExpandedDialog.getWindow().setAttributes(mExpandedParams); + + // As long as this isn't just a repositioning that's not supposed to affect + // the user's perception of what's showing, call to say that the visibility + // has changed. (Otherwise, someone else will call to do that). + if (expandedPosition != EXPANDED_LEAVE_ALONE) { + Slog.d(TAG, "updateExpandedViewPos visibilityChanged(" + visible + ")"); + visibilityChanged(visible); + } } if (SPEW) { @@ -1328,12 +1336,11 @@ public class PhoneStatusBarService extends StatusBarService { * turned off. If any other notifications happen, the lights will turn back on. Steve says * this is what he wants. (see bug 1131461) */ - private boolean mPanelSlightlyVisible; void visibilityChanged(boolean visible) { if (mPanelSlightlyVisible != visible) { mPanelSlightlyVisible = visible; try { - mBarService.visibilityChanged(visible); + mBarService.onPanelRevealed(); } catch (RemoteException ex) { // Won't fail unless the world has ended. } diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index 72d113aad509..176417a0a711 100644 --- a/services/java/com/android/server/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -277,13 +277,14 @@ public class StatusBarManagerService extends IStatusBarService.Stub } /** - * The status bar service should call this when the user changes whether - * the status bar is visible or not. + * The status bar service should call this each time the user brings the panel from + * invisible to visible in order to clear the notification light. */ - public void visibilityChanged(boolean visible) { + public void onPanelRevealed() { enforceStatusBarService(); - //Slog.d(TAG, "visibilityChanged visible=" + visible); + // tell the notification manager to turn off the lights. + mNotificationCallbacks.onPanelRevealed(); } public void onNotificationClick(String pkg, String tag, int id) { @@ -445,24 +446,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } - /** - * The LEDs are turned o)ff when the notification panel is shown, even just a little bit. - * This was added last-minute and is inconsistent with the way the rest of the notifications - * are handled, because the notification isn't really cancelled. The lights are just - * turned off. If any other notifications happen, the lights will turn back on. Steve says - * this is what he wants. (see bug 1131461) - */ - private boolean mPanelSlightlyVisible; - void panelSlightlyVisible(boolean visible) { - if (mPanelSlightlyVisible != visible) { - mPanelSlightlyVisible = visible; - if (visible) { - // tell the notification manager to turn off the lights. - mNotificationCallbacks.onPanelRevealed(); - } - } - } - private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); |