Merge "Fix issue when starting FLAG_DISMISS_KEYGUARD while occluded"
This commit is contained in:
@@ -3572,10 +3572,18 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
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 */,
|
||||
@@ -3664,8 +3672,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
|
||||
private void dismissKeyguardThenExecute(OnDismissAction action, Runnable cancelAction,
|
||||
boolean afterKeyguardGone) {
|
||||
afterKeyguardGone |= mStatusBarKeyguardViewManager.isShowing()
|
||||
&& mStatusBarKeyguardViewManager.isOccluded();
|
||||
if (mStatusBarKeyguardViewManager.isShowing()) {
|
||||
mStatusBarKeyguardViewManager.dismissWithAction(action, cancelAction,
|
||||
afterKeyguardGone);
|
||||
|
||||
@@ -40,6 +40,8 @@ import com.android.systemui.statusbar.RemoteInputController;
|
||||
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,
|
||||
@@ -90,6 +92,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
protected boolean mLastRemoteInputActive;
|
||||
|
||||
private OnDismissAction mAfterKeyguardGoneAction;
|
||||
private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>();
|
||||
private boolean mDeviceWillWakeUp;
|
||||
private boolean mDeferScrimFadeOut;
|
||||
|
||||
@@ -164,6 +167,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
updateStates();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@@ -418,6 +428,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mAfterKeyguardGoneAction.onDismiss();
|
||||
mAfterKeyguardGoneAction = null;
|
||||
}
|
||||
for (int i = 0; i < mAfterKeyguardGoneRunnables.size(); i++) {
|
||||
mAfterKeyguardGoneRunnables.get(i).run();
|
||||
}
|
||||
mAfterKeyguardGoneRunnables.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user