Handle device config service(s) in platform and mainline

Test: manual

Bug: 261723346

Change-Id: Ie3b61d2dc8ddf6b6b83261d3a5f84c46aecd785d
This commit is contained in:
Pedro Loureiro
2022-12-09 21:20:23 +00:00
parent 27c37b94bf
commit 75960f771b
2 changed files with 12 additions and 1 deletions

View File

@@ -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);

View File

@@ -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();