diff options
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 70 |
1 files changed, 13 insertions, 57 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 3146366..5169607 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -25,16 +25,11 @@ import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; -import android.content.IntentFilter; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; -import android.content.pm.ThemeUtils; import android.content.res.Configuration; import android.content.res.Resources.Theme; import android.database.ContentObserver; -import android.database.Cursor; -import android.content.res.ThemeConfig; -import android.database.ContentObserver; import android.os.Build; import android.os.Environment; import android.os.FactoryTest; @@ -47,7 +42,6 @@ import android.os.SystemClock; import android.os.SystemProperties; import android.os.UserHandle; import android.os.storage.IMountService; -import android.provider.Settings; import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Slog; @@ -81,7 +75,6 @@ import com.android.server.net.NetworkStatsService; import com.android.server.notification.NotificationManagerService; import com.android.server.os.SchedulingPolicyService; import com.android.server.pm.BackgroundDexOptService; -import com.android.server.gesture.EdgeGestureService; import com.android.server.pm.Installer; import com.android.server.pm.LauncherAppsService; import com.android.server.pm.PackageManagerService; @@ -462,8 +455,8 @@ public final class SystemServer { boolean disableNetwork = SystemProperties.getBoolean("config.disable_network", false); boolean disableNetworkTime = SystemProperties.getBoolean("config.disable_networktime", false); boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1"); - String[] externalServices = context.getResources() - .getStringArray(com.android.internal.R.array.config_externalCMServices); + String[] externalServices = context.getResources().getStringArray( + org.cyanogenmod.platform.internal.R.array.config_externalCMServices); try { Slog.i(TAG, "Reading configuration..."); @@ -569,8 +562,6 @@ public final class SystemServer { AssetAtlasService atlas = null; MediaRouterService mediaRouter = null; GestureService gestureService = null; - EdgeGestureService edgeGestureService = null; - ThemeService themeService = null; // Bring up services needed for UI. if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) { @@ -854,6 +845,11 @@ public final class SystemServer { if (!disableNonCoreServices) { mSystemServiceManager.startService(DockObserver.class); + + if (context.getPackageManager().hasSystemFeature + (PackageManager.FEATURE_WATCH)) { + mSystemServiceManager.startService(ThermalObserver.class); + } } try { @@ -1003,14 +999,6 @@ public final class SystemServer { mSystemServiceManager.startService(TvInputManagerService.class); } - try { - Slog.i(TAG, "Theme Service"); - themeService = new ThemeService(context); - ServiceManager.addService(Context.THEME_SERVICE, themeService); - } catch (Throwable e) { - reportWtf("starting Theme Service", e); - } - if (!disableNonCoreServices) { try { Slog.i(TAG, "Media Router Service"); @@ -1034,14 +1022,6 @@ public final class SystemServer { } mSystemServiceManager.startService(LauncherAppsService.class); - - try { - Slog.i(TAG, "EdgeGesture service"); - edgeGestureService = new EdgeGestureService(context, inputManager); - ServiceManager.addService("edgegestureservice", edgeGestureService); - } catch (Throwable e) { - Slog.e(TAG, "Failure starting EdgeGesture service", e); - } } if (!disableNonCoreServices) { @@ -1121,6 +1101,12 @@ public final class SystemServer { w.getDefaultDisplay().getMetrics(metrics); context.getResources().updateConfiguration(config, metrics); + // The system context's theme may be configuration-dependent. + final Theme systemTheme = context.getTheme(); + if (systemTheme.getChangingConfigurations() != 0) { + systemTheme.rebase(); + } + try { // TODO: use boot phase mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService()); @@ -1141,14 +1127,6 @@ public final class SystemServer { reportWtf("making Display Manager Service ready", e); } - if (edgeGestureService != null) { - try { - edgeGestureService.systemReady(); - } catch (Throwable e) { - reportWtf("making EdgeGesture service ready", e); - } - } - if (gestureService != null) { try { gestureService.systemReady(); @@ -1157,16 +1135,6 @@ public final class SystemServer { } } - IntentFilter filter = new IntentFilter(); - filter.addAction(Intent.ACTION_APP_FAILURE); - filter.addAction(Intent.ACTION_APP_FAILURE_RESET); - filter.addAction(Intent.ACTION_PACKAGE_ADDED); - filter.addAction(Intent.ACTION_PACKAGE_REMOVED); - filter.addAction(ThemeUtils.ACTION_THEME_CHANGED); - filter.addCategory(Intent.CATEGORY_THEME_PACKAGE_INSTALLED_STATE_CHANGE); - filter.addDataScheme("package"); - context.registerReceiver(new AppsFailureReceiver(), filter); - // These are needed to propagate to the runnable below. final NetworkManagementService networkManagementF = networkManagement; final NetworkStatsService networkStatsF = networkStats; @@ -1187,7 +1155,6 @@ public final class SystemServer { final MediaRouterService mediaRouterF = mediaRouter; final AudioService audioServiceF = audioService; final MmsServiceBroker mmsServiceF = mmsService; - final ThemeService themeServiceF = themeService; // We now tell the activity manager it is okay to run third party // code. It will call back into us once it has gotten to the state @@ -1326,17 +1293,6 @@ public final class SystemServer { } catch (Throwable e) { reportWtf("Notifying MmsService running", e); } - - try { - // now that the system is up, apply default theme if applicable - if (themeServiceF != null) themeServiceF.systemRunning(); - ThemeConfig themeConfig = - ThemeConfig.getBootTheme(context.getContentResolver()); - String iconPkg = themeConfig.getIconPackPkgName(); - mPackageManagerService.updateIconMapping(iconPkg); - } catch (Throwable e) { - reportWtf("Icon Mapping failed", e); - } } }); } |