Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1f25916 authored by Joe Onorato's avatar Joe Onorato
Browse files

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
parent 7a0f36bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
+10 −3
Original line number Diff line number Diff line
@@ -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.
            }
+5 −22
Original line number Diff line number Diff line
@@ -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();