diff options
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt | 17 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java | 8 |
2 files changed, 16 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt index c073642afa4e..22d6b6bb75c3 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt @@ -128,15 +128,22 @@ class ControlActionCoordinatorImpl @Inject constructor( } private fun bouncerOrRun(action: Action) { - if (!keyguardStateController.isUnlocked()) { - context.sendBroadcast(Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) + if (keyguardStateController.isShowing()) { + var closeGlobalActions = !keyguardStateController.isUnlocked() + if (closeGlobalActions) { + context.sendBroadcast(Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) - // pending actions will only run after the control state has been refreshed - pendingAction = action + // pending actions will only run after the control state has been refreshed + pendingAction = action + } activityStarter.dismissKeyguardThenExecute({ Log.d(ControlsUiController.TAG, "Device unlocked, invoking controls action") - globalActionsComponent.handleShowGlobalActionsMenu() + if (closeGlobalActions) { + globalActionsComponent.handleShowGlobalActionsMenu() + } else { + action.invoke() + } true }, { pendingAction = null }, true /* afterKeyguardGone */) } else { diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index eed52004923d..b2e91643bed2 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -2637,10 +2637,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } private boolean shouldShowControls() { - return (mKeyguardStateController.isUnlocked() || mShowLockScreenCardsAndControls) - && controlsAvailable() - && mLockPatternUtils.getStrongAuthForUser(getCurrentUser().id) - != STRONG_AUTH_REQUIRED_AFTER_BOOT; + boolean showOnLockScreen = mShowLockScreenCardsAndControls && mLockPatternUtils + .getStrongAuthForUser(getCurrentUser().id) != STRONG_AUTH_REQUIRED_AFTER_BOOT; + return controlsAvailable() + && (mKeyguardStateController.isUnlocked() || showOnLockScreen); } private boolean controlsAvailable() { |