From e8ef6f1540ca7518e2e2998779b5f2d37b7a1479 Mon Sep 17 00:00:00 2001 From: Liana Kazanova Date: Tue, 3 Dec 2024 21:47:31 +0000 Subject: Revert "Use soong built autogenerated RROs" Revert submission 3362490-autogen_app_overlay Reason for revert: DroidMonitor: Potential culprit for http://b/382076898 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reverted changes: /q/submissionid:3362490-autogen_app_overlay Change-Id: Ib3eb370625a4ab2cbf9a1337f82a1f0bc281a3a8 --- java/androidmk.go | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'java/androidmk.go') diff --git a/java/androidmk.go b/java/androidmk.go index 35024c1d6..2ad30b132 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -307,11 +307,15 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries { Disabled: true, }} } + var required []string + if proptools.Bool(app.appProperties.Generate_product_characteristics_rro) { + required = []string{app.productCharacteristicsRROPackageName()} + } return []android.AndroidMkEntries{android.AndroidMkEntries{ Class: "APPS", OutputFile: android.OptionalPathForPath(app.outputFile), Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", - Required: app.requiredModuleNames, + Required: required, ExtraEntries: []android.AndroidMkExtraEntriesFunc{ func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { // App module names can be overridden. @@ -346,6 +350,31 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries { entries.SetBoolIfTrue("LOCAL_NO_STANDARD_LIBRARIES", true) } + filterRRO := func(filter overlayType) android.Paths { + var paths android.Paths + seen := make(map[android.Path]bool) + for _, d := range app.rroDirsDepSet.ToList() { + if d.overlayType == filter { + if seen[d.path] { + continue + } + seen[d.path] = true + paths = append(paths, d.path) + } + } + // Reverse the order, Soong stores rroDirs in aapt2 order (low to high priority), but Make + // expects it in LOCAL_RESOURCE_DIRS order (high to low priority). + return android.ReversePaths(paths) + } + deviceRRODirs := filterRRO(device) + if len(deviceRRODirs) > 0 { + entries.AddStrings("LOCAL_SOONG_DEVICE_RRO_DIRS", deviceRRODirs.Strings()...) + } + productRRODirs := filterRRO(product) + if len(productRRODirs) > 0 { + entries.AddStrings("LOCAL_SOONG_PRODUCT_RRO_DIRS", productRRODirs.Strings()...) + } + entries.SetBoolIfTrue("LOCAL_EXPORT_PACKAGE_RESOURCES", Bool(app.appProperties.Export_package_resources)) entries.SetPath("LOCAL_FULL_MANIFEST_FILE", app.manifestPath) -- cgit v1.2.3-59-g8ed1b