diff options
author | Kenny Root <kroot@google.com> | 2012-07-30 12:58:03 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2012-07-30 16:28:44 -0700 |
commit | 26ff6626fc4ee0ae46f01ad309b366921da589fe (patch) | |
tree | 5b2469ff5463e1a7f9175943074877b6dfdb9e49 /services | |
parent | 47db02bad8fed67025669c41ef0c0dd9cafe7ed2 (diff) | |
download | frameworks_base-26ff6626fc4ee0ae46f01ad309b366921da589fe.zip frameworks_base-26ff6626fc4ee0ae46f01ad309b366921da589fe.tar.gz frameworks_base-26ff6626fc4ee0ae46f01ad309b366921da589fe.tar.bz2 |
Delay AccountManagerService initialization
Since applications can have Account providers, they need to be delayed
until after PackageManagerService says everything is mounted.
Otherwise the accounts associated with that provider will be removed
immediately when startup happens.
Bug: 6820670
Change-Id: Iba81765260421649f706624d0605a40ebc1347b1
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 9dd4a91..6d0b26f 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -114,6 +114,8 @@ class ServerThread extends Thread { : Integer.parseInt(factoryTestStr); final boolean headless = "1".equals(SystemProperties.get("ro.config.headless", "0")); + AccountManagerService accountManager = null; + ContentService contentService = null; LightsService lights = null; PowerManagerService power = null; BatteryService battery = null; @@ -190,14 +192,14 @@ class ServerThread extends Thread { // The AccountManager must come before the ContentService try { Slog.i(TAG, "Account Manager"); - ServiceManager.addService(Context.ACCOUNT_SERVICE, - new AccountManagerService(context)); + accountManager = new AccountManagerService(context); + ServiceManager.addService(Context.ACCOUNT_SERVICE, accountManager); } catch (Throwable e) { Slog.e(TAG, "Failure starting Account Manager", e); } Slog.i(TAG, "Content Manager"); - ContentService.main(context, + contentService = ContentService.main(context, factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL); Slog.i(TAG, "System Content Providers"); @@ -466,6 +468,20 @@ class ServerThread extends Thread { } try { + if (accountManager != null) + accountManager.systemReady(); + } catch (Throwable e) { + reportWtf("making Account Manager Service ready", e); + } + + try { + if (contentService != null) + contentService.systemReady(); + } catch (Throwable e) { + reportWtf("making Content Service ready", e); + } + + try { Slog.i(TAG, "Notification Manager"); notification = new NotificationManagerService(context, statusBar, lights); ServiceManager.addService(Context.NOTIFICATION_SERVICE, notification); |