Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-policies-base: Commit

frameworks/policies/base


Commit MetaInfo

Revision1cab31fd64b48f9f3ba0bddce323f1aaf039ff69 (tree)
Time2010-12-20 16:37:38
Authorkwok <kwok.wong@live...>
CommiterChih-Wei Huang

Log Message

Check whether to show dialog/confirmation during power-off

Change-Id: Ica5056c6abeb533d6af11739a09ef1afa3ff54f1

Change Summary

Incremental Difference

--- a/phone/com/android/internal/policy/impl/GlobalActions.java
+++ b/phone/com/android/internal/policy/impl/GlobalActions.java
@@ -20,6 +20,7 @@ import android.app.Activity;
2020 import android.app.AlertDialog;
2121 import android.app.StatusBarManager;
2222 import android.content.BroadcastReceiver;
23+import android.content.ContentResolver;
2324 import android.content.Context;
2425 import android.content.DialogInterface;
2526 import android.content.Intent;
@@ -200,8 +201,12 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
200201
201202 public void onPress() {
202203 // shutdown by making sure radio and power are handled accordingly.
203- ShutdownThread.shutdown(mContext, true, false);
204-
204+ final ContentResolver cr = mContext.getContentResolver();
205+ if (Settings.System.getInt(cr, Settings.System.DISABLE_CONFIRMATION, 0) == 0) {
206+ ShutdownThread.shutdown(mContext, true, false);
207+ } else {
208+ ShutdownThread.shutdown(mContext, false);
209+ }
205210 }
206211
207212 public boolean showDuringKeyguard() {
--- a/phone/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/phone/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -46,6 +46,7 @@ import android.os.SystemProperties;
4646 import android.os.Vibrator;
4747 import android.provider.Settings;
4848
49+import com.android.internal.app.ShutdownThread;
4950 import com.android.internal.policy.PolicyManager;
5051 import com.android.internal.telephony.ITelephony;
5152 import com.android.internal.widget.PointerLocationView;
@@ -440,7 +441,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
440441 mShouldTurnOffOnKeyUp = false;
441442 performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
442443 sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
443- showGlobalActionsDialog();
444+ final ContentResolver cr = mContext.getContentResolver();
445+ if (Settings.System.getInt(cr, Settings.System.REMOVE_POWER_OFF_DIALOG, 0) == 0) {
446+ showGlobalActionsDialog();
447+ } else {
448+ ShutdownThread.shutdown(mContext, false);
449+ }
444450 }
445451 };
446452
Show on old repository browser