Skip to content

Commit

Permalink
Use the reboot strings during a reboot
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Ringle <eddie.ringle@gmail.com>
  • Loading branch information
EddieRingle authored and hyperb1iss committed Jul 2, 2010
1 parent f067d72 commit d6828ab
Showing 1 changed file with 34 additions and 13 deletions.
47 changes: 34 additions & 13 deletions core/java/com/android/internal/app/ShutdownThread.java
Expand Up @@ -94,17 +94,33 @@ public static void shutdown(final Context context, boolean confirm) {
Log.d(TAG, "Notifying thread to start radio shutdown");

if (confirm) {
final AlertDialog dialog = new AlertDialog.Builder(context)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(com.android.internal.R.string.power_off)
.setMessage(com.android.internal.R.string.shutdown_confirm)
.setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
beginShutdownSequence(context);
}
})
.setNegativeButton(com.android.internal.R.string.no, null)
.create();
final AlertDialog dialog;
// Set different dialog message based on whether or not we're rebooting
if (mReboot) {
dialog = new AlertDialog.Builder(context)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(com.android.internal.R.string.reboot_system)
.setMessage(com.android.internal.R.string.reboot_confirm)
.setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
beginShutdownSequence(context);
}
})
.setNegativeButton(com.android.internal.R.string.no, null)
.create();
} else {
dialog = new AlertDialog.Builder(context)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(com.android.internal.R.string.power_off)
.setMessage(com.android.internal.R.string.shutdown_confirm)
.setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
beginShutdownSequence(context);
}
})
.setNegativeButton(com.android.internal.R.string.no, null)
.create();
}
dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
if (!context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_slowBlur)) {
Expand Down Expand Up @@ -139,8 +155,13 @@ private static void beginShutdownSequence(Context context) {
// throw up an indeterminate system dialog to indicate radio is
// shutting down.
ProgressDialog pd = new ProgressDialog(context);
pd.setTitle(context.getText(com.android.internal.R.string.power_off));
pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
if (mReboot) {
pd.setTitle(context.getText(com.android.internal.R.string.reboot_system));
pd.setMessage(context.getText(com.android.internal.R.string.reboot_progress));
} else {
pd.setTitle(context.getText(com.android.internal.R.string.power_off));
pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
}
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
Expand Down

0 comments on commit d6828ab

Please sign in to comment.