summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-01-07 11:34:59 -0800
committerSan Mehat <san@google.com>2010-01-07 11:36:22 -0800
commit9f7f7cad0b1fd7b096d65faf4b2352204403257e (patch)
tree64856e0ce41c55a75f3f311a13d816a4028c5c87 /core/java/com
parentdde25397985d82352965c54d68c0ee181b2c3cc8 (diff)
downloadframeworks_base-9f7f7cad0b1fd7b096d65faf4b2352204403257e.zip
frameworks_base-9f7f7cad0b1fd7b096d65faf4b2352204403257e.tar.gz
frameworks_base-9f7f7cad0b1fd7b096d65faf4b2352204403257e.tar.bz2
ShutdownThread: Shutdown MountService before lowlevel shutdown
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/app/ShutdownThread.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/com/android/internal/app/ShutdownThread.java b/core/java/com/android/internal/app/ShutdownThread.java
index 2060cf8..c110f95 100644
--- a/core/java/com/android/internal/app/ShutdownThread.java
+++ b/core/java/com/android/internal/app/ShutdownThread.java
@@ -32,6 +32,7 @@ import android.os.RemoteException;
import android.os.Power;
import android.os.ServiceManager;
import android.os.SystemClock;
+import android.os.IMountService;
import com.android.internal.telephony.ITelephony;
import android.util.Log;
@@ -189,6 +190,10 @@ public final class ShutdownThread extends Thread {
final IBluetooth bluetooth =
IBluetooth.Stub.asInterface(ServiceManager.checkService(
BluetoothAdapter.BLUETOOTH_SERVICE));
+
+ final IMountService mount =
+ IMountService.Stub.asInterface(
+ ServiceManager.checkService("mount"));
try {
bluetoothOff = bluetooth == null ||
@@ -241,6 +246,17 @@ public final class ShutdownThread extends Thread {
SystemClock.sleep(PHONE_STATE_POLL_SLEEP_MSEC);
}
+ // Shutdown MountService to ensure media is in a safe state
+ try {
+ if (mount != null) {
+ mount.shutdown();
+ } else {
+ Log.w(TAG, "MountService unavailable for shutdown");
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "Exception during MountService shutdown", e);
+ }
+
//shutdown power
Log.i(TAG, "Performing low-level shutdown...");
Power.shutdown();