final boolean dismissShade,
final boolean afterKeyguardGone,
final boolean deferred) {
- dismissKeyguardThenExecute(() -> {
+ final Runnable dismissAction = () -> {
if (runnable != null) {
AsyncTask.execute(runnable);
}
+ };
+ dismissKeyguardThenExecute(() -> {
+ if (mStatusBarKeyguardViewManager.isShowing()
+ && mStatusBarKeyguardViewManager.isOccluded()) {
+ mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);
+ } else {
+ dismissAction.run();
+ }
if (dismissShade) {
if (mExpandedVisible) {
animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */,
private void dismissKeyguardThenExecute(OnDismissAction action, Runnable cancelAction,
boolean afterKeyguardGone) {
- afterKeyguardGone |= mStatusBarKeyguardViewManager.isShowing()
- && mStatusBarKeyguardViewManager.isOccluded();
if (mStatusBarKeyguardViewManager.isShowing()) {
mStatusBarKeyguardViewManager.dismissWithAction(action, cancelAction,
afterKeyguardGone);
import static com.android.keyguard.KeyguardHostView.OnDismissAction;
import static com.android.systemui.statusbar.phone.FingerprintUnlockController.*;
+import java.util.ArrayList;
+
/**
* Manages creating, showing, hiding and resetting the keyguard within the status bar. Calls back
* via {@link ViewMediatorCallback} to poke the wake lock and report that the keyguard is done,
protected boolean mLastRemoteInputActive;
private OnDismissAction mAfterKeyguardGoneAction;
+ private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>();
private boolean mDeviceWillWakeUp;
private boolean mDeferScrimFadeOut;
}
/**
+ * Adds a {@param runnable} to be executed after Keyguard is gone.
+ */
+ public void addAfterKeyguardGoneRunnable(Runnable runnable) {
+ mAfterKeyguardGoneRunnables.add(runnable);
+ }
+
+ /**
* Reset the state of the view.
*/
public void reset(boolean hideBouncerWhenShowing) {
mAfterKeyguardGoneAction.onDismiss();
mAfterKeyguardGoneAction = null;
}
+ for (int i = 0; i < mAfterKeyguardGoneRunnables.size(); i++) {
+ mAfterKeyguardGoneRunnables.get(i).run();
+ }
+ mAfterKeyguardGoneRunnables.clear();
}
/**