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
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index c4b0af4..fa52ae6 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -78,7 +78,8 @@
}
type dexpreopter struct {
- dexpreoptProperties DexpreoptProperties
+ dexpreoptProperties DexpreoptProperties
+ importDexpreoptProperties ImportDexpreoptProperties
installPath android.InstallPath
uncompressedDex bool
@@ -127,6 +128,18 @@
// profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
Profile *string `android:"path"`
}
+
+ Dex_preopt_result struct {
+ // True if profile-guided optimization is actually enabled.
+ Profile_guided bool
+ } `blueprint:"mutated"`
+}
+
+type ImportDexpreoptProperties struct {
+ Dex_preopt struct {
+ // If true, use the profile in the prebuilt APEX to guide optimization. Defaults to false.
+ Profile_guided *bool
+ }
}
func init() {
@@ -310,6 +323,8 @@
}
}
+ d.dexpreoptProperties.Dex_preopt_result.Profile_guided = profileClassListing.Valid()
+
// Full dexpreopt config, used to create dexpreopt build rules.
dexpreoptConfig := &dexpreopt.ModuleConfig{
Name: moduleName(ctx),