summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/Power.java10
-rw-r--r--core/java/android/os/storage/IMountService.aidl4
-rw-r--r--core/java/android/os/storage/IMountShutdownObserver.aidl33
3 files changed, 36 insertions, 11 deletions
diff --git a/core/java/android/os/Power.java b/core/java/android/os/Power.java
index b3df52246f49..5a7921590156 100644
--- a/core/java/android/os/Power.java
+++ b/core/java/android/os/Power.java
@@ -18,7 +18,6 @@ package android.os;
import java.io.IOException;
import android.os.ServiceManager;
-import android.os.storage.IMountService;
/**
* Class that provides access to some of the power management functions.
@@ -101,15 +100,6 @@ public class Power
*/
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);
}
diff --git a/core/java/android/os/storage/IMountService.aidl b/core/java/android/os/storage/IMountService.aidl
index ad4cb105c708..75455ab35b44 100644
--- a/core/java/android/os/storage/IMountService.aidl
+++ b/core/java/android/os/storage/IMountService.aidl
@@ -18,6 +18,7 @@
package android.os.storage;
import android.os.storage.IMountServiceListener;
+import android.os.storage.IMountShutdownObserver;
/** WARNING! Update IMountService.h and IMountService.cpp if you change this file.
* In particular, the ordering of the methods below must match the
@@ -142,6 +143,7 @@ interface IMountService
/**
* Shuts down the MountService and gracefully unmounts all external media.
+ * Invokes call back once the shutdown is complete.
*/
- void shutdown();
+ void shutdown(IMountShutdownObserver observer);
}
diff --git a/core/java/android/os/storage/IMountShutdownObserver.aidl b/core/java/android/os/storage/IMountShutdownObserver.aidl
new file mode 100644
index 000000000000..0aa8a4592ab6
--- /dev/null
+++ b/core/java/android/os/storage/IMountShutdownObserver.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os.storage;
+
+/**
+ * Callback class for receiving events related
+ * to shutdown.
+ *
+ * @hide - For internal consumption only.
+ */
+interface IMountShutdownObserver {
+ /**
+ * This method is called when the shutdown
+ * of MountService completed.
+ * @param statusCode indicates success or failure
+ * of the shutdown.
+ */
+ void onShutDownComplete(int statusCode);
+}