Use ART Service to clear app profiles when it is enabled.

Changed system server initialization order: ArtManagerLocal needs to be
initialized before mPackageManagerService.systemReady() is called,
because that calls CarrierAppUtils.disableCarrierAppsUntilPrivileged,
which may call ApplicationPackageManager.setSystemAppState to set
SYSTEM_APP_STATE_UNINSTALLED, which ends up calling ArtManagerLocal to
clean up any app profiles.

Test: Boot with dalvik.vm.useartservice=true and verify that calls to
      clearAppProfilesLIF and destroyAppProfilesLeafLIF during boot
      are handled by ART Service.
Bug: 251903639
Change-Id: I8a3a16ce85f315a28fa8459325470cfe5f32ca8c
This commit is contained in:
Martin Stjernholm
2023-01-14 00:51:19 +00:00
parent 08d7443428
commit b1a79007d1
2 changed files with 35 additions and 16 deletions

View File

@@ -2736,6 +2736,10 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(PermissionPolicyService.class);
t.traceEnd();
t.traceBegin("ArtManagerLocal");
DexOptHelper.initializeArtManagerLocal(context, mPackageManagerService);
t.traceEnd();
t.traceBegin("MakePackageManagerServiceReady");
mPackageManagerService.systemReady();
t.traceEnd();
@@ -2770,10 +2774,6 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(GAME_MANAGER_SERVICE_CLASS);
t.traceEnd();
t.traceBegin("ArtManagerLocal");
DexOptHelper.initializeArtManagerLocal(context, mPackageManagerService);
t.traceEnd();
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_UWB)) {
t.traceBegin("UwbService");
mSystemServiceManager.startServiceFromJar(UWB_SERVICE_CLASS, UWB_APEX_SERVICE_JAR_PATH);