Loading core/java/android/content/pm/PackageInstaller.java +11 −0 Original line number Diff line number Diff line Loading @@ -2797,6 +2797,8 @@ public class PackageInstaller { public int developmentInstallFlags = 0; /** {@hide} */ public int unarchiveId = -1; /** {@hide} */ public @Nullable String dexoptCompilerFilter = null; private final ArrayMap<String, Integer> mPermissionStates; Loading Loading @@ -2850,6 +2852,7 @@ public class PackageInstaller { applicationEnabledSettingPersistent = source.readBoolean(); developmentInstallFlags = source.readInt(); unarchiveId = source.readInt(); dexoptCompilerFilter = source.readString(); } /** {@hide} */ Loading Loading @@ -2885,6 +2888,7 @@ public class PackageInstaller { ret.applicationEnabledSettingPersistent = applicationEnabledSettingPersistent; ret.developmentInstallFlags = developmentInstallFlags; ret.unarchiveId = unarchiveId; ret.dexoptCompilerFilter = dexoptCompilerFilter; return ret; } Loading Loading @@ -3563,6 +3567,11 @@ public class PackageInstaller { this.unarchiveId = unarchiveId; } /** @hide */ public void setDexoptCompilerFilter(@Nullable String dexoptCompilerFilter) { this.dexoptCompilerFilter = dexoptCompilerFilter; } /** @hide */ @NonNull public ArrayMap<String, Integer> getPermissionStates() { Loading Loading @@ -3622,6 +3631,7 @@ public class PackageInstaller { applicationEnabledSettingPersistent); pw.printHexPair("developmentInstallFlags", developmentInstallFlags); pw.printPair("unarchiveId", unarchiveId); pw.printPair("dexoptCompilerFilter", dexoptCompilerFilter); pw.println(); } Loading Loading @@ -3667,6 +3677,7 @@ public class PackageInstaller { dest.writeBoolean(applicationEnabledSettingPersistent); dest.writeInt(developmentInstallFlags); dest.writeInt(unarchiveId); dest.writeString(dexoptCompilerFilter); } public static final Parcelable.Creator<SessionParams> Loading services/core/java/com/android/server/pm/DexOptHelper.java +10 −3 Original line number Diff line number Diff line Loading @@ -728,7 +728,14 @@ public final class DexOptHelper { final int compilationReason = dexManager.getCompilationReasonForInstallScenario( installRequest.getInstallScenario()); return new DexoptOptions(packageName, compilationReason, dexoptFlags); final AndroidPackage pkg = ps.getPkg(); var options = new DexoptOptions(packageName, compilationReason, dexoptFlags); if (installRequest.getDexoptCompilerFilter() != null) { options = options.overrideCompilerFilter(installRequest.getDexoptCompilerFilter()); } else if (pkg != null && pkg.isDebuggable()) { options = options.overrideCompilerFilter(DexoptParams.COMPILER_FILTER_NOOP); } return options; } /** Loading Loading @@ -772,12 +779,12 @@ public final class DexOptHelper { && installRequest.getInstallSource().mInitiatingPackageName.equals("android")) : true; // Don't skip the dexopt call if the compiler filter is "skip". Instead, call dexopt with // the "skip" filter so that ART Service gets notified and skips dexopt itself. return (!instantApp || Global.getInt(context.getContentResolver(), Global.INSTANT_APP_DEXOPT_ENABLED, 0) != 0) && pkg != null && !pkg.isDebuggable() && (!onIncremental) && dexoptOptions.isCompilationEnabled() && !isApex && performDexOptForRollback; } Loading services/core/java/com/android/server/pm/InstallArgs.java +4 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ final class InstallArgs { final int mDataLoaderType; final int mPackageSource; final boolean mApplicationEnabledSettingPersistent; @Nullable final String mDexoptCompilerFilter; // The list of instruction sets supported by this app. This is currently // only used during the rmdex() phase to clean up resources. We can get rid of this Loading @@ -73,7 +75,7 @@ final class InstallArgs { int autoRevokePermissionsMode, String traceMethod, int traceCookie, SigningDetails signingDetails, int installReason, int installScenario, boolean forceQueryableOverride, int dataLoaderType, int packageSource, boolean applicationEnabledSettingPersistent) { boolean applicationEnabledSettingPersistent, String dexoptCompilerFilter) { mOriginInfo = originInfo; mMoveInfo = moveInfo; mInstallFlags = installFlags; Loading @@ -96,5 +98,6 @@ final class InstallArgs { mDataLoaderType = dataLoaderType; mPackageSource = packageSource; mApplicationEnabledSettingPersistent = applicationEnabledSettingPersistent; mDexoptCompilerFilter = dexoptCompilerFilter; } } services/core/java/com/android/server/pm/InstallRequest.java +7 −2 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ final class InstallRequest { params.mTraceMethod, params.mTraceCookie, params.mSigningDetails, params.mInstallReason, params.mInstallScenario, params.mForceQueryableOverride, params.mDataLoaderType, params.mPackageSource, params.mApplicationEnabledSettingPersistent); params.mApplicationEnabledSettingPersistent, params.mDexoptCompilerFilter); mPackageLite = params.mPackageLite; mPackageMetrics = new PackageMetrics(this); mIsInstallInherit = params.mIsInherit; Loading Loading @@ -709,6 +709,11 @@ final class InstallRequest { return mWarnings; } @Nullable public String getDexoptCompilerFilter() { return mInstallArgs != null ? mInstallArgs.mDexoptCompilerFilter : null; } public void setScanFlags(int scanFlags) { mScanFlags = scanFlags; } Loading services/core/java/com/android/server/pm/InstallingSession.java +3 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ class InstallingSession { @Nullable final DomainSet mPreVerifiedDomains; final boolean mHasAppMetadataFile; @Nullable final String mDexoptCompilerFilter; // For move install InstallingSession(OriginInfo originInfo, MoveInfo moveInfo, IPackageInstallObserver2 observer, Loading Loading @@ -136,6 +137,7 @@ class InstallingSession { mApplicationEnabledSettingPersistent = false; mPreVerifiedDomains = null; mHasAppMetadataFile = false; mDexoptCompilerFilter = null; } InstallingSession(int sessionId, File stagedDir, IPackageInstallObserver2 observer, Loading Loading @@ -172,6 +174,7 @@ class InstallingSession { mApplicationEnabledSettingPersistent = sessionParams.applicationEnabledSettingPersistent; mPreVerifiedDomains = preVerifiedDomains; mHasAppMetadataFile = hasAppMetadatafile; mDexoptCompilerFilter = sessionParams.dexoptCompilerFilter; } @Override Loading Loading
core/java/android/content/pm/PackageInstaller.java +11 −0 Original line number Diff line number Diff line Loading @@ -2797,6 +2797,8 @@ public class PackageInstaller { public int developmentInstallFlags = 0; /** {@hide} */ public int unarchiveId = -1; /** {@hide} */ public @Nullable String dexoptCompilerFilter = null; private final ArrayMap<String, Integer> mPermissionStates; Loading Loading @@ -2850,6 +2852,7 @@ public class PackageInstaller { applicationEnabledSettingPersistent = source.readBoolean(); developmentInstallFlags = source.readInt(); unarchiveId = source.readInt(); dexoptCompilerFilter = source.readString(); } /** {@hide} */ Loading Loading @@ -2885,6 +2888,7 @@ public class PackageInstaller { ret.applicationEnabledSettingPersistent = applicationEnabledSettingPersistent; ret.developmentInstallFlags = developmentInstallFlags; ret.unarchiveId = unarchiveId; ret.dexoptCompilerFilter = dexoptCompilerFilter; return ret; } Loading Loading @@ -3563,6 +3567,11 @@ public class PackageInstaller { this.unarchiveId = unarchiveId; } /** @hide */ public void setDexoptCompilerFilter(@Nullable String dexoptCompilerFilter) { this.dexoptCompilerFilter = dexoptCompilerFilter; } /** @hide */ @NonNull public ArrayMap<String, Integer> getPermissionStates() { Loading Loading @@ -3622,6 +3631,7 @@ public class PackageInstaller { applicationEnabledSettingPersistent); pw.printHexPair("developmentInstallFlags", developmentInstallFlags); pw.printPair("unarchiveId", unarchiveId); pw.printPair("dexoptCompilerFilter", dexoptCompilerFilter); pw.println(); } Loading Loading @@ -3667,6 +3677,7 @@ public class PackageInstaller { dest.writeBoolean(applicationEnabledSettingPersistent); dest.writeInt(developmentInstallFlags); dest.writeInt(unarchiveId); dest.writeString(dexoptCompilerFilter); } public static final Parcelable.Creator<SessionParams> Loading
services/core/java/com/android/server/pm/DexOptHelper.java +10 −3 Original line number Diff line number Diff line Loading @@ -728,7 +728,14 @@ public final class DexOptHelper { final int compilationReason = dexManager.getCompilationReasonForInstallScenario( installRequest.getInstallScenario()); return new DexoptOptions(packageName, compilationReason, dexoptFlags); final AndroidPackage pkg = ps.getPkg(); var options = new DexoptOptions(packageName, compilationReason, dexoptFlags); if (installRequest.getDexoptCompilerFilter() != null) { options = options.overrideCompilerFilter(installRequest.getDexoptCompilerFilter()); } else if (pkg != null && pkg.isDebuggable()) { options = options.overrideCompilerFilter(DexoptParams.COMPILER_FILTER_NOOP); } return options; } /** Loading Loading @@ -772,12 +779,12 @@ public final class DexOptHelper { && installRequest.getInstallSource().mInitiatingPackageName.equals("android")) : true; // Don't skip the dexopt call if the compiler filter is "skip". Instead, call dexopt with // the "skip" filter so that ART Service gets notified and skips dexopt itself. return (!instantApp || Global.getInt(context.getContentResolver(), Global.INSTANT_APP_DEXOPT_ENABLED, 0) != 0) && pkg != null && !pkg.isDebuggable() && (!onIncremental) && dexoptOptions.isCompilationEnabled() && !isApex && performDexOptForRollback; } Loading
services/core/java/com/android/server/pm/InstallArgs.java +4 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ final class InstallArgs { final int mDataLoaderType; final int mPackageSource; final boolean mApplicationEnabledSettingPersistent; @Nullable final String mDexoptCompilerFilter; // The list of instruction sets supported by this app. This is currently // only used during the rmdex() phase to clean up resources. We can get rid of this Loading @@ -73,7 +75,7 @@ final class InstallArgs { int autoRevokePermissionsMode, String traceMethod, int traceCookie, SigningDetails signingDetails, int installReason, int installScenario, boolean forceQueryableOverride, int dataLoaderType, int packageSource, boolean applicationEnabledSettingPersistent) { boolean applicationEnabledSettingPersistent, String dexoptCompilerFilter) { mOriginInfo = originInfo; mMoveInfo = moveInfo; mInstallFlags = installFlags; Loading @@ -96,5 +98,6 @@ final class InstallArgs { mDataLoaderType = dataLoaderType; mPackageSource = packageSource; mApplicationEnabledSettingPersistent = applicationEnabledSettingPersistent; mDexoptCompilerFilter = dexoptCompilerFilter; } }
services/core/java/com/android/server/pm/InstallRequest.java +7 −2 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ final class InstallRequest { params.mTraceMethod, params.mTraceCookie, params.mSigningDetails, params.mInstallReason, params.mInstallScenario, params.mForceQueryableOverride, params.mDataLoaderType, params.mPackageSource, params.mApplicationEnabledSettingPersistent); params.mApplicationEnabledSettingPersistent, params.mDexoptCompilerFilter); mPackageLite = params.mPackageLite; mPackageMetrics = new PackageMetrics(this); mIsInstallInherit = params.mIsInherit; Loading Loading @@ -709,6 +709,11 @@ final class InstallRequest { return mWarnings; } @Nullable public String getDexoptCompilerFilter() { return mInstallArgs != null ? mInstallArgs.mDexoptCompilerFilter : null; } public void setScanFlags(int scanFlags) { mScanFlags = scanFlags; } Loading
services/core/java/com/android/server/pm/InstallingSession.java +3 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ class InstallingSession { @Nullable final DomainSet mPreVerifiedDomains; final boolean mHasAppMetadataFile; @Nullable final String mDexoptCompilerFilter; // For move install InstallingSession(OriginInfo originInfo, MoveInfo moveInfo, IPackageInstallObserver2 observer, Loading Loading @@ -136,6 +137,7 @@ class InstallingSession { mApplicationEnabledSettingPersistent = false; mPreVerifiedDomains = null; mHasAppMetadataFile = false; mDexoptCompilerFilter = null; } InstallingSession(int sessionId, File stagedDir, IPackageInstallObserver2 observer, Loading Loading @@ -172,6 +174,7 @@ class InstallingSession { mApplicationEnabledSettingPersistent = sessionParams.applicationEnabledSettingPersistent; mPreVerifiedDomains = preVerifiedDomains; mHasAppMetadataFile = hasAppMetadatafile; mDexoptCompilerFilter = sessionParams.dexoptCompilerFilter; } @Override Loading