Connect fingerprint build flag to soong.
When RELEASE_FINGERPRINT_ACONFIG_PACKAGE is true, the storage file
version will be v2 for aconfig create-storage.
Test: manual
Change-Id: I6861ac1bfe8680ff7311e26efb627e0ac7c58f05
diff --git a/filesystem/aconfig_files.go b/filesystem/aconfig_files.go
index c80ae03..c1cbecd 100644
--- a/filesystem/aconfig_files.go
+++ b/filesystem/aconfig_files.go
@@ -16,6 +16,7 @@
import (
"android/soong/android"
+ "strconv"
"github.com/google/blueprint/proptools"
)
@@ -45,6 +46,12 @@
installAconfigStorageDir := dir.Join(ctx, "etc", "aconfig")
builder.Command().Text("mkdir -p").Text(installAconfigStorageDir.String())
+ // To enable fingerprint, we need to have v2 storage files. The default version is 1.
+ storageFilesVersion := 1
+ if ctx.Config().ReleaseFingerprintAconfigPackages() {
+ storageFilesVersion = 2
+ }
+
generatePartitionAconfigStorageFile := func(fileType, fileName string) {
outputPath := installAconfigStorageDir.Join(ctx, fileName)
builder.Command().
@@ -52,7 +59,8 @@
FlagWithArg("create-storage --container ", f.PartitionType()).
FlagWithArg("--file ", fileType).
FlagWithOutput("--out ", outputPath).
- FlagWithArg("--cache ", installAconfigFlagsPath.String())
+ FlagWithArg("--cache ", installAconfigFlagsPath.String()).
+ FlagWithArg("--version ", strconv.Itoa(storageFilesVersion))
f.appendToEntry(ctx, outputPath)
}