Merge "Add callbacks for bouncer keyguard reset" into sc-dev am: 33f8e11606

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

Change-Id: I36d97bebc12b4d3ecafc83f6117b6f6967d61682
This commit is contained in:
Steve Elliott
2021-06-09 19:00:24 +00:00
committed by Automerger Merge Worker

View File

@@ -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;