From 97ae17dd8a3526f4fb1ddaff88c993dae8a15581 Mon Sep 17 00:00:00 2001 From: Beth Thibodeau Date: Wed, 16 Jun 2021 12:30:12 -0400 Subject: [PATCH] Collapse shade for buttons that launch activities Emergency button and bugreport buttons both launch activities when pressed. With the new QS button for power menu and opaque shade the user might not see the activity, so collapse the shade to ensure it will be visible Fixes: 190462548 Test: manual Change-Id: I8efb552ba659fcd2b108b8c0cd5bb825e324dc86 --- .../systemui/globalactions/GlobalActionsDialogLite.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java index ad920cbc0192d..f2da15a051846 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -844,6 +844,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mMetricsLogger.action(MetricsEvent.ACTION_EMERGENCY_DIALER_FROM_POWER_MENU); mUiEventLogger.log(GlobalActionsEvent.GA_EMERGENCY_DIALER_PRESS); if (mTelecomManager != null) { + // Close shade so user sees the activity + mStatusBar.collapseShade(); Intent intent = mTelecomManager.createLaunchEmergencyDialerIntent( null /* number */); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK @@ -974,6 +976,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene Log.w(TAG, "Bugreport handler could not be launched"); mIActivityManager.requestInteractiveBugReport(); } + // Close shade so user sees the activity + mStatusBar.collapseShade(); } catch (RemoteException e) { } } @@ -992,6 +996,8 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mMetricsLogger.action(MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_FULL); mUiEventLogger.log(GlobalActionsEvent.GA_BUGREPORT_LONG_PRESS); mIActivityManager.requestFullBugReport(); + // Close shade so user sees the activity + mStatusBar.collapseShade(); } catch (RemoteException e) { } return false;