Program: 198565
Project: 198565
Buggy source:
/** 
 * Starts a miscellaneous grab bag of stuff that has yet to be refactored and organized.
 */
private void startOtherServices(){
  final Context context=mSystemContext;
  AccountManagerService accountManager=null;
  ContentService contentService=null;
  VibratorService vibrator=null;
  IAlarmManager alarm=null;
  MountService mountService=null;
  NetworkManagementService networkManagement=null;
  NetworkStatsService networkStats=null;
  NetworkPolicyManagerService networkPolicy=null;
  ConnectivityService connectivity=null;
  NetworkScoreService networkScore=null;
  NsdService serviceDiscovery=null;
  WindowManagerService wm=null;
  BluetoothManagerService bluetooth=null;
  UsbService usb=null;
  SerialService serial=null;
  RecognitionManagerService recognition=null;
  NetworkTimeUpdateService networkTimeUpdater=null;
  CommonTimeManagementService commonTimeMgmtService=null;
  InputManagerService inputManager=null;
  TelephonyRegistry telephonyRegistry=null;
  ConsumerIrService consumerIr=null;
  AudioService audioService=null;
  MmsServiceBroker mmsService=null;
  boolean disableStorage=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableMedia=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableBluetooth=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableTelephony=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableLocation=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableSystemUI=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableNonCoreServices=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableNetwork=SystemProperties.getBoolean("String_Node_Str",false);
  boolean isEmulator=SystemProperties.get("String_Node_Str").equals("String_Node_Str");
  try {
    Slog.i(TAG,"String_Node_Str");
    SystemConfig.getInstance();
    Slog.i(TAG,"String_Node_Str");
    ServiceManager.addService("String_Node_Str",new SchedulingPolicyService());
    Slog.i(TAG,"String_Node_Str");
    telephonyRegistry=new TelephonyRegistry(context);
    ServiceManager.addService("String_Node_Str",telephonyRegistry);
    Slog.i(TAG,"String_Node_Str");
    ServiceManager.addService("String_Node_Str",new EntropyMixer(context));
    mContentResolver=context.getContentResolver();
    try {
      Slog.i(TAG,"String_Node_Str");
      accountManager=new AccountManagerService(context);
      ServiceManager.addService(Context.ACCOUNT_SERVICE,accountManager);
    }
 catch (    Throwable e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
    Slog.i(TAG,"String_Node_Str");
    contentService=ContentService.main(context,mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL);
    Slog.i(TAG,"String_Node_Str");
    mActivityManagerService.installSystemProviders();
    Slog.i(TAG,"String_Node_Str");
    vibrator=new VibratorService(context);
    ServiceManager.addService("String_Node_Str",vibrator);
    Slog.i(TAG,"String_Node_Str");
    consumerIr=new ConsumerIrService(context);
    ServiceManager.addService(Context.CONSUMER_IR_SERVICE,consumerIr);
    mSystemServiceManager.startService(AlarmManagerService.class);
    alarm=IAlarmManager.Stub.asInterface(ServiceManager.getService(Context.ALARM_SERVICE));
    Slog.i(TAG,"String_Node_Str");
    final Watchdog watchdog=Watchdog.getInstance();
    watchdog.init(context,mActivityManagerService);
    Slog.i(TAG,"String_Node_Str");
    inputManager=new InputManagerService(context);
    Slog.i(TAG,"String_Node_Str");
    wm=WindowManagerService.main(context,inputManager,mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL,!mFirstBoot,mOnlyCore);
    ServiceManager.addService(Context.WINDOW_SERVICE,wm);
    ServiceManager.addService(Context.INPUT_SERVICE,inputManager);
    mActivityManagerService.setWindowManager(wm);
    inputManager.setWindowManagerCallbacks(wm.getInputMonitor());
    inputManager.start();
    mDisplayManagerService.windowManagerAndInputReady();
    if (isEmulator) {
      Slog.i(TAG,"String_Node_Str");
    }
 else     if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) {
      Slog.i(TAG,"String_Node_Str");
    }
 else     if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
      Slog.i(TAG,"String_Node_Str");
    }
 else     if (disableBluetooth) {
      Slog.i(TAG,"String_Node_Str");
    }
 else {
      Slog.i(TAG,"String_Node_Str");
      bluetooth=new BluetoothManagerService(context);
      ServiceManager.addService(BluetoothAdapter.BLUETOOTH_MANAGER_SERVICE,bluetooth);
    }
  }
 catch (  RuntimeException e) {
    Slog.e("String_Node_Str","String_Node_Str");
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  StatusBarManagerService statusBar=null;
  INotificationManager notification=null;
  InputMethodManagerService imm=null;
  WallpaperManagerService wallpaper=null;
  LocationManagerService location=null;
  CountryDetectorService countryDetector=null;
  TextServicesManagerService tsms=null;
  LockSettingsService lockSettings=null;
  AssetAtlasService atlas=null;
  MediaRouterService mediaRouter=null;
  if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
    if (true) {
      try {
        Slog.i(TAG,"String_Node_Str");
        imm=new InputMethodManagerService(context,wm);
        ServiceManager.addService(Context.INPUT_METHOD_SERVICE,imm);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.ACCESSIBILITY_SERVICE,new AccessibilityManagerService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
  }
  try {
    wm.displayReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    mPackageManagerService.performBootDexOpt();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    ActivityManagerNative.getDefault().showBootMessage(context.getResources().getText(com.android.internal.R.string.android_upgrading_starting_apps),false);
  }
 catch (  RemoteException e) {
  }
  if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
    if (!disableStorage && !"String_Node_Str".equals(SystemProperties.get("String_Node_Str"))) {
      try {
        Slog.i(TAG,"String_Node_Str");
        mountService=new MountService(context);
        ServiceManager.addService("String_Node_Str",mountService);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        lockSettings=new LockSettingsService(context);
        ServiceManager.addService("String_Node_Str",lockSettings);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("String_Node_Str")) {
        mSystemServiceManager.startService(PersistentDataBlockService.class);
      }
      mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
    }
    if (!disableSystemUI) {
      try {
        Slog.i(TAG,"String_Node_Str");
        statusBar=new StatusBarManagerService(context,wm);
        ServiceManager.addService(Context.STATUS_BAR_SERVICE,statusBar);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.CLIPBOARD_SERVICE,new ClipboardService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        networkManagement=NetworkManagementService.create(context);
        ServiceManager.addService(Context.NETWORKMANAGEMENT_SERVICE,networkManagement);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        tsms=new TextServicesManagerService(context);
        ServiceManager.addService(Context.TEXT_SERVICES_MANAGER_SERVICE,tsms);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        networkScore=new NetworkScoreService(context);
        ServiceManager.addService(Context.NETWORK_SCORE_SERVICE,networkScore);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        networkStats=new NetworkStatsService(context,networkManagement,alarm);
        ServiceManager.addService(Context.NETWORK_STATS_SERVICE,networkStats);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        networkPolicy=new NetworkPolicyManagerService(context,mActivityManagerService,(IPowerManager)ServiceManager.getService(Context.POWER_SERVICE),networkStats,networkManagement);
        ServiceManager.addService(Context.NETWORK_POLICY_SERVICE,networkPolicy);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      mSystemServiceManager.startService(WIFI_P2P_SERVICE_CLASS);
      mSystemServiceManager.startService(WIFI_PASSPOINT_SERVICE_CLASS);
      mSystemServiceManager.startService(WIFI_SERVICE_CLASS);
      mSystemServiceManager.startService("String_Node_Str");
      mSystemServiceManager.startService("String_Node_Str");
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_ETHERNET)) {
        mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        connectivity=new ConnectivityService(context,networkManagement,networkStats,networkPolicy);
        ServiceManager.addService(Context.CONNECTIVITY_SERVICE,connectivity);
        networkStats.bindConnectivityManager(connectivity);
        networkPolicy.bindConnectivityManager(connectivity);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        serviceDiscovery=NsdService.create(context);
        ServiceManager.addService(Context.NSD_SERVICE,serviceDiscovery);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.UPDATE_LOCK_SERVICE,new UpdateLockService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (mountService != null && !mOnlyCore) {
      mountService.waitForAsecScan();
    }
    try {
      if (accountManager != null)       accountManager.systemReady();
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    try {
      if (contentService != null)       contentService.systemReady();
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    mSystemServiceManager.startService(NotificationManagerService.class);
    notification=INotificationManager.Stub.asInterface(ServiceManager.getService(Context.NOTIFICATION_SERVICE));
    networkPolicy.bindNotificationManager(notification);
    mSystemServiceManager.startService(DeviceStorageMonitorService.class);
    if (!disableLocation) {
      try {
        Slog.i(TAG,"String_Node_Str");
        location=new LocationManagerService(context);
        ServiceManager.addService(Context.LOCATION_SERVICE,location);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        countryDetector=new CountryDetectorService(context);
        ServiceManager.addService(Context.COUNTRY_DETECTOR,countryDetector);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.SEARCH_SERVICE,new SearchManagerService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    try {
      Slog.i(TAG,"String_Node_Str");
      ServiceManager.addService(Context.DROPBOX_SERVICE,new DropBoxManagerService(context,new File("String_Node_Str")));
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    if (!disableNonCoreServices && context.getResources().getBoolean(R.bool.config_enableWallpaperService)) {
      try {
        Slog.i(TAG,"String_Node_Str");
        wallpaper=new WallpaperManagerService(context);
        ServiceManager.addService(Context.WALLPAPER_SERVICE,wallpaper);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableMedia && !"String_Node_Str".equals(SystemProperties.get("String_Node_Str"))) {
      try {
        Slog.i(TAG,"String_Node_Str");
        audioService=new AudioService(context);
        ServiceManager.addService(Context.AUDIO_SERVICE,audioService);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      mSystemServiceManager.startService(DockObserver.class);
    }
    if (!disableMedia) {
      try {
        Slog.i(TAG,"String_Node_Str");
        inputManager.setWiredAccessoryCallbacks(new WiredAccessoryManager(context,inputManager));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) || mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_ACCESSORY)) {
        mSystemServiceManager.startService(USB_SERVICE_CLASS);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        serial=new SerialService(context);
        ServiceManager.addService(Context.SERIAL_SERVICE,serial);
      }
 catch (      Throwable e) {
        Slog.e(TAG,"String_Node_Str",e);
      }
    }
    mSystemServiceManager.startService(TwilightService.class);
    mSystemServiceManager.startService(UiModeManagerService.class);
    mSystemServiceManager.startService(JobSchedulerService.class);
    if (!disableNonCoreServices) {
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_BACKUP)) {
        mSystemServiceManager.startService(BACKUP_MANAGER_SERVICE_CLASS);
      }
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS)) {
        mSystemServiceManager.startService(APPWIDGET_SERVICE_CLASS);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        recognition=new RecognitionManagerService(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_VOICE_RECOGNIZERS)) {
        mSystemServiceManager.startService(VOICE_RECOGNITION_MANAGER_SERVICE_CLASS);
      }
    }
    try {
      Slog.i(TAG,"String_Node_Str");
      ServiceManager.addService("String_Node_Str",new DiskStatsService(context));
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    try {
      Slog.i(TAG,"String_Node_Str");
      ServiceManager.addService("String_Node_Str",new SamplingProfilerService(context));
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        networkTimeUpdater=new NetworkTimeUpdateService(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableMedia) {
      try {
        Slog.i(TAG,"String_Node_Str");
        commonTimeMgmtService=new CommonTimeManagementService(context);
        ServiceManager.addService("String_Node_Str",commonTimeMgmtService);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        CertBlacklister blacklister=new CertBlacklister(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      mSystemServiceManager.startService(DreamManagerService.class);
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        atlas=new AssetAtlasService(context);
        ServiceManager.addService(AssetAtlasService.ASSET_ATLAS_SERVICE,atlas);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_PRINTING)) {
      mSystemServiceManager.startService(PRINT_MANAGER_SERVICE_CLASS);
    }
    mSystemServiceManager.startService(RestrictionsManagerService.class);
    mSystemServiceManager.startService(MediaSessionService.class);
    if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_HDMI_CEC)) {
      mSystemServiceManager.startService(HdmiControlService.class);
    }
    if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
      mSystemServiceManager.startService(TvInputManagerService.class);
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        mediaRouter=new MediaRouterService(context);
        ServiceManager.addService(Context.MEDIA_ROUTER_SERVICE,mediaRouter);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      mSystemServiceManager.startService(TrustManagerService.class);
      mSystemServiceManager.startService(FingerprintService.class);
      try {
        Slog.i(TAG,"String_Node_Str");
        BackgroundDexOptService.schedule(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    mSystemServiceManager.startService(LauncherAppsService.class);
  }
  if (!disableNonCoreServices) {
    mSystemServiceManager.startService(MediaProjectionManagerService.class);
  }
  final boolean safeMode=wm.detectSafeMode();
  if (safeMode) {
    mActivityManagerService.enterSafeMode();
    VMRuntime.getRuntime().disableJitCompilation();
  }
 else {
    VMRuntime.getRuntime().startJitCompilation();
  }
  mmsService=mSystemServiceManager.startService(MmsServiceBroker.class);
  try {
    vibrator.systemReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  if (lockSettings != null) {
    try {
      lockSettings.systemReady();
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
  }
  mSystemServiceManager.startBootPhase(SystemService.PHASE_LOCK_SETTINGS_READY);
  mSystemServiceManager.startBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY);
  try {
    wm.systemReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  if (safeMode) {
    mActivityManagerService.showSafeModeOverlay();
  }
  Configuration config=wm.computeNewConfiguration();
  DisplayMetrics metrics=new DisplayMetrics();
  WindowManager w=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  w.getDefaultDisplay().getMetrics(metrics);
  context.getResources().updateConfiguration(config,metrics);
  try {
    mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    mPackageManagerService.systemReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    mDisplayManagerService.systemReady(safeMode,mOnlyCore);
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  final MountService mountServiceF=mountService;
  final NetworkManagementService networkManagementF=networkManagement;
  final NetworkStatsService networkStatsF=networkStats;
  final NetworkPolicyManagerService networkPolicyF=networkPolicy;
  final ConnectivityService connectivityF=connectivity;
  final NetworkScoreService networkScoreF=networkScore;
  final WallpaperManagerService wallpaperF=wallpaper;
  final InputMethodManagerService immF=imm;
  final RecognitionManagerService recognitionF=recognition;
  final LocationManagerService locationF=location;
  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;
  final TelephonyRegistry telephonyRegistryF=telephonyRegistry;
  final MediaRouterService mediaRouterF=mediaRouter;
  final AudioService audioServiceF=audioService;
  final MmsServiceBroker mmsServiceF=mmsService;
  mActivityManagerService.systemReady(new Runnable(){
    @Override public void run(){
      Slog.i(TAG,"String_Node_Str");
      mSystemServiceManager.startBootPhase(SystemService.PHASE_ACTIVITY_MANAGER_READY);
      try {
        mActivityManagerService.startObservingNativeCrashes();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      Slog.i(TAG,"String_Node_Str");
      WebViewFactory.prepareWebViewInSystemServer();
      try {
        startSystemUi(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (mountServiceF != null)         mountServiceF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkScoreF != null)         networkScoreF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkManagementF != null)         networkManagementF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkStatsF != null)         networkStatsF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkPolicyF != null)         networkPolicyF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (connectivityF != null)         connectivityF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (recognitionF != null)         recognitionF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (audioServiceF != null)         audioServiceF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      Watchdog.getInstance().start();
      mSystemServiceManager.startBootPhase(SystemService.PHASE_THIRD_PARTY_APPS_CAN_START);
      try {
        if (wallpaperF != null)         wallpaperF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (immF != null)         immF.systemRunning(statusBarF);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (locationF != null)         locationF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (countryDetectorF != null)         countryDetectorF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkTimeUpdaterF != null)         networkTimeUpdaterF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (commonTimeMgmtServiceF != null) {
          commonTimeMgmtServiceF.systemRunning();
        }
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (textServiceManagerServiceF != null)         textServiceManagerServiceF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (atlasF != null)         atlasF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (inputManagerF != null)         inputManagerF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (telephonyRegistryF != null)         telephonyRegistryF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (mediaRouterF != null)         mediaRouterF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (mmsServiceF != null)         mmsServiceF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      mSystemServiceManager.startBootPhase(SystemService.PHASE_BOOT_COMPLETE);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Starts a miscellaneous grab bag of stuff that has yet to be refactored and organized.
 */
private void startOtherServices(){
  final Context context=mSystemContext;
  AccountManagerService accountManager=null;
  ContentService contentService=null;
  VibratorService vibrator=null;
  IAlarmManager alarm=null;
  MountService mountService=null;
  NetworkManagementService networkManagement=null;
  NetworkStatsService networkStats=null;
  NetworkPolicyManagerService networkPolicy=null;
  ConnectivityService connectivity=null;
  NetworkScoreService networkScore=null;
  NsdService serviceDiscovery=null;
  WindowManagerService wm=null;
  BluetoothManagerService bluetooth=null;
  UsbService usb=null;
  SerialService serial=null;
  NetworkTimeUpdateService networkTimeUpdater=null;
  CommonTimeManagementService commonTimeMgmtService=null;
  InputManagerService inputManager=null;
  TelephonyRegistry telephonyRegistry=null;
  ConsumerIrService consumerIr=null;
  AudioService audioService=null;
  MmsServiceBroker mmsService=null;
  boolean disableStorage=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableMedia=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableBluetooth=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableTelephony=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableLocation=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableSystemUI=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableNonCoreServices=SystemProperties.getBoolean("String_Node_Str",false);
  boolean disableNetwork=SystemProperties.getBoolean("String_Node_Str",false);
  boolean isEmulator=SystemProperties.get("String_Node_Str").equals("String_Node_Str");
  try {
    Slog.i(TAG,"String_Node_Str");
    SystemConfig.getInstance();
    Slog.i(TAG,"String_Node_Str");
    ServiceManager.addService("String_Node_Str",new SchedulingPolicyService());
    Slog.i(TAG,"String_Node_Str");
    telephonyRegistry=new TelephonyRegistry(context);
    ServiceManager.addService("String_Node_Str",telephonyRegistry);
    Slog.i(TAG,"String_Node_Str");
    ServiceManager.addService("String_Node_Str",new EntropyMixer(context));
    mContentResolver=context.getContentResolver();
    try {
      Slog.i(TAG,"String_Node_Str");
      accountManager=new AccountManagerService(context);
      ServiceManager.addService(Context.ACCOUNT_SERVICE,accountManager);
    }
 catch (    Throwable e) {
      Slog.e(TAG,"String_Node_Str",e);
    }
    Slog.i(TAG,"String_Node_Str");
    contentService=ContentService.main(context,mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL);
    Slog.i(TAG,"String_Node_Str");
    mActivityManagerService.installSystemProviders();
    Slog.i(TAG,"String_Node_Str");
    vibrator=new VibratorService(context);
    ServiceManager.addService("String_Node_Str",vibrator);
    Slog.i(TAG,"String_Node_Str");
    consumerIr=new ConsumerIrService(context);
    ServiceManager.addService(Context.CONSUMER_IR_SERVICE,consumerIr);
    mSystemServiceManager.startService(AlarmManagerService.class);
    alarm=IAlarmManager.Stub.asInterface(ServiceManager.getService(Context.ALARM_SERVICE));
    Slog.i(TAG,"String_Node_Str");
    final Watchdog watchdog=Watchdog.getInstance();
    watchdog.init(context,mActivityManagerService);
    Slog.i(TAG,"String_Node_Str");
    inputManager=new InputManagerService(context);
    Slog.i(TAG,"String_Node_Str");
    wm=WindowManagerService.main(context,inputManager,mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL,!mFirstBoot,mOnlyCore);
    ServiceManager.addService(Context.WINDOW_SERVICE,wm);
    ServiceManager.addService(Context.INPUT_SERVICE,inputManager);
    mActivityManagerService.setWindowManager(wm);
    inputManager.setWindowManagerCallbacks(wm.getInputMonitor());
    inputManager.start();
    mDisplayManagerService.windowManagerAndInputReady();
    if (isEmulator) {
      Slog.i(TAG,"String_Node_Str");
    }
 else     if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) {
      Slog.i(TAG,"String_Node_Str");
    }
 else     if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
      Slog.i(TAG,"String_Node_Str");
    }
 else     if (disableBluetooth) {
      Slog.i(TAG,"String_Node_Str");
    }
 else {
      Slog.i(TAG,"String_Node_Str");
      bluetooth=new BluetoothManagerService(context);
      ServiceManager.addService(BluetoothAdapter.BLUETOOTH_MANAGER_SERVICE,bluetooth);
    }
  }
 catch (  RuntimeException e) {
    Slog.e("String_Node_Str","String_Node_Str");
    Slog.e("String_Node_Str","String_Node_Str",e);
  }
  StatusBarManagerService statusBar=null;
  INotificationManager notification=null;
  InputMethodManagerService imm=null;
  WallpaperManagerService wallpaper=null;
  LocationManagerService location=null;
  CountryDetectorService countryDetector=null;
  TextServicesManagerService tsms=null;
  LockSettingsService lockSettings=null;
  AssetAtlasService atlas=null;
  MediaRouterService mediaRouter=null;
  if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
    if (true) {
      try {
        Slog.i(TAG,"String_Node_Str");
        imm=new InputMethodManagerService(context,wm);
        ServiceManager.addService(Context.INPUT_METHOD_SERVICE,imm);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.ACCESSIBILITY_SERVICE,new AccessibilityManagerService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
  }
  try {
    wm.displayReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    mPackageManagerService.performBootDexOpt();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    ActivityManagerNative.getDefault().showBootMessage(context.getResources().getText(com.android.internal.R.string.android_upgrading_starting_apps),false);
  }
 catch (  RemoteException e) {
  }
  if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
    if (!disableStorage && !"String_Node_Str".equals(SystemProperties.get("String_Node_Str"))) {
      try {
        Slog.i(TAG,"String_Node_Str");
        mountService=new MountService(context);
        ServiceManager.addService("String_Node_Str",mountService);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        lockSettings=new LockSettingsService(context);
        ServiceManager.addService("String_Node_Str",lockSettings);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("String_Node_Str")) {
        mSystemServiceManager.startService(PersistentDataBlockService.class);
      }
      mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
    }
    if (!disableSystemUI) {
      try {
        Slog.i(TAG,"String_Node_Str");
        statusBar=new StatusBarManagerService(context,wm);
        ServiceManager.addService(Context.STATUS_BAR_SERVICE,statusBar);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.CLIPBOARD_SERVICE,new ClipboardService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        networkManagement=NetworkManagementService.create(context);
        ServiceManager.addService(Context.NETWORKMANAGEMENT_SERVICE,networkManagement);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        tsms=new TextServicesManagerService(context);
        ServiceManager.addService(Context.TEXT_SERVICES_MANAGER_SERVICE,tsms);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        networkScore=new NetworkScoreService(context);
        ServiceManager.addService(Context.NETWORK_SCORE_SERVICE,networkScore);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        networkStats=new NetworkStatsService(context,networkManagement,alarm);
        ServiceManager.addService(Context.NETWORK_STATS_SERVICE,networkStats);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        networkPolicy=new NetworkPolicyManagerService(context,mActivityManagerService,(IPowerManager)ServiceManager.getService(Context.POWER_SERVICE),networkStats,networkManagement);
        ServiceManager.addService(Context.NETWORK_POLICY_SERVICE,networkPolicy);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      mSystemServiceManager.startService(WIFI_P2P_SERVICE_CLASS);
      mSystemServiceManager.startService(WIFI_PASSPOINT_SERVICE_CLASS);
      mSystemServiceManager.startService(WIFI_SERVICE_CLASS);
      mSystemServiceManager.startService("String_Node_Str");
      mSystemServiceManager.startService("String_Node_Str");
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_ETHERNET)) {
        mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        connectivity=new ConnectivityService(context,networkManagement,networkStats,networkPolicy);
        ServiceManager.addService(Context.CONNECTIVITY_SERVICE,connectivity);
        networkStats.bindConnectivityManager(connectivity);
        networkPolicy.bindConnectivityManager(connectivity);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        serviceDiscovery=NsdService.create(context);
        ServiceManager.addService(Context.NSD_SERVICE,serviceDiscovery);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.UPDATE_LOCK_SERVICE,new UpdateLockService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (mountService != null && !mOnlyCore) {
      mountService.waitForAsecScan();
    }
    try {
      if (accountManager != null)       accountManager.systemReady();
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    try {
      if (contentService != null)       contentService.systemReady();
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    mSystemServiceManager.startService(NotificationManagerService.class);
    notification=INotificationManager.Stub.asInterface(ServiceManager.getService(Context.NOTIFICATION_SERVICE));
    networkPolicy.bindNotificationManager(notification);
    mSystemServiceManager.startService(DeviceStorageMonitorService.class);
    if (!disableLocation) {
      try {
        Slog.i(TAG,"String_Node_Str");
        location=new LocationManagerService(context);
        ServiceManager.addService(Context.LOCATION_SERVICE,location);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        countryDetector=new CountryDetectorService(context);
        ServiceManager.addService(Context.COUNTRY_DETECTOR,countryDetector);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        ServiceManager.addService(Context.SEARCH_SERVICE,new SearchManagerService(context));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    try {
      Slog.i(TAG,"String_Node_Str");
      ServiceManager.addService(Context.DROPBOX_SERVICE,new DropBoxManagerService(context,new File("String_Node_Str")));
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    if (!disableNonCoreServices && context.getResources().getBoolean(R.bool.config_enableWallpaperService)) {
      try {
        Slog.i(TAG,"String_Node_Str");
        wallpaper=new WallpaperManagerService(context);
        ServiceManager.addService(Context.WALLPAPER_SERVICE,wallpaper);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableMedia && !"String_Node_Str".equals(SystemProperties.get("String_Node_Str"))) {
      try {
        Slog.i(TAG,"String_Node_Str");
        audioService=new AudioService(context);
        ServiceManager.addService(Context.AUDIO_SERVICE,audioService);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      mSystemServiceManager.startService(DockObserver.class);
    }
    if (!disableMedia) {
      try {
        Slog.i(TAG,"String_Node_Str");
        inputManager.setWiredAccessoryCallbacks(new WiredAccessoryManager(context,inputManager));
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) || mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_ACCESSORY)) {
        mSystemServiceManager.startService(USB_SERVICE_CLASS);
      }
      try {
        Slog.i(TAG,"String_Node_Str");
        serial=new SerialService(context);
        ServiceManager.addService(Context.SERIAL_SERVICE,serial);
      }
 catch (      Throwable e) {
        Slog.e(TAG,"String_Node_Str",e);
      }
    }
    mSystemServiceManager.startService(TwilightService.class);
    mSystemServiceManager.startService(UiModeManagerService.class);
    mSystemServiceManager.startService(JobSchedulerService.class);
    if (!disableNonCoreServices) {
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_BACKUP)) {
        mSystemServiceManager.startService(BACKUP_MANAGER_SERVICE_CLASS);
      }
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_APP_WIDGETS)) {
        mSystemServiceManager.startService(APPWIDGET_SERVICE_CLASS);
      }
      if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_VOICE_RECOGNIZERS)) {
        mSystemServiceManager.startService(VOICE_RECOGNITION_MANAGER_SERVICE_CLASS);
      }
    }
    try {
      Slog.i(TAG,"String_Node_Str");
      ServiceManager.addService("String_Node_Str",new DiskStatsService(context));
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    try {
      Slog.i(TAG,"String_Node_Str");
      ServiceManager.addService("String_Node_Str",new SamplingProfilerService(context));
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        networkTimeUpdater=new NetworkTimeUpdateService(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableMedia) {
      try {
        Slog.i(TAG,"String_Node_Str");
        commonTimeMgmtService=new CommonTimeManagementService(context);
        ServiceManager.addService("String_Node_Str",commonTimeMgmtService);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNetwork) {
      try {
        Slog.i(TAG,"String_Node_Str");
        CertBlacklister blacklister=new CertBlacklister(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (!disableNonCoreServices) {
      mSystemServiceManager.startService(DreamManagerService.class);
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        atlas=new AssetAtlasService(context);
        ServiceManager.addService(AssetAtlasService.ASSET_ATLAS_SERVICE,atlas);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_PRINTING)) {
      mSystemServiceManager.startService(PRINT_MANAGER_SERVICE_CLASS);
    }
    mSystemServiceManager.startService(RestrictionsManagerService.class);
    mSystemServiceManager.startService(MediaSessionService.class);
    if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_HDMI_CEC)) {
      mSystemServiceManager.startService(HdmiControlService.class);
    }
    if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
      mSystemServiceManager.startService(TvInputManagerService.class);
    }
    if (!disableNonCoreServices) {
      try {
        Slog.i(TAG,"String_Node_Str");
        mediaRouter=new MediaRouterService(context);
        ServiceManager.addService(Context.MEDIA_ROUTER_SERVICE,mediaRouter);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      mSystemServiceManager.startService(TrustManagerService.class);
      mSystemServiceManager.startService(FingerprintService.class);
      try {
        Slog.i(TAG,"String_Node_Str");
        BackgroundDexOptService.schedule(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
    }
    mSystemServiceManager.startService(LauncherAppsService.class);
  }
  if (!disableNonCoreServices) {
    mSystemServiceManager.startService(MediaProjectionManagerService.class);
  }
  final boolean safeMode=wm.detectSafeMode();
  if (safeMode) {
    mActivityManagerService.enterSafeMode();
    VMRuntime.getRuntime().disableJitCompilation();
  }
 else {
    VMRuntime.getRuntime().startJitCompilation();
  }
  mmsService=mSystemServiceManager.startService(MmsServiceBroker.class);
  try {
    vibrator.systemReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  if (lockSettings != null) {
    try {
      lockSettings.systemReady();
    }
 catch (    Throwable e) {
      reportWtf("String_Node_Str",e);
    }
  }
  mSystemServiceManager.startBootPhase(SystemService.PHASE_LOCK_SETTINGS_READY);
  mSystemServiceManager.startBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY);
  try {
    wm.systemReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  if (safeMode) {
    mActivityManagerService.showSafeModeOverlay();
  }
  Configuration config=wm.computeNewConfiguration();
  DisplayMetrics metrics=new DisplayMetrics();
  WindowManager w=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  w.getDefaultDisplay().getMetrics(metrics);
  context.getResources().updateConfiguration(config,metrics);
  try {
    mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    mPackageManagerService.systemReady();
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  try {
    mDisplayManagerService.systemReady(safeMode,mOnlyCore);
  }
 catch (  Throwable e) {
    reportWtf("String_Node_Str",e);
  }
  final MountService mountServiceF=mountService;
  final NetworkManagementService networkManagementF=networkManagement;
  final NetworkStatsService networkStatsF=networkStats;
  final NetworkPolicyManagerService networkPolicyF=networkPolicy;
  final ConnectivityService connectivityF=connectivity;
  final NetworkScoreService networkScoreF=networkScore;
  final WallpaperManagerService wallpaperF=wallpaper;
  final InputMethodManagerService immF=imm;
  final LocationManagerService locationF=location;
  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;
  final TelephonyRegistry telephonyRegistryF=telephonyRegistry;
  final MediaRouterService mediaRouterF=mediaRouter;
  final AudioService audioServiceF=audioService;
  final MmsServiceBroker mmsServiceF=mmsService;
  mActivityManagerService.systemReady(new Runnable(){
    @Override public void run(){
      Slog.i(TAG,"String_Node_Str");
      mSystemServiceManager.startBootPhase(SystemService.PHASE_ACTIVITY_MANAGER_READY);
      try {
        mActivityManagerService.startObservingNativeCrashes();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      Slog.i(TAG,"String_Node_Str");
      WebViewFactory.prepareWebViewInSystemServer();
      try {
        startSystemUi(context);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (mountServiceF != null)         mountServiceF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkScoreF != null)         networkScoreF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkManagementF != null)         networkManagementF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkStatsF != null)         networkStatsF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkPolicyF != null)         networkPolicyF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (connectivityF != null)         connectivityF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (audioServiceF != null)         audioServiceF.systemReady();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      Watchdog.getInstance().start();
      mSystemServiceManager.startBootPhase(SystemService.PHASE_THIRD_PARTY_APPS_CAN_START);
      try {
        if (wallpaperF != null)         wallpaperF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (immF != null)         immF.systemRunning(statusBarF);
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (locationF != null)         locationF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (countryDetectorF != null)         countryDetectorF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (networkTimeUpdaterF != null)         networkTimeUpdaterF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (commonTimeMgmtServiceF != null) {
          commonTimeMgmtServiceF.systemRunning();
        }
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (textServiceManagerServiceF != null)         textServiceManagerServiceF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (atlasF != null)         atlasF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (inputManagerF != null)         inputManagerF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (telephonyRegistryF != null)         telephonyRegistryF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (mediaRouterF != null)         mediaRouterF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      try {
        if (mmsServiceF != null)         mmsServiceF.systemRunning();
      }
 catch (      Throwable e) {
        reportWtf("String_Node_Str",e);
      }
      mSystemServiceManager.startBootPhase(SystemService.PHASE_BOOT_COMPLETE);
    }
  }
);
}