Merge changes I1aabef01,I8dbd0f83

* changes:
  SystemServer: Move MountService startup before NotificationManagerService
  StorageManager: Check for a null MountService
This commit is contained in:
San Mehat
2010-02-09 08:58:23 -08:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 8 deletions

View File

@@ -254,6 +254,10 @@ public class StorageManager
*/
public StorageManager(Looper tgtLooper) throws RemoteException {
mMountService = IMountService.Stub.asInterface(ServiceManager.getService("mount"));
if (mMountService == null) {
Log.e(TAG, "Unable to connect to mount service! - is it running yet?");
return;
}
mTgtLooper = tgtLooper;
mBinderListener = new MountServiceBinderListener();
mMountService.registerListener(mBinderListener);

View File

@@ -272,6 +272,17 @@ class ServerThread extends Thread {
Log.e(TAG, "Failure starting Accessibility Manager", e);
}
try {
/*
* NotificationManagerService is dependant on MountService,
* (for media / usb notifications) so we must start MountService first.
*/
Log.i(TAG, "Mount Service");
ServiceManager.addService("mount", new MountService(context));
} catch (Throwable e) {
Log.e(TAG, "Failure starting Mount Service", e);
}
try {
Log.i(TAG, "Notification Manager");
notification = new NotificationManagerService(context, statusBar, lights);
@@ -280,14 +291,6 @@ class ServerThread extends Thread {
Log.e(TAG, "Failure starting Notification Manager", e);
}
try {
// MountService must start after NotificationManagerService
Log.i(TAG, "Mount Service");
ServiceManager.addService("mount", new MountService(context));
} catch (Throwable e) {
Log.e(TAG, "Failure starting Mount Service", e);
}
try {
Log.i(TAG, "Device Storage Monitor");
ServiceManager.addService(DeviceStorageMonitorService.SERVICE,