首页 > 代码库 > 长按power键弹出关机菜单,点击关机会弹出提示框,点击重启没有提示框确认直接进入重启状态,添加确认提示框

长按power键弹出关机菜单,点击关机会弹出提示框,点击重启没有提示框确认直接进入重启状态,添加确认提示框

--- a/idh.code/frameworks/base/core/res/res/values-es/strings.xml
+++ b/idh.code/frameworks/base/core/res/res/values-es/strings.xml
@@ -1710,5 +1710,5 @@
     <string name="station_state_connected">"Stación %1$s esta conectada"</string>
     <string name="station_state_disconnected">"Stación %1$s esta desconectada"</string>
     <string name="station_state_msg">"%1$s conectada, %2$s bloquada"</string>
-
+    <string name="reboot_confirm" product="default">Usted teléfono voluntad de reiniciar</string>
 </resources>
\ No newline at end of file
diff --git a/idh.code/frameworks/base/core/res/res/values-pt/strings.xml b/idh.code/frameworks/base/core/res/res/values-pt/strings.xml
old mode 100644
new mode 100755
index aab0837..43234b7
--- a/idh.code/frameworks/base/core/res/res/values-pt/strings.xml
+++ b/idh.code/frameworks/base/core/res/res/values-pt/strings.xml
@@ -1736,5 +1736,5 @@
     <string name="station_state_connected">"Estação %1$s é ligada"</string>
     <string name="station_state_disconnected">"Estação %1$s é desligada"</string>
     <string name="station_state_msg">"%1$s ligada, %2$s bloqueada"</string>
-
+               <string name="reboot_confirm" product="default">Você telefone irá reiniciar</string>
 </resources>
\ No newline at end of file
diff --git a/idh.code/frameworks/base/core/res/res/values-zh-rCN/strings.xml b/idh.code/frameworks/base/core/res/res/values-zh-rCN/stri
index 24d8bf9..2f37d7b 100755
--- a/idh.code/frameworks/base/core/res/res/values-zh-rCN/strings.xml
+++ b/idh.code/frameworks/base/core/res/res/values-zh-rCN/strings.xml
@@ -1782,5 +1782,5 @@
     <string name="media_shared_">"目前计算机正在使用 存储设备。"</string>
     <string name="media_unknown_state_">"存储处于未知状态。"</string>
     <!-- @} -->
-
+               <string name="reboot_confirm" product="default">您的手机将会重新启动。</string>
 </resources>
diff --git a/idh.code/frameworks/base/core/res/res/values-zh-rHK/strings.xml b/idh.code/frameworks/base/core/res/res/values-zh-rHK/stri
old mode 100644
new mode 100755
index 268b391..514b21c
--- a/idh.code/frameworks/base/core/res/res/values-zh-rHK/strings.xml
+++ b/idh.code/frameworks/base/core/res/res/values-zh-rHK/strings.xml
@@ -1662,4 +1662,5 @@
   </plurals>
     <string name="restr_pin_try_later" msgid="973144472490532377">"稍後再試"</string>
     <string name="immersive_mode_confirmation" msgid="7227416894979047467">"由頂端往下快速滑動即可離開全螢幕。"</string>
+    <string name="reboot_confirm" product="default">您的手機將會重新啟動。</string>
 </resources>
diff --git a/idh.code/frameworks/base/core/res/res/values-zh-rTW/strings.xml b/idh.code/frameworks/base/core/res/res/values-zh-rTW/stri
old mode 100644
new mode 100755
index 799de85..6d94e52
--- a/idh.code/frameworks/base/core/res/res/values-zh-rTW/strings.xml
+++ b/idh.code/frameworks/base/core/res/res/values-zh-rTW/strings.xml
@@ -1776,5 +1776,5 @@
     <string name="media_shared_">"電腦目前正在使用 儲存裝置。"</string>
     <string name="media_unknown_state_">"儲存裝置狀態不明。"</string>
     <!-- @} -->
