diff options
author | 2021-05-23 16:55:37 +0100 | |
---|---|---|
committer | 2021-05-24 13:32:55 +0100 | |
commit | 62370923911827d0a9cf6103e47652f40ca2cd25 (patch) | |
tree | 178b0c11f2bf45292e828306f5f2c95fcf1751dc /java/hiddenapi_monolithic.go | |
parent | af99afa919790cc76a9b1a1947d473065ecb65a5 (diff) |
Fix hidden API flags in com.android.i18n
Change 70cfdff3da2ea07cd5cb7f7b91474f6fa0c248e5 changed the hidden API
flags in com.android.i18n as it stopped the i18n-bootclasspath-fragment
from making the hidden API flag files available for use by
platform-bootclasspath.
This change fixes that by exporting the flag files even if hidden API
flag generation is skipped.
Bug: 179354495
Test: m com.android.i18 out/soong/hiddenapi/hiddenapi-flags.csv
- make sure that the flags in
packages/modules/RuntimeI18n/apex/hiddenapi/hiddenapi-max-target-o-low-priority.txt
are reflected in the core-icu4j dex files in the apex.
Change-Id: I9b5c7c74bd996ab447bc0e0452da5fd49191a35d
Diffstat (limited to 'java/hiddenapi_monolithic.go')
-rw-r--r-- | java/hiddenapi_monolithic.go | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/java/hiddenapi_monolithic.go b/java/hiddenapi_monolithic.go index 147afce51..a6bf8c705 100644 --- a/java/hiddenapi_monolithic.go +++ b/java/hiddenapi_monolithic.go @@ -70,11 +70,22 @@ func newMonolithicHiddenAPIInfo(ctx android.ModuleContext, flagFilesByCategory F // append appends all the files from the supplied info to the corresponding files in this struct. func (i *MonolithicHiddenAPIInfo) append(other *HiddenAPIInfo) { i.FlagsFilesByCategory.append(other.FlagFilesByCategory) - i.StubFlagsPaths = append(i.StubFlagsPaths, other.StubFlagsPath) - i.AnnotationFlagsPaths = append(i.AnnotationFlagsPaths, other.AnnotationFlagsPath) - i.MetadataPaths = append(i.MetadataPaths, other.MetadataPath) - i.IndexPaths = append(i.IndexPaths, other.IndexPath) - i.AllFlagsPaths = append(i.AllFlagsPaths, other.AllFlagsPath) + + // The output may not be set if the bootclasspath_fragment has not yet been updated to support + // hidden API processing. + // TODO(b/179354495): Switch back to append once all bootclasspath_fragment modules have been + // updated to support hidden API processing properly. + appendIfNotNil := func(paths android.Paths, path android.Path) android.Paths { + if path == nil { + return paths + } + return append(paths, path) + } + i.StubFlagsPaths = appendIfNotNil(i.StubFlagsPaths, other.StubFlagsPath) + i.AnnotationFlagsPaths = appendIfNotNil(i.AnnotationFlagsPaths, other.AnnotationFlagsPath) + i.MetadataPaths = appendIfNotNil(i.MetadataPaths, other.MetadataPath) + i.IndexPaths = appendIfNotNil(i.IndexPaths, other.IndexPath) + i.AllFlagsPaths = appendIfNotNil(i.AllFlagsPaths, other.AllFlagsPath) } // dedup removes duplicates in all the paths, while maintaining the order in which they were |