Add unregisterCallback method to NotificationShadeWindowController
Test: manual, atest Bug: 189276056 Change-Id: Ia09c4c2baa0b59504c74edf4b865ee2c06440e85
This commit is contained in:
@@ -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() {}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user