Use a single interface for reading pre-Q and pre-S role state.

The logic to read the platform XML is moved from RoleUserState. The
logic to read legacy settings is left untouched except refactored to
return the mapping at once.

Bug: 158736025
Test: presubmit
Change-Id: Ifd1770bf869ea77b2f8a4ff8b3eae46a46cc90cf
This commit is contained in:
Hai Zhang
2021-01-13 02:21:10 -08:00
parent ce6238e031
commit ce2a80437d
6 changed files with 329 additions and 326 deletions

View File

@@ -160,7 +160,7 @@ import com.android.server.pm.UserManagerService;
import com.android.server.pm.dex.SystemServerDexLoadReporter;
import com.android.server.policy.PermissionPolicyService;
import com.android.server.policy.PhoneWindowManager;
import com.android.server.policy.role.LegacyRoleResolutionPolicy;
import com.android.server.policy.role.LegacyRoleStateProviderImpl;
import com.android.server.power.PowerManagerService;
import com.android.server.power.ShutdownThread;
import com.android.server.power.ThermalManagerService;
@@ -2021,7 +2021,7 @@ public final class SystemServer implements Dumpable {
// Grants default permissions and defines roles
t.traceBegin("StartRoleManagerService");
mSystemServiceManager.startService(new RoleManagerService(
mSystemContext, new LegacyRoleResolutionPolicy(mSystemContext)));
mSystemContext, new LegacyRoleStateProviderImpl(mSystemContext)));
t.traceEnd();
// We need to always start this service, regardless of whether the