diff options
| author | 2020-04-24 10:30:57 -0400 | |
|---|---|---|
| committer | 2020-04-24 10:30:57 -0400 | |
| commit | 6ce0a909fdad25d77a1da452a55c2a04c012b2f6 (patch) | |
| tree | 70f024616c243c9e71d6809f7249f28513571231 | |
| parent | ac9a71645a24596829cdc9edc26dc46782ce1077 (diff) | |
Global Actions - Close and long press while open
Handle the show request as a show/hide request depending on the
state. Use callbacks to alert the system that the dialog has been
properly handled before closing.
Bug: 153797802
Test: manual
Change-Id: I3911b35e485cca88c382bc26f2f5312d3323d273
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java | 15 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index eb80a2bc73bb..6aa4f8684928 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -415,16 +415,19 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, * * @param keyguardShowing True if keyguard is showing */ - public void showDialog(boolean keyguardShowing, boolean isDeviceProvisioned, + public void showOrHideDialog(boolean keyguardShowing, boolean isDeviceProvisioned, GlobalActionsPanelPlugin panelPlugin) { mKeyguardShowing = keyguardShowing; mDeviceProvisioned = isDeviceProvisioned; mPanelPlugin = panelPlugin; - if (mDialog != null) { + if (mDialog != null && mDialog.isShowing()) { + // In order to force global actions to hide on the same affordance press, we must + // register a call to onGlobalActionsShown() first to prevent the default actions + // menu from showing. This will be followed by a subsequent call to + // onGlobalActionsHidden() on dismiss() + mWindowManagerFuncs.onGlobalActionsShown(); mDialog.dismiss(); mDialog = null; - // Show delayed, so that the dismiss of the previous dialog completes - mHandler.sendEmptyMessage(MESSAGE_SHOW); } else { handleShow(); } @@ -1805,7 +1808,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private static final int MESSAGE_DISMISS = 0; private static final int MESSAGE_REFRESH = 1; - private static final int MESSAGE_SHOW = 2; private static final int DIALOG_DISMISS_DELAY = 300; // ms private static final int DIALOG_PRESS_DELAY = 850; // ms @@ -1830,9 +1832,6 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, refreshSilentMode(); mAdapter.notifyDataSetChanged(); break; - case MESSAGE_SHOW: - handleShow(); - break; } } }; diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java index 15cf1a060f4c..09757a4d6204 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java @@ -88,7 +88,7 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks public void showGlobalActions(GlobalActionsManager manager) { if (mDisabled) return; mGlobalActionsDialog = mGlobalActionsDialogLazy.get(); - mGlobalActionsDialog.showDialog(mKeyguardStateController.isShowing(), + mGlobalActionsDialog.showOrHideDialog(mKeyguardStateController.isShowing(), mDeviceProvisionedController.isDeviceProvisioned(), mPanelExtension.get()); Dependency.get(KeyguardUpdateMonitor.class).requestFaceAuth(); |