Loading core/java/android/accounts/AccountManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -220,8 +220,6 @@ public class AccountManagerService sThis.set(this); UserAccounts accounts = initUser(0); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); intentFilter.addDataScheme("package"); Loading @@ -242,6 +240,11 @@ public class AccountManagerService }, userFilter); } public void systemReady() { mAuthenticatorCache.generateServicesMap(); initUser(0); } private UserAccounts initUser(int userId) { synchronized (mUsers) { UserAccounts accounts = mUsers.get(userId); Loading core/java/android/accounts/IAccountAuthenticatorCache.java +5 −0 Original line number Diff line number Diff line Loading @@ -60,4 +60,9 @@ public interface IAccountAuthenticatorCache { */ void setListener(RegisteredServicesCacheListener<AuthenticatorDescription> listener, Handler handler); /** * Refreshes the authenticator cache. */ void generateServicesMap(); } No newline at end of file core/java/android/content/ContentService.java +4 −1 Original line number Diff line number Diff line Loading @@ -132,6 +132,9 @@ public final class ContentService extends IContentService.Stub { /*package*/ ContentService(Context context, boolean factoryTest) { mContext = context; mFactoryTest = factoryTest; } public void systemReady() { getSyncManager(); } Loading Loading @@ -524,7 +527,7 @@ public final class ContentService extends IContentService.Stub { } } public static IContentService main(Context context, boolean factoryTest) { public static ContentService main(Context context, boolean factoryTest) { ContentService service = new ContentService(context, factoryTest); ServiceManager.addService(ContentResolver.CONTENT_SERVICE_NAME, service); return service; Loading core/java/android/content/pm/RegisteredServicesCache.java +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ public abstract class RegisteredServicesCache<V> { return false; } void generateServicesMap() { public void generateServicesMap() { PackageManager pm = mContext.getPackageManager(); ArrayList<ServiceInfo<V>> serviceInfos = new ArrayList<ServiceInfo<V>>(); List<ResolveInfo> resolveInfos = pm.queryIntentServices(new Intent(mInterfaceName), Loading services/java/com/android/server/SystemServer.java +19 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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"); Loading Loading @@ -465,6 +467,20 @@ class ServerThread extends Thread { mountService.waitForAsecScan(); } 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); Loading Loading
core/java/android/accounts/AccountManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -220,8 +220,6 @@ public class AccountManagerService sThis.set(this); UserAccounts accounts = initUser(0); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); intentFilter.addDataScheme("package"); Loading @@ -242,6 +240,11 @@ public class AccountManagerService }, userFilter); } public void systemReady() { mAuthenticatorCache.generateServicesMap(); initUser(0); } private UserAccounts initUser(int userId) { synchronized (mUsers) { UserAccounts accounts = mUsers.get(userId); Loading
core/java/android/accounts/IAccountAuthenticatorCache.java +5 −0 Original line number Diff line number Diff line Loading @@ -60,4 +60,9 @@ public interface IAccountAuthenticatorCache { */ void setListener(RegisteredServicesCacheListener<AuthenticatorDescription> listener, Handler handler); /** * Refreshes the authenticator cache. */ void generateServicesMap(); } No newline at end of file
core/java/android/content/ContentService.java +4 −1 Original line number Diff line number Diff line Loading @@ -132,6 +132,9 @@ public final class ContentService extends IContentService.Stub { /*package*/ ContentService(Context context, boolean factoryTest) { mContext = context; mFactoryTest = factoryTest; } public void systemReady() { getSyncManager(); } Loading Loading @@ -524,7 +527,7 @@ public final class ContentService extends IContentService.Stub { } } public static IContentService main(Context context, boolean factoryTest) { public static ContentService main(Context context, boolean factoryTest) { ContentService service = new ContentService(context, factoryTest); ServiceManager.addService(ContentResolver.CONTENT_SERVICE_NAME, service); return service; Loading
core/java/android/content/pm/RegisteredServicesCache.java +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ public abstract class RegisteredServicesCache<V> { return false; } void generateServicesMap() { public void generateServicesMap() { PackageManager pm = mContext.getPackageManager(); ArrayList<ServiceInfo<V>> serviceInfos = new ArrayList<ServiceInfo<V>>(); List<ResolveInfo> resolveInfos = pm.queryIntentServices(new Intent(mInterfaceName), Loading
services/java/com/android/server/SystemServer.java +19 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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"); Loading Loading @@ -465,6 +467,20 @@ class ServerThread extends Thread { mountService.waitForAsecScan(); } 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); Loading