From 29e35e115d70423635661f3b2387301f3ce1df62 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Wed, 8 Dec 2021 10:48:35 +0000 Subject: [PATCH] Stop installing a profile into an APEX if profiles are disabled. Bug: 209630530 Test: art/tools/golem/build-target.sh Change-Id: I0ac4e1860a47da20626b423b9b1f62dd49259deb --- java/bootclasspath_fragment.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index df1e121be..bfe895c17 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -594,8 +594,11 @@ func (b *BootclasspathFragmentModule) provideApexContentInfo(ctx android.ModuleC if imageConfig != nil { info.modules = imageConfig.modules - info.profilePathOnHost = imageConfig.profilePathOnHost - info.profileInstallPathInApex = imageConfig.profileInstallPathInApex + global := dexpreopt.GetGlobalConfig(ctx) + if !global.DisableGenerateProfile { + info.profilePathOnHost = imageConfig.profilePathOnHost + info.profileInstallPathInApex = imageConfig.profileInstallPathInApex + } } info.bootImageFilesByArch = bootImageFilesByArch