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: I052d46c16ff24d48991315dcc9563152b6507916
This commit is contained in:
@@ -83,9 +83,13 @@ public class KeyguardBouncer {
|
|||||||
private final Runnable mRemoveViewRunnable = this::removeView;
|
private final Runnable mRemoveViewRunnable = this::removeView;
|
||||||
private final KeyguardBypassController mKeyguardBypassController;
|
private final KeyguardBypassController mKeyguardBypassController;
|
||||||
private KeyguardHostViewController mKeyguardViewController;
|
private KeyguardHostViewController mKeyguardViewController;
|
||||||
|
private final List<KeyguardResetCallback> mResetCallbacks = new ArrayList<>();
|
||||||
private final Runnable mResetRunnable = ()-> {
|
private final Runnable mResetRunnable = ()-> {
|
||||||
if (mKeyguardViewController != null) {
|
if (mKeyguardViewController != null) {
|
||||||
mKeyguardViewController.resetSecurityContainer();
|
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 {
|
public interface BouncerExpansionCallback {
|
||||||
void onFullyShown();
|
void onFullyShown();
|
||||||
void onStartingToHide();
|
void onStartingToHide();
|
||||||
@@ -593,6 +605,10 @@ public class KeyguardBouncer {
|
|||||||
default void onVisibilityChanged(boolean isVisible) {}
|
default void onVisibilityChanged(boolean isVisible) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface KeyguardResetCallback {
|
||||||
|
void onKeyguardReset();
|
||||||
|
}
|
||||||
|
|
||||||
/** Create a {@link KeyguardBouncer} once a container and bouncer callback are available. */
|
/** Create a {@link KeyguardBouncer} once a container and bouncer callback are available. */
|
||||||
public static class Factory {
|
public static class Factory {
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user