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

Commit 75960f77 authored by Pedro Loureiro's avatar Pedro Loureiro
Browse files

Handle device config service(s) in platform and mainline

Test: manual

Bug: 261723346

Change-Id: Ie3b61d2dc8ddf6b6b83261d3a5f84c46aecd785d
parent 27c37b94
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ import android.provider.Settings.Config.SyncDisabledMode;
import android.provider.Settings.Global;
import android.provider.Settings.Secure;
import android.provider.Settings.SetAllResult;
import android.provider.UpdatableDeviceConfigServiceReadiness;
import android.provider.settings.validators.SystemSettingsValidators;
import android.provider.settings.validators.Validator;
import android.text.TextUtils;
@@ -416,10 +417,16 @@ public class SettingsProvider extends ContentProvider {
            startWatchingUserRestrictionChanges();
        });
        ServiceManager.addService("settings", new SettingsService(this));
        ServiceManager.addService("device_config", new DeviceConfigService(this));
        addDeviceConfigServiceIfNeeded();
        return true;
    }

    private void addDeviceConfigServiceIfNeeded() {
        if (!UpdatableDeviceConfigServiceReadiness.shouldStartUpdatableService()) {
            ServiceManager.addService("device_config", new DeviceConfigService(this));
        }
    }

    @Override
    public Bundle call(String method, String name, Bundle args) {
        final int requestingUserId = getRequestingUserId(args);
+4 −0
Original line number Diff line number Diff line
@@ -422,6 +422,8 @@ public final class SystemServer implements Dumpable {
            "com.android.server.sdksandbox.SdkSandboxManagerService$Lifecycle";
    private static final String AD_SERVICES_MANAGER_SERVICE_CLASS =
            "com.android.server.adservices.AdServicesManagerService$Lifecycle";
    private static final String UPDATABLE_DEVICE_CONFIG_SERVICE_CLASS =
            "com.android.server.deviceconfig.DeviceConfigInit$Lifecycle";

    private static final String TETHERING_CONNECTOR_CLASS = "android.net.ITetheringConnector";

@@ -1494,6 +1496,8 @@ public final class SystemServer implements Dumpable {

            t.traceBegin("InstallSystemProviders");
            mActivityManagerService.getContentProviderHelper().installSystemProviders();
            // Device configuration used to be part of System providers
            mSystemServiceManager.startService(UPDATABLE_DEVICE_CONFIG_SERVICE_CLASS);
            // Now that SettingsProvider is ready, reactivate SQLiteCompatibilityWalFlags
            SQLiteCompatibilityWalFlags.reset();
            t.traceEnd();