-
+               <string name="reboot_confirm" product="default">您的手機將會重新啟動。</string>
 </resources>
diff --git a/idh.code/frameworks/base/core/res/res/values/strings.xml b/idh.code/frameworks/base/core/res/res/values/strings.xml
index 1310e9b..fcb23e1 100755
--- a/idh.code/frameworks/base/core/res/res/values/strings.xml
+++ b/idh.code/frameworks/base/core/res/res/values/strings.xml
@@ -4674,5 +4674,5 @@ ot running any application, the service will also collect such data</string>
     <string name="station_state_disconnected">Station %1$s is disconnected</string>
     <string name="station_state_msg">%1$s connected, %2$s blocked</string>
     <!-- @} -->
-
+               <string name="reboot_confirm" product="default">Your phone will reboot.</string>
 </resources>
diff --git a/idh.code/frameworks/base/core/res/res/values/symbols.xml b/idh.code/frameworks/base/core/res/res/values/symbols.xml
old mode 100644
new mode 100755
index 7cae969..f349b0d
--- a/idh.code/frameworks/base/core/res/res/values/symbols.xml
+++ b/idh.code/frameworks/base/core/res/res/values/symbols.xml
@@ -1833,4 +1833,5 @@
   <!-- SPRD: 293759, modify restart service process -->
   <java-symbol type="integer" name="config_restartServiceInterval" />
   <java-symbol type="integer" name="config_restartAppServiceInterval" />
+  <java-symbol type="string" name="reboot_confirm" />
 </resources>
diff --git a/idh.code/frameworks/base/policy/src/com/android/internal/policy/impl/GlobalActions.java b/idh.code/frameworks/base/policy/
index 1f9e243..a48ca5f 100755
--- a/idh.code/frameworks/base/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/idh.code/frameworks/base/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -300,7 +300,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
                     // shutdown by making sure radio and power are handled accordingly.
                     //mWindowManagerFuncs.shutdown(true);
                     //ShutdownThread.reboot(final Context context, String reason, boolean confirm)
-                    mWindowManagerFuncs.reboot(false);
+                    //mWindowManagerFuncs.reboot(false);
+                    mWindowManagerFuncs.reboot(true);//modify by Yang.Liu on 2014-12-02
                 }
 
                 public boolean onLongPress() {
diff --git a/idh.code/frameworks/base/services/java/com/android/server/power/ShutdownThread.java b/idh.code/frameworks/base/services/ja
old mode 100644
new mode 100755
index fa8a293..455ce79
--- a/idh.code/frameworks/base/services/java/com/android/server/power/ShutdownThread.java
+++ b/idh.code/frameworks/base/services/java/com/android/server/power/ShutdownThread.java
@@ -139,7 +139,9 @@ public final class ShutdownThread extends Thread {
                 ? com.android.internal.R.string.reboot_safemode_confirm
                 : (longPressBehavior == 2
                         ? com.android.internal.R.string.shutdown_confirm_question
-                        : com.android.internal.R.string.shutdown_confirm);
+                        : (mReboot 
+                                  ? com.android.internal.R.string.reboot_confirm
+                                  : com.android.internal.R.string.shutdown_confirm));
 
         Log.d(TAG, "Notifying thread to start shutdown longPressBehavior=" + longPressBehavior);
 
@@ -151,7 +153,9 @@ public final class ShutdownThread extends Thread {
             sConfirmDialog = new AlertDialog.Builder(context)
                     .setTitle(mRebootSafeMode
                             ? com.android.internal.R.string.reboot_safemode_title
-                            : com.android.internal.R.string.power_off)
+                            : (mReboot 
+                                      ? com.android.internal.R.string.global_action_reboot
+                                      : com.android.internal.R.string.power_off))
                     .setMessage(resourceId)
                     .setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
                         public void onClick(DialogInterface dialog, int which) {

长按power键弹出关机菜单,点击关机会弹出提示框,点击重启没有提示框确认直接进入重启状态,添加确认提示框