Always add legacy DeviceConfigService to ServiceManager

Now that we are able to handover shell commands from the legacy (i.e.
platform-provided) DeviceConfigService to the mainline-module-provided
service, we always add the legacy service and it can decide to hand over
the command to the mainline service when appropriate.

Bug: 263955152

Test: manual because logic is behind feature flags
Change-Id: I1ef0235e3a262b5cd5cb8b5f6c40fe1fc0202e53
This commit is contained in:
Pedro Loureiro
2023-02-13 11:48:47 +00:00
parent c9ea074e38
commit 6d5536a73c

View File

@@ -96,7 +96,6 @@ 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;
@@ -417,16 +416,10 @@ public class SettingsProvider extends ContentProvider {
startWatchingUserRestrictionChanges();
});
ServiceManager.addService("settings", new SettingsService(this));
addDeviceConfigServiceIfNeeded();
ServiceManager.addService("device_config", new DeviceConfigService(this));
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);