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

Commit 4b820e4e authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Use heads-up state instead of buzzBeepBlinked

Bug: 30876804
Test: runtest systemui
Change-Id: Ib6de3aa33c0bbe004b9e4070817860efbe886161
parent ff160eda
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public interface DozeHost {

    interface Callback {
        default void onNewNotifications() {}
        default void onBuzzBeepBlinked() {}
        default void onNotificationHeadsUp() {}
        default void onNotificationLight(boolean on) {}
        default void onPowerSaveChanged(boolean active) {}
    }
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ public class DozeTriggers implements DozeMachine.Part {

    private DozeHost.Callback mHostCallback = new DozeHost.Callback() {
        @Override
        public void onBuzzBeepBlinked() {
        public void onNotificationHeadsUp() {
            onNotification();
        }

+1 −1
Original line number Diff line number Diff line
@@ -2439,7 +2439,7 @@ public abstract class BaseStatusBar extends SystemUI implements
            Log.d(TAG, "failed to query dream manager", e);
        }

        if (!inUse) {
        if (!inUse && !isDozing()) {
            if (DEBUG) {
                Log.d(TAG, "No peeking: not in use: " + sbn.getKey());
            }
+10 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public class VisualStabilityManager implements OnHeadsUpChangedListener {
    private VisibilityLocationProvider mVisibilityLocationProvider;
    private ArraySet<View> mAllowedReorderViews = new ArraySet<>();
    private ArraySet<View> mAddedChildren = new ArraySet<>();
    private boolean mPulsing;

    /**
     * Add a callback to invoke when reordering is allowed again.
@@ -67,8 +68,16 @@ public class VisualStabilityManager implements OnHeadsUpChangedListener {
        updateReorderingAllowed();
    }

    /**
     * @param pulsing whether we are currently pulsing for ambient display.
     */
    public void setPulsing(boolean pulsing) {
        mPulsing = pulsing;
        updateReorderingAllowed();
    }

    private void updateReorderingAllowed() {
        boolean reorderingAllowed = !mScreenOn || !mPanelExpanded;
        boolean reorderingAllowed = (!mScreenOn || !mPanelExpanded) && !mPulsing;
        boolean changed = reorderingAllowed && !mReorderingAllowed;
        mReorderingAllowed = reorderingAllowed;
        if (changed) {
+7 −6
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.Process;
@@ -2660,6 +2659,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            }
        } else {
            updateNotificationRanking(null);
            if (isHeadsUp) {
                mDozeServiceHost.fireNotificationHeadsUp();
            }
        }

    }
@@ -3076,9 +3078,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

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

    @Override
@@ -5240,9 +5239,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            }
        }

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

@@ -5286,12 +5285,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                public void onPulseStarted() {
                    callback.onPulseStarted();
                    mStackScroller.setPulsing(true);
                    mVisualStabilityManager.setPulsing(true);
                }

                @Override
                public void onPulseFinished() {
                    callback.onPulseFinished();
                    mStackScroller.setPulsing(false);
                    mVisualStabilityManager.setPulsing(false);
                }
            }, reason);
        }
Loading