Call into the notification manager when the panel is revealed.
This lets it turn off the LED. However, it seems like somebody broke the notification LEDs. GRRR. Change-Id: I3f7066c2b2e1673dc0144a34cf59946351a647be
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user