@@ -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 DisplayManagerService display = null ;
@@ -195,14 +197,14 @@ public void run() {
195197 // The AccountManager must come before the ContentService
196198 try {
197199 Slog .i (TAG , "Account Manager" );
198- ServiceManager . addService ( Context . ACCOUNT_SERVICE ,
199- new AccountManagerService ( context ) );
200+ accountManager = new AccountManagerService ( context );
201+ ServiceManager . addService ( Context . ACCOUNT_SERVICE , accountManager );
200202 } catch (Throwable e ) {
201203 Slog .e (TAG , "Failure starting Account Manager" , e );
202204 }
203205
204206 Slog .i (TAG , "Content Manager" );
205- ContentService .main (context ,
207+ contentService = ContentService .main (context ,
206208 factoryTest == SystemServer .FACTORY_TEST_LOW_LEVEL );
207209
208210 Slog .i (TAG , "System Content Providers" );
@@ -456,6 +458,20 @@ public void run() {
456458 mountService .waitForAsecScan ();
457459 }
458460
461+ try {
462+ if (accountManager != null )
463+ accountManager .systemReady ();
464+ } catch (Throwable e ) {
465+ reportWtf ("making Account Manager Service ready" , e );
466+ }
467+
468+ try {
469+ if (contentService != null )
470+ contentService .systemReady ();
471+ } catch (Throwable e ) {
472+ reportWtf ("making Content Service ready" , e );
473+ }
474+
459475 try {
460476 Slog .i (TAG , "Notification Manager" );
461477 notification = new NotificationManagerService (context , statusBar , lights );
0 commit comments