OSDN Git Service

Start MountService before performBootDexOpt
authorpadarshr <padarshr@codeaurora.org>
Wed, 5 Nov 2014 11:24:50 +0000 (16:54 +0530)
committerDianne Hackborn <hackbod@google.com>
Tue, 25 Nov 2014 18:42:15 +0000 (10:42 -0800)
This change is to start Mountservice before starting
performBootDexOpt, as in one case, in performBootDexOpt
when system upgrade happens, StorageManager will be started to
get the low threshold of DataDir. But, at this point, as
Mountservice is still not up, StorageManager will end up
having a null object of Mountservice.

Change-Id: I6dec474266faa5de67449c1bbe6ef30791e5ecaa

services/java/com/android/server/SystemServer.java

index 4e6a8ea..b3a696e 100644 (file)
@@ -549,20 +549,6 @@ public final class SystemServer {
             reportWtf("making display ready", e);
         }
 
-        try {
-            mPackageManagerService.performBootDexOpt();
-        } catch (Throwable e) {
-            reportWtf("performing boot dexopt", e);
-        }
-
-        try {
-            ActivityManagerNative.getDefault().showBootMessage(
-                    context.getResources().getText(
-                            com.android.internal.R.string.android_upgrading_starting_apps),
-                    false);
-        } catch (RemoteException e) {
-        }
-
         if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
             if (!disableStorage &&
                 !"0".equals(SystemProperties.get("system_init.startmountservice"))) {
@@ -578,7 +564,23 @@ public final class SystemServer {
                     reportWtf("starting Mount Service", e);
                 }
             }
+        }
 
+        try {
+            mPackageManagerService.performBootDexOpt();
+        } catch (Throwable e) {
+            reportWtf("performing boot dexopt", e);
+        }
+
+        try {
+            ActivityManagerNative.getDefault().showBootMessage(
+                    context.getResources().getText(
+                            com.android.internal.R.string.android_upgrading_starting_apps),
+                    false);
+        } catch (RemoteException e) {
+        }
+
+        if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
             if (!disableNonCoreServices) {
                 try {
                     Slog.i(TAG,  "LockSettingsService");