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

Commit cad5768e authored by John Spurlock's avatar John Spurlock
Browse files

Doze: Update tease signal to buzz-beep-blink from NoMan.

Inform SystemUI when NoMan buzzes, beeps or blinks.  Use that
as the notification signal when dozing instead of trying to figure
out interesting panel content updates.

At some point, we should move the entire calculation up into SystemUI
itself, but that's too large of a refactoring to perform now.

Bug:15863249
Change-Id: I40e92334977e0676a1363774c2cbbf91d72ec8e5
parent f0f0f7ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ oneway interface IStatusBar
            boolean showImeSwitcher);
    void setHardKeyboardStatus(boolean available, boolean enabled);
    void setWindowState(int window, int state);
    void buzzBeepBlinked();

    void showRecentApps(boolean triggeredFromAltTab);
    void hideRecentApps(boolean triggeredFromAltTab);
+6 −0
Original line number Diff line number Diff line
@@ -292,6 +292,11 @@ public class DozeService extends DreamService {
        @Override
        public void onNewNotifications() {
            if (DEBUG) Log.d(mTag, "onNewNotifications");
            // noop for now
        }
        @Override
        public void onBuzzBeepBlinked() {
            if (DEBUG) Log.d(mTag, "onBuzzBeepBlinked");
            requestTease();
        }
    };
@@ -305,6 +310,7 @@ public class DozeService extends DreamService {

        public interface Callback {
            void onNewNotifications();
            void onBuzzBeepBlinked();
        }
    }
}
+11 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public class CommandQueue extends IStatusBar.Stub {
    private static final int MSG_SET_WINDOW_STATE           = 13 << MSG_SHIFT;
    private static final int MSG_SHOW_RECENT_APPS           = 14 << MSG_SHIFT;
    private static final int MSG_HIDE_RECENT_APPS           = 15 << MSG_SHIFT;
    private static final int MSG_BUZZ_BEEP_BLINKED          = 16 << MSG_SHIFT;

    public static final int FLAG_EXCLUDE_NONE = 0;
    public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -93,6 +94,7 @@ public class CommandQueue extends IStatusBar.Stub {
        public void showSearchPanel();
        public void hideSearchPanel();
        public void setWindowState(int window, int state);
        public void buzzBeepBlinked();
    }

    public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -221,6 +223,12 @@ public class CommandQueue extends IStatusBar.Stub {
        }
    }

    public void buzzBeepBlinked() {
        synchronized (mList) {
            mHandler.removeMessages(MSG_BUZZ_BEEP_BLINKED);
            mHandler.sendEmptyMessage(MSG_BUZZ_BEEP_BLINKED);
        }
    }

    private final class H extends Handler {
        public void handleMessage(Message msg) {
@@ -295,6 +303,9 @@ public class CommandQueue extends IStatusBar.Stub {
                case MSG_SET_WINDOW_STATE:
                    mCallbacks.setWindowState(msg.arg1, msg.arg2);
                    break;
                case MSG_BUZZ_BEEP_BLINKED:
                    mCallbacks.buzzBeepBlinked();
                    break;

            }
        }
+13 −0
Original line number Diff line number Diff line
@@ -2345,6 +2345,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
    }

    @Override // CommandQueue
    public void buzzBeepBlinked() {
        if (mDozeServiceHost != null) {
            mDozeServiceHost.fireBuzzBeepBlinked();
        }
    }

    @Override // CommandQueue
    public void setSystemUiVisibility(int vis, int mask) {
        final int oldVal = mSystemUiVisibility;
@@ -3757,6 +3764,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

        private DozeService mCurrentDozeService;

        public void fireBuzzBeepBlinked() {
            for (Callback callback : mCallbacks) {
                callback.onBuzzBeepBlinked();
            }
        }

        public void fireNewNotifications() {
            for (Callback callback : mCallbacks) {
                callback.onNewNotifications();
+4 −0
Original line number Diff line number Diff line
@@ -95,6 +95,10 @@ public class TvStatusBar extends BaseStatusBar {
    public void setWindowState(int window, int state) {
    }

    @Override // CommandQueue
    public void buzzBeepBlinked() {
    }

    @Override
    protected WindowManager.LayoutParams getSearchLayoutParams(
            LayoutParams layoutParams) {
Loading