Set <partition>_available only if it is for device

it is meaningful only if it is installed in the device

Bug: 277909042
Test: cargo2android.py with/without device, and then check
product/vendor_available

Change-Id: I9ca7328ac953849db224949089412e181b659945
This commit is contained in:
Jeongik Cha
2023-09-27 02:28:55 +09:00
parent 4b76dd3526
commit a18bd3c1ca

View File

@@ -744,18 +744,20 @@ class Crate(object):
self.write(' "libcompiler_builtins.rust_sysroot",') self.write(' "libcompiler_builtins.rust_sysroot",')
self.write(' "libcore.rust_sysroot",') self.write(' "libcore.rust_sysroot",')
self.write(' ],') self.write(' ],')
if self.runner.variant_args.native_bridge_supported: if self.device_supported:
self.write(' native_bridge_supported: true,') # These configurations are meaningful only if it is for device.
if self.runner.variant_args.product_available: if self.runner.variant_args.native_bridge_supported:
self.write(' product_available: true,') self.write(' native_bridge_supported: true,')
if self.runner.variant_args.recovery_available: if self.runner.variant_args.product_available:
self.write(' recovery_available: true,') self.write(' product_available: true,')
if self.runner.variant_args.vendor_available: if self.runner.variant_args.recovery_available:
self.write(' vendor_available: true,') self.write(' recovery_available: true,')
if self.runner.variant_args.vendor_ramdisk_available: if self.runner.variant_args.vendor_available:
self.write(' vendor_ramdisk_available: true,') self.write(' vendor_available: true,')
if self.runner.variant_args.ramdisk_available: if self.runner.variant_args.vendor_ramdisk_available:
self.write(' ramdisk_available: true,') self.write(' vendor_ramdisk_available: true,')
if self.runner.variant_args.ramdisk_available:
self.write(' ramdisk_available: true,')
if self.runner.variant_args.min_sdk_version and crate_type in LIBRARY_CRATE_TYPES and self.device_supported: if self.runner.variant_args.min_sdk_version and crate_type in LIBRARY_CRATE_TYPES and self.device_supported:
self.write(' min_sdk_version: "%s",' % self.runner.variant_args.min_sdk_version) self.write(' min_sdk_version: "%s",' % self.runner.variant_args.min_sdk_version)
if crate_type == 'test' and not self.default_srcs: if crate_type == 'test' and not self.default_srcs: