Refactor dream manager to new pattern.

Change-Id: I99ab4bd98d56a290368dc4b24e5bb24e0656b522
This commit is contained in:
Jeff Brown
2014-01-30 23:38:03 -08:00
parent 474f1fbe8d
commit 567f7ca424
4 changed files with 274 additions and 181 deletions

View File

@ -75,7 +75,6 @@ import com.android.server.power.ShutdownThread;
import com.android.server.search.SearchManagerService;
import com.android.server.statusbar.StatusBarManagerService;
import com.android.server.storage.DeviceStorageMonitorService;
import com.android.server.twilight.TwilightManager;
import com.android.server.twilight.TwilightService;
import com.android.server.usb.UsbService;
import com.android.server.wallpaper.WallpaperManagerService;
@ -307,7 +306,6 @@ public final class SystemServer {
DockObserver dock = null;
UsbService usb = null;
SerialService serial = null;
TwilightManager twilight = null;
RecognitionManagerService recognition = null;
NetworkTimeUpdateService networkTimeUpdater = null;
CommonTimeManagementService commonTimeMgmtService = null;
@ -464,7 +462,6 @@ public final class SystemServer {
CountryDetectorService countryDetector = null;
TextServicesManagerService tsms = null;
LockSettingsService lockSettings = null;
DreamManagerService dreamy = null;
AssetAtlasService atlas = null;
MediaRouterService mediaRouter = null;
@ -783,7 +780,6 @@ public final class SystemServer {
}
mSystemServiceManager.startService(TwilightService.class);
twilight = LocalServices.getService(TwilightManager.class);
mSystemServiceManager.startService(UiModeManagerService.class);
@ -859,16 +855,10 @@ public final class SystemServer {
}
}
if (!disableNonCoreServices &&
context.getResources().getBoolean(R.bool.config_dreamsSupported)) {
try {
Slog.i(TAG, "Dreams Service");
// Dreams (interactive idle-time views, a/k/a screen savers)
dreamy = new DreamManagerService(context);
ServiceManager.addService(DreamService.DREAM_SERVICE, dreamy);
} catch (Throwable e) {
reportWtf("starting DreamManagerService", e);
}
if (!disableNonCoreServices
&& context.getResources().getBoolean(R.bool.config_dreamsSupported)) {
// Dreams (interactive idle-time views, a/k/a screen savers)
mSystemServiceManager.startService(DreamManagerService.class);
}
if (!disableNonCoreServices) {
@ -963,7 +953,7 @@ public final class SystemServer {
try {
// TODO: use boot phase
mPowerManagerService.systemReady(twilight, dreamy);
mPowerManagerService.systemReady();
} catch (Throwable e) {
reportWtf("making Power Manager Service ready", e);
}
@ -1000,7 +990,6 @@ public final class SystemServer {
final CommonTimeManagementService commonTimeMgmtServiceF = commonTimeMgmtService;
final TextServicesManagerService textServiceManagerServiceF = tsms;
final StatusBarManagerService statusBarF = statusBar;
final DreamManagerService dreamyF = dreamy;
final AssetAtlasService atlasF = atlas;
final InputManagerService inputManagerF = inputManager;
final TelephonyRegistry telephonyRegistryF = telephonyRegistry;
@ -1112,11 +1101,6 @@ public final class SystemServer {
} catch (Throwable e) {
reportWtf("Notifying TextServicesManagerService running", e);
}
try {
if (dreamyF != null) dreamyF.systemRunning();
} catch (Throwable e) {
reportWtf("Notifying DreamManagerService running", e);
}
try {
if (atlasF != null) atlasF.systemRunning();
} catch (Throwable e) {