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

Commit daca7ce5 authored by Narayan Kamath's avatar Narayan Kamath Committed by Android (Google) Code Review
Browse files

Merge "SystemServer: Get rid of some unused config.* knobs."

parents 0978e7f5 1c888f6d
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -836,7 +836,6 @@ public class Environment {
     *         physically removed.
     */
    public static boolean isExternalStorageRemovable() {
        if (isStorageDisabled()) return false;
        final File externalDir = sCurrentUser.getExternalDirs()[0];
        return isExternalStorageRemovable(externalDir);
    }
@@ -875,7 +874,6 @@ public class Environment {
     *      boolean)
     */
    public static boolean isExternalStorageEmulated() {
        if (isStorageDisabled()) return false;
        final File externalDir = sCurrentUser.getExternalDirs()[0];
        return isExternalStorageEmulated(externalDir);
    }
@@ -951,9 +949,6 @@ public class Environment {
        return cur;
    }

    private static boolean isStorageDisabled() {
        return SystemProperties.getBoolean("config.disable_storage", false);
    }

    /**
     * If the given path exists on emulated external storage, return the
+0 −4
Original line number Diff line number Diff line
@@ -163,10 +163,6 @@ public final class ContentService extends IContentService.Stub {
    };

    private SyncManager getSyncManager() {
        if (SystemProperties.getBoolean("config.disable_network", false)) {
            return null;
        }

        synchronized(mSyncManagerLock) {
            try {
                // Try to create the SyncManager, return null if it fails (e.g. the disk is full).
+290 −331
Original line number Diff line number Diff line
@@ -545,11 +545,9 @@ public final class SystemServer {
        traceEnd();

        // Bring up recovery system in case a rescue party needs a reboot
        if (!SystemProperties.getBoolean("config.disable_noncore", false)) {
        traceBeginAndSlog("StartRecoverySystemService");
        mSystemServiceManager.startService(RecoverySystemService.class);
        traceEnd();
        }

        // Now that we have the bare essentials of the OS up and running, take
        // note that we just booted, which might send out a rescue party if
@@ -708,13 +706,7 @@ public final class SystemServer {
        MmsServiceBroker mmsService = null;
        HardwarePropertiesManagerService hardwarePropertiesService = null;

        boolean disableStorage = SystemProperties.getBoolean("config.disable_storage", false);
        boolean disableBluetooth = SystemProperties.getBoolean("config.disable_bluetooth", false);
        boolean disableLocation = SystemProperties.getBoolean("config.disable_location", false);
        boolean disableSystemUI = SystemProperties.getBoolean("config.disable_systemui", false);
        boolean disableNonCoreServices = SystemProperties.getBoolean("config.disable_noncore", false);
        boolean disableNetwork = SystemProperties.getBoolean("config.disable_network", false);
        boolean disableNetworkTime = SystemProperties.getBoolean("config.disable_networktime", false);
        boolean disableRtt = SystemProperties.getBoolean("config.disable_rtt", false);
        boolean disableMediaProjection = SystemProperties.getBoolean("config.disable_mediaproj",
                false);
@@ -878,8 +870,6 @@ public final class SystemServer {
            } else if (!context.getPackageManager().hasSystemFeature
                       (PackageManager.FEATURE_BLUETOOTH)) {
                Slog.i(TAG, "No Bluetooth Service (Bluetooth Hardware Not Present)");
            } else if (disableBluetooth) {
                Slog.i(TAG, "Bluetooth Service disabled by config");
            } else {
                traceBeginAndSlog("StartBluetoothService");
                mSystemServiceManager.startService(BluetoothService.class);
@@ -930,8 +920,7 @@ public final class SystemServer {
        traceEnd();

        if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
            if (!disableStorage &&
                    !"0".equals(SystemProperties.get("system_init.startmountservice"))) {
            if (!"0".equals(SystemProperties.get("system_init.startmountservice"))) {
                traceBeginAndSlog("StartStorageManagerService");
                try {
                    /*
@@ -981,7 +970,6 @@ public final class SystemServer {
        traceEnd();

        if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
            if (!disableNonCoreServices) {
            traceBeginAndSlog("StartLockSettingsService");
            try {
                mSystemServiceManager.startService(LOCK_SETTINGS_SERVICE_CLASS);
@@ -1015,7 +1003,6 @@ public final class SystemServer {
            traceBeginAndSlog("StartDevicePolicyManager");
            mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
            traceEnd();
            }

            if (!disableSystemUI) {
                traceBeginAndSlog("StartStatusBarManagerService");
@@ -1028,13 +1015,10 @@ public final class SystemServer {
                traceEnd();
            }

            if (!disableNonCoreServices) {
            traceBeginAndSlog("StartClipboardService");
            mSystemServiceManager.startService(ClipboardService.class);
            traceEnd();
            }

            if (!disableNetwork) {
            traceBeginAndSlog("StartNetworkManagementService");
            try {
                networkManagement = NetworkManagementService.create(context);
@@ -1052,15 +1036,13 @@ public final class SystemServer {
                reportWtf("starting IpSec Service", e);
            }
            traceEnd();
            }

            if (!disableNonCoreServices && !disableTextServices) {
            if (!disableTextServices) {
                traceBeginAndSlog("StartTextServicesManager");
                mSystemServiceManager.startService(TextServicesManagerService.Lifecycle.class);
                traceEnd();
            }

            if (!disableNetwork) {
            traceBeginAndSlog("StartNetworkScoreService");
            try {
                networkScore = new NetworkScoreService(context);
@@ -1163,9 +1145,7 @@ public final class SystemServer {
                reportWtf("starting Service Discovery Service", e);
            }
            traceEnd();
            }

            if (!disableNonCoreServices) {
            traceBeginAndSlog("StartUpdateLockService");
            try {
                ServiceManager.addService(Context.UPDATE_LOCK_SERVICE,
@@ -1174,7 +1154,6 @@ public final class SystemServer {
                reportWtf("starting UpdateLockService", e);
            }
            traceEnd();
            }

            traceBeginAndSlog("StartNotificationManager");
            mSystemServiceManager.startService(NotificationManagerService.class);
@@ -1188,7 +1167,6 @@ public final class SystemServer {
            mSystemServiceManager.startService(DeviceStorageMonitorService.class);
            traceEnd();

            if (!disableLocation) {
            traceBeginAndSlog("StartLocationManagerService");
            try {
                location = new LocationManagerService(context);
@@ -1206,9 +1184,8 @@ public final class SystemServer {
                reportWtf("starting Country Detector", e);
            }
            traceEnd();
            }

            if (!disableNonCoreServices && !disableSearchManager) {
            if (!disableSearchManager) {
                traceBeginAndSlog("StartSearchManagerService");
                try {
                    mSystemServiceManager.startService(SEARCH_MANAGER_SERVICE_CLASS);
@@ -1218,8 +1195,7 @@ public final class SystemServer {
                traceEnd();
            }

            if (!disableNonCoreServices && context.getResources().getBoolean(
                        R.bool.config_enableWallpaperService)) {
            if (context.getResources().getBoolean(R.bool.config_enableWallpaperService)) {
                traceBeginAndSlog("StartWallpaperManagerService");
                mSystemServiceManager.startService(WALLPAPER_SERVICE_CLASS);
                traceEnd();
@@ -1235,7 +1211,6 @@ public final class SystemServer {
                traceEnd();
            }

            if (!disableNonCoreServices) {
            traceBeginAndSlog("StartDockObserver");
            mSystemServiceManager.startService(DockObserver.class);
            traceEnd();
@@ -1245,7 +1220,6 @@ public final class SystemServer {
                mSystemServiceManager.startService(THERMAL_OBSERVER_CLASS);
                traceEnd();
            }
            }

            traceBeginAndSlog("StartWiredAccessoryManager");
            try {
@@ -1257,7 +1231,6 @@ public final class SystemServer {
            }
            traceEnd();

            if (!disableNonCoreServices) {
            if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_MIDI)) {
                // Start MIDI Manager service
                traceBeginAndSlog("StartMidiManager");
@@ -1295,7 +1268,6 @@ public final class SystemServer {
                Slog.e(TAG, "Failure starting HardwarePropertiesManagerService", e);
            }
            traceEnd();
            }

            traceBeginAndSlog("StartTwilightService");
            mSystemServiceManager.startService(TwilightService.class);
@@ -1315,7 +1287,6 @@ public final class SystemServer {
            mSystemServiceManager.startService(SoundTriggerService.class);
            traceEnd();

            if (!disableNonCoreServices) {
            if (!disableTrustManager) {
                traceBeginAndSlog("StartTrustManager");
                mSystemServiceManager.startService(TrustManagerService.class);
@@ -1355,7 +1326,6 @@ public final class SystemServer {
            traceBeginAndSlog("StartContextHubSystemService");
            mSystemServiceManager.startService(ContextHubSystemService.class);
            traceEnd();
            }

            traceBeginAndSlog("StartDiskStatsService");
            try {
@@ -1378,7 +1348,6 @@ public final class SystemServer {
                traceEnd();
            }

            if (!disableNetwork && !disableNetworkTime) {
            traceBeginAndSlog("StartNetworkTimeUpdateService");
            try {
                networkTimeUpdater = new NetworkTimeUpdateService(context);
@@ -1387,7 +1356,6 @@ public final class SystemServer {
                reportWtf("starting NetworkTimeUpdate service", e);
            }
            traceEnd();
            }

            traceBeginAndSlog("StartCommonTimeManagementService");
            try {
@@ -1398,7 +1366,6 @@ public final class SystemServer {
            }
            traceEnd();

            if (!disableNetwork) {
            traceBeginAndSlog("CertBlacklister");
            try {
                CertBlacklister blacklister = new CertBlacklister(context);
@@ -1406,30 +1373,25 @@ public final class SystemServer {
                reportWtf("starting CertBlacklister", e);
            }
            traceEnd();
            }

            if (!disableNetwork && !disableNonCoreServices && EmergencyAffordanceManager.ENABLED) {
            if (EmergencyAffordanceManager.ENABLED) {
                // EmergencyMode service
                traceBeginAndSlog("StartEmergencyAffordanceService");
                mSystemServiceManager.startService(EmergencyAffordanceService.class);
                traceEnd();
            }

            if (!disableNonCoreServices) {
            // Dreams (interactive idle-time views, a/k/a screen savers, and doze mode)
            traceBeginAndSlog("StartDreamManager");
            mSystemServiceManager.startService(DreamManagerService.class);
            traceEnd();
            }

            if (!disableNonCoreServices) {
            traceBeginAndSlog("AddGraphicsStatsService");
            ServiceManager.addService(GraphicsStatsService.GRAPHICS_STATS_SERVICE,
                new GraphicsStatsService(context));
            traceEnd();
            }

            if (!disableNonCoreServices && CoverageService.ENABLED) {
            if (CoverageService.ENABLED) {
                traceBeginAndSlog("AddCoverageService");
                ServiceManager.addService(CoverageService.COVERAGE_SERVICE, new CoverageService());
                traceEnd();
@@ -1480,7 +1442,6 @@ public final class SystemServer {
                traceEnd();
            }

            if (!disableNonCoreServices) {
            traceBeginAndSlog("StartMediaRouterService");
            try {
                mediaRouter = new MediaRouterService(context);
@@ -1511,7 +1472,7 @@ public final class SystemServer {
                reportWtf("StartPruneInstantAppsJobService", e);
            }
            traceEnd();
            }

            // LauncherAppsService uses ShortcutService.
            traceBeginAndSlog("StartShortcutServiceLifecycle");
            mSystemServiceManager.startService(ShortcutService.Lifecycle.class);
@@ -1522,7 +1483,7 @@ public final class SystemServer {
            traceEnd();
        }

        if (!disableNonCoreServices && !disableMediaProjection) {
        if (!disableMediaProjection) {
            traceBeginAndSlog("StartMediaProjectionManager");
            mSystemServiceManager.startService(MediaProjectionManagerService.class);
            traceEnd();
@@ -1533,7 +1494,6 @@ public final class SystemServer {
            mSystemServiceManager.startService(WEAR_CONNECTIVITY_SERVICE_CLASS);
            traceEnd();

            if (!disableNonCoreServices) {
            traceBeginAndSlog("StartWearTimeService");
            mSystemServiceManager.startService(WEAR_DISPLAY_SERVICE_CLASS);
            mSystemServiceManager.startService(WEAR_TIME_SERVICE_CLASS);
@@ -1545,7 +1505,6 @@ public final class SystemServer {
                traceEnd();
            }
        }
        }

        if (!disableCameraService) {
            traceBeginAndSlog("StartCameraServiceProxy");