add default path to flag bp files in mainline module
Mainline path cannot be list if the build is user or if the test doesn't
have the root permission. This change adds a default list for the flag
bp files in mainline module if the caller doesn't have the right
permission.
Test: presbumit
Bug: 365157972
Change-Id: I1ba6b4f99d565b7cbc1d49a5cc7b7a65cae2e140
diff --git a/tools/aconfig/aconfig_device_paths/Android.bp b/tools/aconfig/aconfig_device_paths/Android.bp
index dda7a55..bdf96ed 100644
--- a/tools/aconfig/aconfig_device_paths/Android.bp
+++ b/tools/aconfig/aconfig_device_paths/Android.bp
@@ -61,8 +61,12 @@
name: "libaconfig_java_host_device_paths_src",
srcs: ["src/HostDeviceProtosTemplate.java"],
out: ["HostDeviceProtos.java"],
- tool_files: ["partition_aconfig_flags_paths.txt"],
- cmd: "sed -e '/TEMPLATE/{r$(location partition_aconfig_flags_paths.txt)' -e 'd}' $(in) > $(out)",
+ tool_files: [
+ "partition_aconfig_flags_paths.txt",
+ "mainline_aconfig_flags_paths.txt",
+ ],
+ cmd: "sed -e '/TEMPLATE/{r$(location partition_aconfig_flags_paths.txt)' -e 'd}' $(in) > $(out).tmp && " +
+ "sed -e '/MAINLINE_T/{r$(location mainline_aconfig_flags_paths.txt)' -e 'd}' $(out).tmp > $(out)",
}
java_library_host {