diff options
| author | 2010-09-08 06:52:51 -0700 | |
|---|---|---|
| committer | 2010-09-08 06:52:51 -0700 | |
| commit | 789a47488c0e834eb80fe6b596dcc3e0ba7f1344 (patch) | |
| tree | 1380fc79ae121534eeb6ad9769836068c3fcfa16 | |
| parent | aaa9675b5c81a54ce83af18085d51528ad36320d (diff) | |
| parent | b8a8a578c2483d84ef96fd7050bbbcbc48d49a37 (diff) | |
Merge "Fix Intent.ACTION_REBOOT"
| -rw-r--r-- | core/res/AndroidManifest.xml | 4 | ||||
| -rw-r--r-- | services/java/com/android/server/ShutdownActivity.java | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index c2c2138a0914..c7c8ec198d73 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1311,6 +1311,10 @@ <action android:name="android.intent.action.ACTION_REQUEST_SHUTDOWN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> + <intent-filter> + <action android:name="android.intent.action.REBOOT" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> </activity> <activity android:name="com.android.internal.app.NetInitiatedActivity" android:theme="@style/Theme.Dialog.Alert" diff --git a/services/java/com/android/server/ShutdownActivity.java b/services/java/com/android/server/ShutdownActivity.java index 64b9c5d6db8e..c9d4d0117c56 100644 --- a/services/java/com/android/server/ShutdownActivity.java +++ b/services/java/com/android/server/ShutdownActivity.java @@ -27,19 +27,26 @@ import com.android.internal.app.ShutdownThread; public class ShutdownActivity extends Activity { private static final String TAG = "ShutdownActivity"; + private boolean mReboot; private boolean mConfirm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mConfirm = getIntent().getBooleanExtra(Intent.EXTRA_KEY_CONFIRM, false); + Intent intent = getIntent(); + mReboot = Intent.ACTION_REBOOT.equals(intent.getAction()); + mConfirm = intent.getBooleanExtra(Intent.EXTRA_KEY_CONFIRM, false); Slog.i(TAG, "onCreate(): confirm=" + mConfirm); Handler h = new Handler(); h.post(new Runnable() { public void run() { - ShutdownThread.shutdown(ShutdownActivity.this, mConfirm); + if (mReboot) { + ShutdownThread.reboot(ShutdownActivity.this, null, mConfirm); + } else { + ShutdownThread.shutdown(ShutdownActivity.this, mConfirm); + } } }); } |