Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cba928ce authored by Mike Lockwood's avatar Mike Lockwood Committed by Mike Lockwood
Browse files

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: default avatarMike Lockwood <lockwood@android.com>
parent a21e9455
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.os.storage;

import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -534,6 +535,7 @@ public class StorageManager
     * @hide
     */
    public String getVolumeState(String mountPoint) {
         if (mMountService == null) return Environment.MEDIA_REMOVED;
        try {
            return mMountService.getVolumeState(mountPoint);
        } catch (RemoteException e) {
@@ -547,6 +549,7 @@ public class StorageManager
     * @hide
     */
    public StorageVolume[] getVolumeList() {
        if (mMountService == null) return new StorageVolume[0];
        try {
            Parcelable[] list = mMountService.getVolumeList();
            if (list == null) return new StorageVolume[0];
+18 −14
Original line number Diff line number Diff line
@@ -401,6 +401,7 @@ class ServerThread extends Thread {
                reportWtf("starting ThrottleService", e);
            }

            if (!"0".equals(SystemProperties.get("system_init.startmountservice"))) {
                try {
                    /*
                     * NotificationManagerService is dependant on MountService,
@@ -411,6 +412,7 @@ class ServerThread extends Thread {
                } catch (Throwable e) {
                    reportWtf("starting Mount Service", e);
                }
            }

            try {
                Slog.i(TAG, "Notification Manager");
@@ -471,12 +473,14 @@ class ServerThread extends Thread {
                reportWtf("starting Wallpaper 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 {
                Slog.i(TAG, "Dock Observer");