gn2bp: Set apex_available and min_sdk_version
This is required to add cronet_aml_components_cronet_android_cronet to
the tethering apex
Test: ./update_results.sh
Change-Id: I88460c74da344f62e3de1916714d91d963cf0cb9
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 466eaf4..b357b58 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -142,6 +142,9 @@
lambda x: None,
}
+# Name of tethering apex module
+tethering_apex = "com.android.tethering"
+
# ----------------------------------------------------------------------------
# End of configuration.
# ----------------------------------------------------------------------------
@@ -546,6 +549,9 @@
# without explictily exporting the include dir.
header_module.export_include_dirs.add(target.proto_in_dir)
+ # This function does not return header_module so setting apex_available attribute here.
+ header_module.apex_available.add(tethering_apex)
+
source_module.genrule_srcs.add(':' + source_module.name)
source_module.genrule_headers.add(header_module.name)
@@ -931,6 +937,9 @@
module.host_supported = target.host_supported()
module.device_supported = target.device_supported()
+ if module.is_genrule():
+ module.apex_available.add(tethering_apex)
+
if module.is_compiled():
# Don't try to inject library/source dependencies into genrules or
# filegroups because they are not compiled in the traditional sense.
@@ -1104,6 +1113,8 @@
'-UANDROID',
]
defaults.stl = 'none'
+ defaults.min_sdk_version = 29
+ defaults.apex_available.add(tethering_apex)
blueprint.add_module(defaults)
for target in targets: