SystemServer: Add support for disabling AudioService and MountService

Using the same convention in system_init.cpp, you can disable these
services by setting system properties:

	system_init.startaudioservice=0
	system_init.startmountservice=0

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2011-08-17 15:58:52 -07:00
committed by Mike Lockwood
parent a21e945502
commit cba928cef7
2 changed files with 21 additions and 14 deletions

View File

@ -401,15 +401,17 @@ class ServerThread extends Thread {
reportWtf("starting ThrottleService", e);
}
try {
/*
* NotificationManagerService is dependant on MountService,
* (for media / usb notifications) so we must start MountService first.
*/
Slog.i(TAG, "Mount Service");
ServiceManager.addService("mount", new MountService(context));
} catch (Throwable e) {
reportWtf("starting Mount Service", e);
if (!"0".equals(SystemProperties.get("system_init.startmountservice"))) {
try {
/*
* NotificationManagerService is dependant on MountService,
* (for media / usb notifications) so we must start MountService first.
*/
Slog.i(TAG, "Mount Service");
ServiceManager.addService("mount", new MountService(context));
} catch (Throwable e) {
reportWtf("starting Mount Service", e);
}
}
try {
@ -471,11 +473,13 @@ class ServerThread extends Thread {
reportWtf("starting Wallpaper Service", e);
}
try {
Slog.i(TAG, "Audio Service");
ServiceManager.addService(Context.AUDIO_SERVICE, new AudioService(context));
} catch (Throwable e) {
reportWtf("starting Audio Service", e);
if (!"0".equals(SystemProperties.get("system_init.startaudioservice"))) {
try {
Slog.i(TAG, "Audio Service");
ServiceManager.addService(Context.AUDIO_SERVICE, new AudioService(context));
} catch (Throwable e) {
reportWtf("starting Audio Service", e);
}
}
try {