aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorJiakai Zhang <jiakaiz@google.com>2023-02-09 00:09:24 +0800
committerJiakai Zhang <jiakaiz@google.com>2023-02-15 22:47:23 +0000
commit9c4dc19f4e3b72b13d557cdfbab32dbc63f456d7 (patch)
tree1de9cac312b15abbafac9fea9c65f2b9df9a7904 /java/java.go
parent8916b21320969a6de6b5724f0be1ff4346ea1406 (diff)
Output dex_preopt to SDK snapshot.
This is needed to determine whether we need to deapex the profile or not. Bug: 241823638 Test: m nothing Test: - 1. Patch ag/20582608 PS2. 2. TARGET_BUILD_APPS=com.android.wifi packages/modules/common/build/mainline_modules_sdks.sh 3. See the `dex_preopt` property being written. Change-Id: I05177388c24be1ab315247ea85e7e3a8600cebd3
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 874f93576..912779e94 100644
--- a/java/java.go
+++ b/java/java.go
@@ -795,6 +795,8 @@ type librarySdkMemberProperties struct {
// The value of the min_sdk_version property, translated into a number where possible.
MinSdkVersion *string `supported_build_releases:"Tiramisu+"`
+
+ DexPreoptProfileGuided *bool `supported_build_releases:"UpsideDownCake+"`
}
func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
@@ -812,6 +814,10 @@ func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberCo
canonical := android.ReplaceFinalizedCodenames(ctx.SdkModuleContext().Config(), j.minSdkVersion.ApiLevel.String())
p.MinSdkVersion = proptools.StringPtr(canonical)
}
+
+ if j.dexpreopter.dexpreoptProperties.Dex_preopt_result.Profile_guided {
+ p.DexPreoptProfileGuided = proptools.BoolPtr(true)
+ }
}
func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
@@ -838,6 +844,11 @@ func (p *librarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberConte
propertySet.AddProperty("permitted_packages", p.PermittedPackages)
}
+ dexPreoptSet := propertySet.AddPropertySet("dex_preopt")
+ if p.DexPreoptProfileGuided != nil {
+ dexPreoptSet.AddProperty("profile_guided", proptools.Bool(p.DexPreoptProfileGuided))
+ }
+
// Do not copy anything else to the snapshot.
if memberType.onlyCopyJarToSnapshot {
return
@@ -2192,6 +2203,7 @@ func ImportFactory() android.Module {
module.AddProperties(
&module.properties,
&module.dexer.dexProperties,
+ &module.importDexpreoptProperties,
)
module.initModuleAndImport(module)