@@ -114,6 +114,8 @@ public void run() {
114114 : Integer .parseInt (factoryTestStr );
115115 final boolean headless = "1" .equals (SystemProperties .get ("ro.config.headless" , "0" ));
116116
117+ AccountManagerService accountManager = null ;
118+ ContentService contentService = null ;
117119 LightsService lights = null ;
118120 PowerManagerService power = null ;
119121 BatteryService battery = null ;
@@ -190,14 +192,14 @@ public void run() {
190192 // The AccountManager must come before the ContentService
191193 try {
192194 Slog .i (TAG , "Account Manager" );
193- ServiceManager . addService ( Context . ACCOUNT_SERVICE ,
194- new AccountManagerService ( context ) );
195+ accountManager = new AccountManagerService ( context );
196+ ServiceManager . addService ( Context . ACCOUNT_SERVICE , accountManager );
195197 } catch (Throwable e ) {
196198 Slog .e (TAG , "Failure starting Account Manager" , e );
197199 }
198200
199201 Slog .i (TAG , "Content Manager" );
200- ContentService .main (context ,
202+ contentService = ContentService .main (context ,
201203 factoryTest == SystemServer .FACTORY_TEST_LOW_LEVEL );
202204
203205 Slog .i (TAG , "System Content Providers" );
@@ -465,6 +467,20 @@ public void run() {
465467 mountService .waitForAsecScan ();
466468 }
467469
470+ try {
471+ if (accountManager != null )
472+ accountManager .systemReady ();
473+ } catch (Throwable e ) {
474+ reportWtf ("making Account Manager Service ready" , e );
475+ }
476+
477+ try {
478+ if (contentService != null )
479+ contentService .systemReady ();
480+ } catch (Throwable e ) {
481+ reportWtf ("making Content Service ready" , e );
482+ }
483+
468484 try {
469485 Slog .i (TAG , "Notification Manager" );
470486 notification = new NotificationManagerService (context , statusBar , lights );
0 commit comments