Revert "Generate app profiles even if dexpreopt is disabled."

Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: Ia9d05f3b7439604eb4a4b4100f46879fe11f5820
BUG: <280902279>
This commit is contained in:
Qiao Yang
2023-05-05 15:03:24 +00:00
committed by Gerrit Code Review
parent 7b845e808f
commit 3d08c388b9
6 changed files with 19 additions and 62 deletions

View File

@@ -180,8 +180,6 @@ func moduleName(ctx android.BaseModuleContext) string {
return android.RemoveOptionalPrebuiltPrefix(ctx.ModuleName())
}
// Returns whether dexpreopt is applicable to the module.
// When it returns true, neither profile nor dexpreopt artifacts will be generated.
func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
if !ctx.Device() {
return true
@@ -207,6 +205,14 @@ func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
global := dexpreopt.GetGlobalConfig(ctx)
if global.DisablePreopt {
return true
}
if inList(moduleName(ctx), global.DisablePreoptModules) {
return true
}
isApexSystemServerJar := global.AllApexSystemServerJars(ctx).ContainsJar(moduleName(ctx))
if isApexVariant(ctx) {
// Don't preopt APEX variant module unless the module is an APEX system server jar.