Loading services/core/java/com/android/server/pm/BackgroundDexOptService.java +4 −3 Original line number Diff line number Diff line Loading @@ -189,13 +189,14 @@ public final class BackgroundDexOptService { void onPackagesUpdated(ArraySet<String> updatedPackages); } public BackgroundDexOptService( Context context, DexManager dexManager, PackageManagerService pm) { public BackgroundDexOptService(Context context, DexManager dexManager, PackageManagerService pm) throws LegacyDexoptDisabledException { this(new Injector(context, dexManager, pm)); } @VisibleForTesting public BackgroundDexOptService(Injector injector) { public BackgroundDexOptService(Injector injector) throws LegacyDexoptDisabledException { Installer.checkLegacyDexoptDisabled(); mInjector = injector; mDexOptHelper = mInjector.getDexOptHelper(); LocalServices.addService(BackgroundDexOptService.class, this); Loading services/core/java/com/android/server/pm/DexOptHelper.java +2 −0 Original line number Diff line number Diff line Loading @@ -996,6 +996,8 @@ public final class DexOptHelper { artManager.addDexoptDoneCallback(false /* onlyIncludeUpdates */, Runnable::run, new DexoptDoneHandler(Objects.requireNonNull(pm))); LocalManagerRegistry.addManager(ArtManagerLocal.class, artManager); artManager.scheduleBackgroundDexoptJob(); } /** Loading services/core/java/com/android/server/pm/PackageManagerService.java +21 −7 Original line number Diff line number Diff line Loading @@ -789,8 +789,10 @@ public class PackageManagerService implements PackageSender, TestUtilityService final ArtManagerService mArtManagerService; // TODO(b/260124949): Remove these. final PackageDexOptimizer mPackageDexOptimizer; final BackgroundDexOptService mBackgroundDexOptService; @Nullable final BackgroundDexOptService mBackgroundDexOptService; // null when ART Service is in use. // DexManager handles the usage of dex files (e.g. secondary files, whether or not a package // is used by other apps). private final DexManager mDexManager; Loading Loading @@ -1567,7 +1569,16 @@ public class PackageManagerService implements PackageSender, TestUtilityService new DefaultSystemWrapper(), LocalServices::getService, context::getSystemService, (i, pm) -> new BackgroundDexOptService(i.getContext(), i.getDexManager(), pm), (i, pm) -> { if (useArtService()) { return null; } try { return new BackgroundDexOptService(i.getContext(), i.getDexManager(), pm); } catch (LegacyDexoptDisabledException e) { throw new RuntimeException(e); } }, (i, pm) -> IBackupManager.Stub.asInterface(ServiceManager.getService( Context.BACKUP_SERVICE)), (i, pm) -> new SharedLibrariesImpl(pm, i), Loading Loading @@ -4287,12 +4298,15 @@ public class PackageManagerService implements PackageSender, TestUtilityService } }); // TODO(b/251903639): Call into ART Service. if (!useArtService()) { // The background dexopt job is scheduled in DexOptHelper.initializeArtManagerLocal when // ART Service is in use. try { mBackgroundDexOptService.systemReady(); } catch (LegacyDexoptDisabledException e) { throw new RuntimeException(e); } } // Prune unused static shared libraries which have been cached a period of time schedulePruneUnusedStaticSharedLibraries(false /* delay */); Loading services/core/java/com/android/server/pm/PackageManagerServiceInjector.java +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.pm; import android.annotation.Nullable; import android.app.ActivityManagerInternal; import android.app.backup.IBackupManager; import android.content.ComponentName; Loading Loading @@ -138,7 +139,8 @@ public class PackageManagerServiceInjector { private final Singleton<DomainVerificationManagerInternal> mDomainVerificationManagerInternalProducer; private final Singleton<Handler> mHandlerProducer; private final Singleton<BackgroundDexOptService> mBackgroundDexOptService; private final Singleton<BackgroundDexOptService> mBackgroundDexOptService; // TODO(b/260124949): Remove this. private final Singleton<IBackupManager> mIBackupManager; private final Singleton<SharedLibrariesImpl> mSharedLibrariesProducer; private final Singleton<CrossProfileIntentFilterHelper> mCrossProfileIntentFilterHelperProducer; Loading Loading @@ -408,6 +410,7 @@ public class PackageManagerServiceInjector { return getLocalService(ActivityManagerInternal.class); } @Nullable public BackgroundDexOptService getBackgroundDexOptService() { return mBackgroundDexOptService.get(this, mPackageManager); } Loading services/core/java/com/android/server/pm/PackageManagerServiceTestParams.java +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ public final class PackageManagerServiceTestParams { public boolean isEngBuild; public boolean isUserDebugBuild; public int sdkInt = Build.VERSION.SDK_INT; public BackgroundDexOptService backgroundDexOptService; public @Nullable BackgroundDexOptService backgroundDexOptService; public final String incrementalVersion = Build.VERSION.INCREMENTAL; public BroadcastHelper broadcastHelper; public AppDataHelper appDataHelper; Loading Loading
services/core/java/com/android/server/pm/BackgroundDexOptService.java +4 −3 Original line number Diff line number Diff line Loading @@ -189,13 +189,14 @@ public final class BackgroundDexOptService { void onPackagesUpdated(ArraySet<String> updatedPackages); } public BackgroundDexOptService( Context context, DexManager dexManager, PackageManagerService pm) { public BackgroundDexOptService(Context context, DexManager dexManager, PackageManagerService pm) throws LegacyDexoptDisabledException { this(new Injector(context, dexManager, pm)); } @VisibleForTesting public BackgroundDexOptService(Injector injector) { public BackgroundDexOptService(Injector injector) throws LegacyDexoptDisabledException { Installer.checkLegacyDexoptDisabled(); mInjector = injector; mDexOptHelper = mInjector.getDexOptHelper(); LocalServices.addService(BackgroundDexOptService.class, this); Loading
services/core/java/com/android/server/pm/DexOptHelper.java +2 −0 Original line number Diff line number Diff line Loading @@ -996,6 +996,8 @@ public final class DexOptHelper { artManager.addDexoptDoneCallback(false /* onlyIncludeUpdates */, Runnable::run, new DexoptDoneHandler(Objects.requireNonNull(pm))); LocalManagerRegistry.addManager(ArtManagerLocal.class, artManager); artManager.scheduleBackgroundDexoptJob(); } /** Loading
services/core/java/com/android/server/pm/PackageManagerService.java +21 −7 Original line number Diff line number Diff line Loading @@ -789,8 +789,10 @@ public class PackageManagerService implements PackageSender, TestUtilityService final ArtManagerService mArtManagerService; // TODO(b/260124949): Remove these. final PackageDexOptimizer mPackageDexOptimizer; final BackgroundDexOptService mBackgroundDexOptService; @Nullable final BackgroundDexOptService mBackgroundDexOptService; // null when ART Service is in use. // DexManager handles the usage of dex files (e.g. secondary files, whether or not a package // is used by other apps). private final DexManager mDexManager; Loading Loading @@ -1567,7 +1569,16 @@ public class PackageManagerService implements PackageSender, TestUtilityService new DefaultSystemWrapper(), LocalServices::getService, context::getSystemService, (i, pm) -> new BackgroundDexOptService(i.getContext(), i.getDexManager(), pm), (i, pm) -> { if (useArtService()) { return null; } try { return new BackgroundDexOptService(i.getContext(), i.getDexManager(), pm); } catch (LegacyDexoptDisabledException e) { throw new RuntimeException(e); } }, (i, pm) -> IBackupManager.Stub.asInterface(ServiceManager.getService( Context.BACKUP_SERVICE)), (i, pm) -> new SharedLibrariesImpl(pm, i), Loading Loading @@ -4287,12 +4298,15 @@ public class PackageManagerService implements PackageSender, TestUtilityService } }); // TODO(b/251903639): Call into ART Service. if (!useArtService()) { // The background dexopt job is scheduled in DexOptHelper.initializeArtManagerLocal when // ART Service is in use. try { mBackgroundDexOptService.systemReady(); } catch (LegacyDexoptDisabledException e) { throw new RuntimeException(e); } } // Prune unused static shared libraries which have been cached a period of time schedulePruneUnusedStaticSharedLibraries(false /* delay */); Loading
services/core/java/com/android/server/pm/PackageManagerServiceInjector.java +4 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.pm; import android.annotation.Nullable; import android.app.ActivityManagerInternal; import android.app.backup.IBackupManager; import android.content.ComponentName; Loading Loading @@ -138,7 +139,8 @@ public class PackageManagerServiceInjector { private final Singleton<DomainVerificationManagerInternal> mDomainVerificationManagerInternalProducer; private final Singleton<Handler> mHandlerProducer; private final Singleton<BackgroundDexOptService> mBackgroundDexOptService; private final Singleton<BackgroundDexOptService> mBackgroundDexOptService; // TODO(b/260124949): Remove this. private final Singleton<IBackupManager> mIBackupManager; private final Singleton<SharedLibrariesImpl> mSharedLibrariesProducer; private final Singleton<CrossProfileIntentFilterHelper> mCrossProfileIntentFilterHelperProducer; Loading Loading @@ -408,6 +410,7 @@ public class PackageManagerServiceInjector { return getLocalService(ActivityManagerInternal.class); } @Nullable public BackgroundDexOptService getBackgroundDexOptService() { return mBackgroundDexOptService.get(this, mPackageManager); } Loading
services/core/java/com/android/server/pm/PackageManagerServiceTestParams.java +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ public final class PackageManagerServiceTestParams { public boolean isEngBuild; public boolean isUserDebugBuild; public int sdkInt = Build.VERSION.SDK_INT; public BackgroundDexOptService backgroundDexOptService; public @Nullable BackgroundDexOptService backgroundDexOptService; public final String incrementalVersion = Build.VERSION.INCREMENTAL; public BroadcastHelper broadcastHelper; public AppDataHelper appDataHelper; Loading