Add callbacks for bouncer keyguard reset
Test: manual, mp, atest Bug: 189468877 Change-Id: I0add1c570461a4ed99f48803800e86edcdfe5e99
This commit is contained in:
@@ -83,9 +83,13 @@ public class KeyguardBouncer {
|
||||
private final Runnable mRemoveViewRunnable = this::removeView;
|
||||
private final KeyguardBypassController mKeyguardBypassController;
|
||||
private KeyguardHostViewController mKeyguardViewController;
|
||||
private final List<KeyguardResetCallback> mResetCallbacks = new ArrayList<>();
|
||||
private final Runnable mResetRunnable = ()-> {
|
||||
if (mKeyguardViewController != null) {
|
||||
mKeyguardViewController.resetSecurityContainer();
|
||||
for (KeyguardResetCallback callback : mResetCallbacks) {
|
||||
callback.onKeyguardReset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -573,6 +577,14 @@ public class KeyguardBouncer {
|
||||
}
|
||||
}
|
||||
|
||||
public void addKeyguardResetCallback(KeyguardResetCallback callback) {
|
||||
mResetCallbacks.add(callback);
|
||||
}
|
||||
|
||||
public void removeKeyguardResetCallback(KeyguardResetCallback callback) {
|
||||
mResetCallbacks.remove(callback);
|
||||
}
|
||||
|
||||
public interface BouncerExpansionCallback {
|
||||
void onFullyShown();
|
||||
void onStartingToHide();
|
||||
@@ -593,6 +605,10 @@ public class KeyguardBouncer {
|
||||
default void onVisibilityChanged(boolean isVisible) {}
|
||||
}
|
||||
|
||||
public interface KeyguardResetCallback {
|
||||
void onKeyguardReset();
|
||||
}
|
||||
|
||||
/** Create a {@link KeyguardBouncer} once a container and bouncer callback are available. */
|
||||
public static class Factory {
|
||||
private final Context mContext;
|
||||
|
||||
Reference in New Issue
Block a user