Permalink
Browse files

Reboot dialog fixes

Reboot dialog could not show up if the PowerMenu has not been called yet.
Also respect "show reboot on Lockscreen" setting of PowerMenu.

PS2: Formatting fix

Change-Id: If544575f0716be70b6a48d32ee273de0188c47a5
Signed-off-by: Gergely Szell (sethyx) <szell@hu.ibm.com>
  • Loading branch information...
1 parent 6bc71c6 commit 6c3d661bdc5414bb25b90f2698ce99ed4bdedc88 Gergely Szell (sethyx) committed Mar 31, 2013
@@ -1396,7 +1396,7 @@ public boolean onKeyUp(int keyCode, KeyEvent event) {
}
}
- public AlertDialog createRebootDialog() {
+ private AlertDialog createRebootDialog() {
final String[] rebootOptions = mContext.getResources().getStringArray(R.array.reboot_options);
final String[] rebootReasons = mContext.getResources().getStringArray(R.array.reboot_values);
@@ -1435,4 +1435,20 @@ public void onClick(DialogInterface dialog, int which) {
return d;
}
+
+ public void showRebootDialog(boolean keyguardShowing) {
+ mKeyguardShowing = keyguardShowing;
+ AlertDialog rDialog = createRebootDialog();
+ if (mKeyguardShowing) {
+ mShowRebootOnLock = Settings.System.getBoolean(mContext.getContentResolver(),
+ Settings.System.POWER_DIALOG_SHOW_REBOOT_KEYGUARD, true);
+ if (mShowRebootOnLock) {
+ rDialog.show();
+ rDialog.getWindow().getDecorView().setSystemUiVisibility(
+ View.STATUS_BAR_DISABLE_EXPAND);
+ }
+ } else {
+ rDialog.show();
+ }
+ }
}
@@ -889,7 +889,7 @@ public void showRebootDialog() {
mGlobalActions = new GlobalActions(mContext, mWindowManagerFuncs);
}
final boolean keyguardShowing = keyguardIsShowingTq();
- mGlobalActions.createRebootDialog().show();
+ mGlobalActions.showRebootDialog(keyguardShowing);
if (keyguardShowing) {
// since it took two seconds of long press to bring this up,
// poke the wake lock so they have some time to see the dialog.

0 comments on commit 6c3d661

Please sign in to comment.