summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorBuga Dániel <bugadani@gmail.com>2013-02-20 19:25:28 +0100
committerBuga Dániel <bugadani@gmail.com>2013-02-20 20:30:30 +0100
commitdbc6907710b9eb67f1af8b002b2994f19bce6c9b (patch)
tree4f94ada158d23d43ecfc52d6bba872ea46bad282 /services
parent410fda5b0716995e59de56f0cde9fbfaa4d2d5f1 (diff)
downloadframeworks_base-dbc6907710b9eb67f1af8b002b2994f19bce6c9b.zip
frameworks_base-dbc6907710b9eb67f1af8b002b2994f19bce6c9b.tar.gz
frameworks_base-dbc6907710b9eb67f1af8b002b2994f19bce6c9b.tar.bz2
Fix reboot window texts
PS2: move assignment of titleResourceId into the condition and only query longPressBehavior when it's needed. Change-Id: I00c3940c2b5472434177e94ab7c72d5fecc61b2e
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/power/ShutdownThread.java40
1 files changed, 25 insertions, 15 deletions
diff --git a/services/java/com/android/server/power/ShutdownThread.java b/services/java/com/android/server/power/ShutdownThread.java
index 4e4322f..ec84bb0 100644
--- a/services/java/com/android/server/power/ShutdownThread.java
+++ b/services/java/com/android/server/power/ShutdownThread.java
@@ -117,21 +117,31 @@ public final class ShutdownThread extends Thread {
}
}
- final int longPressBehavior = context.getResources().getInteger(
- com.android.internal.R.integer.config_longPressOnPowerBehavior);
- final int resourceId = mRebootSafeMode
- ? 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);
-
- final int titleResourceId = mRebootSafeMode
- ? com.android.internal.R.string.reboot_safemode_title
- : (mReboot
- ? com.android.internal.R.string.reboot_system
- : com.android.internal.R.string.power_off);
-
- Log.d(TAG, "Notifying thread to start shutdown longPressBehavior=" + longPressBehavior);
+ final int titleResourceId;
+ final int resourceId;
+
+ Log.d(TAG, "Notifying thread to start shutdown");
+
+ if (mRebootSafeMode) {
+ titleResourceId = com.android.internal.R.string.reboot_safemode_title;
+ resourceId = com.android.internal.R.string.reboot_safemode_confirm;
+ } else if (mReboot) {
+ titleResourceId = com.android.internal.R.string.reboot_system;
+ resourceId = com.android.internal.R.string.reboot_confirm;
+ } else {
+
+ final int longPressBehavior = context.getResources().getInteger(
+ com.android.internal.R.integer.config_longPressOnPowerBehavior);
+
+ titleResourceId = com.android.internal.R.string.power_off;
+ if (longPressBehavior == 2) {
+ resourceId = com.android.internal.R.string.shutdown_confirm_question;
+ } else {
+ resourceId = com.android.internal.R.string.shutdown_confirm;
+ }
+
+ Log.d(TAG, "longPressBehavior=" + longPressBehavior);
+ }
if (confirm) {
final CloseDialogReceiver closer = new CloseDialogReceiver(context);