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

Commit dc4844d9 authored by Steve Elliott's avatar Steve Elliott Committed by Automerger Merge Worker
Browse files

Merge "Add unregisterCallback method to NotificationShadeWindowController"...

Merge "Add unregisterCallback method to NotificationShadeWindowController" into sc-dev am: 7161f1d4 am: 26979883

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14727853

Change-Id: I70bd9ab05f892462ec0cd52ef0d9588d8c6966ff
parents ea6cd4f7 26979883
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -36,6 +36,12 @@ public interface NotificationShadeWindowController extends RemoteInputController
     */
    default void registerCallback(StatusBarWindowCallback callback) {}

    /**
     * Unregisters a {@link StatusBarWindowCallback previous registered with
     * {@link #registerCallback(StatusBarWindowCallback)}}
     */
    default void unregisterCallback(StatusBarWindowCallback callback) {}

    /** Notifies the registered {@link StatusBarWindowCallback} instances. */
    default void notifyStateChangedCallbacks() {}

+10 −0
Original line number Diff line number Diff line
@@ -152,6 +152,16 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        mCallbacks.add(new WeakReference<StatusBarWindowCallback>(callback));
    }

    @Override
    public void unregisterCallback(StatusBarWindowCallback callback) {
        for (int i = 0; i < mCallbacks.size(); i++) {
            if (mCallbacks.get(i).get() == callback) {
                mCallbacks.remove(i);
                return;
            }
        }
    }

    /**
     * Register a listener to monitor scrims visibility
     * @param listener A listener to monitor scrims visibility