diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2010-01-12 11:53:42 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2010-01-12 11:53:42 -0800 |
commit | fa101530bc74bdf1517a1840a9415249211b9414 (patch) | |
tree | f0c93712359e7b102a1ed5edd2fb81a7f6ecb374 /core | |
parent | 8f028a94fc533e75077485a7d11a04e4de820335 (diff) | |
parent | d26707da8965bffb63c55d729f19ddfcb83044b3 (diff) | |
download | frameworks_base-fa101530bc74bdf1517a1840a9415249211b9414.zip frameworks_base-fa101530bc74bdf1517a1840a9415249211b9414.tar.gz frameworks_base-fa101530bc74bdf1517a1840a9415249211b9414.tar.bz2 |
resolved conflicts for merge of d26707da to master
Change-Id: I1a379194f70c4b14191333ca2d8e6dd9d8b0f9dd
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/os/IMountService.aidl | 3 | ||||
-rw-r--r-- | core/java/android/os/Power.java | 18 | ||||
-rw-r--r-- | core/jni/android_os_Power.cpp | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/core/java/android/os/IMountService.aidl b/core/java/android/os/IMountService.aidl index f052689..1e79030 100644 --- a/core/java/android/os/IMountService.aidl +++ b/core/java/android/os/IMountService.aidl @@ -104,8 +104,7 @@ interface IMountService String[] getSecureContainerList(); /** - * Shuts down the MountService and gracefully unmounts - * all external media. + * Shuts down the MountService and gracefully unmounts all external media. */ void shutdown(); } diff --git a/core/java/android/os/Power.java b/core/java/android/os/Power.java index 3679e47..bc76180 100644 --- a/core/java/android/os/Power.java +++ b/core/java/android/os/Power.java @@ -17,6 +17,8 @@ package android.os; import java.io.IOException; +import android.os.ServiceManager; +import android.os.IMountService; /** * Class that provides access to some of the power management functions. @@ -97,5 +99,19 @@ public class Power * @throws IOException if reboot fails for some reason (eg, lack of * permission) */ - public static native void reboot(String reason) throws IOException; + public static void reboot(String reason) throws IOException + { + IMountService mSvc = IMountService.Stub.asInterface( + ServiceManager.getService("mount")); + + if (mSvc != null) { + try { + mSvc.shutdown(); + } catch (Exception e) { + } + } + rebootNative(reason); + } + + private static native void rebootNative(String reason) throws IOException ; } diff --git a/core/jni/android_os_Power.cpp b/core/jni/android_os_Power.cpp index df5edba..a46c2dd 100644 --- a/core/jni/android_os_Power.cpp +++ b/core/jni/android_os_Power.cpp @@ -105,7 +105,7 @@ static JNINativeMethod method_table[] = { { "setLastUserActivityTimeout", "(J)I", (void*)setLastUserActivityTimeout }, { "setScreenState", "(Z)I", (void*)setScreenState }, { "shutdown", "()V", (void*)android_os_Power_shutdown }, - { "reboot", "(Ljava/lang/String;)V", (void*)android_os_Power_reboot }, + { "rebootNative", "(Ljava/lang/String;)V", (void*)android_os_Power_reboot }, }; int register_android_os_Power(JNIEnv *env) |