OSDN Git Service

Enable "Reboot to safe mode" confirmation on GlobalActions
authorShunta Sato <shunta.sato@sonymobile.com>
Fri, 14 Apr 2017 07:01:54 +0000 (16:01 +0900)
committerJason Monk <jmonk@google.com>
Wed, 28 Jun 2017 15:32:58 +0000 (11:32 -0400)
Android N or prior GlobalActions showed "Reboot to safe mode",
when user do long-press of "power off" button on GlobalActions.

Currently, no confirmation dialog is shown. It's not user friendly.
This commit make it enable again.

 - Also dismiss global actions on long press.

Test: manual
Bug: 37333890
Change-Id: I3bfefff3cd34ba35b003281e94a4181cebb74fcf

packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
services/core/java/com/android/server/statusbar/StatusBarManagerService.java

index 80a6418..1a8a474 100644 (file)
@@ -339,6 +339,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn
                     long id) {
                 final Action action = mAdapter.getItem(position);
                 if (action instanceof LongPressAction) {
+                    mDialog.dismiss();
                     return ((LongPressAction) action).onLongPress();
                 }
                 return false;
index 32871bb..984b40f 100644 (file)
@@ -783,7 +783,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub {
             mHandler.post(() -> {
                 // ShutdownThread displays UI, so give it a UI context.
                 if (safeMode) {
-                    ShutdownThread.rebootSafeMode(getUiContext(), false);
+                    ShutdownThread.rebootSafeMode(getUiContext(), true);
                 } else {
                     ShutdownThread.reboot(getUiContext(),
                             PowerManager.SHUTDOWN_USER_REQUESTED, false);