From d75e99859ba865564ae238de7fd36f111f3d1a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=98=E7=A7=80?= Date: Thu, 9 May 2024 07:15:55 +0000 Subject: [PATCH] Fix the problem of resource integration confusion caused by not adding regional configuration tailoring. An android app is automatically creating a corresponding "product characteristics" RRO. The app's resources are filtered by the aapt product config, but the rro resources are not. This cl makes the RRO resources also filtered. When building the CN version, it was expected that only the resources corresponding to the CN version would be retained, but the actual result was that other unexpected areas appeared on the region setting interface in boot interface. After investigation, it was found that the framework-res__nosdcard__auto_generated_characteristics_rro.apk apk integrated resources other than the CN version that caused this problem, and the integration of this apk was not filtered by aaptconfig. The purpose of this modification is to add aaptconfig filtering, and it has been verified that this problem can be fixed. Change-Id: I85d5d07397bd2b0759d35b9f3a07f015346af4e9 Signed-off-by: wybxyx --- java/app.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/app.go b/java/app.go index bab413097..a5e5c8376 100644 --- a/java/app.go +++ b/java/app.go @@ -1232,6 +1232,11 @@ func AndroidAppFactory() android.Module { Manifest: proptools.StringPtr(":" + rroManifestName), Resource_dirs: a.aaptProperties.Resource_dirs, } + if !Bool(a.aaptProperties.Aapt_include_all_resources) { + for _, aaptConfig := range ctx.Config().ProductAAPTConfig() { + rroProperties.Aaptflags = append(rroProperties.Aaptflags, "-c", aaptConfig) + } + } ctx.CreateModule(RuntimeResourceOverlayFactory, &rroProperties) })