new HashMap<String, SpellCheckerBindGroup>();
private final TextServicesSettings mSettings;
- public void systemRunning() {
- if (!mSystemReady) {
- mSystemReady = true;
+ public static final class Lifecycle extends SystemService {
+ private TextServicesManagerService mService;
+
+ public Lifecycle(Context context) {
+ super(context);
+ mService = new TextServicesManagerService(context);
+ }
+
+ @Override
+ public void onStart() {
+ publishBinderService(Context.TEXT_SERVICES_MANAGER_SERVICE, mService);
+ }
+
+ @Override
+ public void onBootPhase(int phase) {
+ // Called on the system server's main looper thread.
+ // TODO: Dispatch this to a worker thread as needed.
+ if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
+ mService.systemRunning();
+ }
+ }
+ }
+
+ void systemRunning() {
+ synchronized (mSpellCheckerMap) {
+ if (!mSystemReady) {
+ mSystemReady = true;
+ }
}
}
WallpaperManagerService wallpaper = null;
LocationManagerService location = null;
CountryDetectorService countryDetector = null;
- TextServicesManagerService tsms = null;
ILockSettings lockSettings = null;
AssetAtlasService atlas = null;
MediaRouterService mediaRouter = null;
}
if (!disableNonCoreServices) {
- traceBeginAndSlog("StartTextServicesManagerService");
- try {
- tsms = new TextServicesManagerService(context);
- ServiceManager.addService(Context.TEXT_SERVICES_MANAGER_SERVICE, tsms);
- } catch (Throwable e) {
- reportWtf("starting Text Service Manager Service", e);
- }
- Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
+ mSystemServiceManager.startService(TextServicesManagerService.Lifecycle.class);
}
if (!disableNetwork) {
final CountryDetectorService countryDetectorF = countryDetector;
final NetworkTimeUpdateService networkTimeUpdaterF = networkTimeUpdater;
final CommonTimeManagementService commonTimeMgmtServiceF = commonTimeMgmtService;
- final TextServicesManagerService textServiceManagerServiceF = tsms;
final StatusBarManagerService statusBarF = statusBar;
final AssetAtlasService atlasF = atlas;
final InputManagerService inputManagerF = inputManager;
reportWtf("Notifying CommonTimeManagementService running", e);
}
try {
- if (textServiceManagerServiceF != null)
- textServiceManagerServiceF.systemRunning();
- } catch (Throwable e) {
- reportWtf("Notifying TextServicesManagerService running", e);
- }
- try {
if (atlasF != null) atlasF.systemRunning();
} catch (Throwable e) {
reportWtf("Notifying AssetAtlasService running", e);