From 14404f244400c5d13ca9a973492698d6340ce02a Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 11 Jun 2024 00:11:22 +0000 Subject: [PATCH 1/3] Revert^2 "Add PER_DISPLAY_MAX_BRIGHTNESS VHAL property." This reverts commit 439e897d1051623da2272b74c0236ca8d613a069. Reason for revert: Seahawk now uses v3 lib, which should not be affected Change-Id: Ia04c9a2c28829778c4d9d24b4a1138b615ac9377 --- automotive/vehicle/aidl/aidl_test/Android.bp | 2 +- ...ardware.automotive.vehicle-types-meta.json | 7 ++++- .../4/cpp/AccessForVehicleProperty.h | 1 + .../4/cpp/ChangeModeForVehicleProperty.h | 1 + .../4/cpp/VersionForVehicleProperty.h | 1 + .../4/java/AccessForVehicleProperty.java | 1 + .../4/java/ChangeModeForVehicleProperty.java | 1 + automotive/vehicle/aidl_property/Android.bp | 2 +- .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 27 +++++++++++++++++++ .../compatibility_matrix.202504.xml | 2 +- 11 files changed, 42 insertions(+), 4 deletions(-) diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp index ea6a710031..f517df8018 100644 --- a/automotive/vehicle/aidl/aidl_test/Android.bp +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -40,7 +40,7 @@ cc_test { cc_test { name: "VehiclePropertyAnnotationCppTest", srcs: ["VehiclePropertyAnnotationCppTest.cpp"], - header_libs: ["IVehicleGeneratedHeaders"], + header_libs: ["IVehicleGeneratedHeaders-V3"], defaults: ["VehicleHalInterfaceDefaults"], test_suites: ["general-tests"], } diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json index 0dea16bddc..de0e3985c4 100644 --- a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json +++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json @@ -521,7 +521,7 @@ { "name": "PER_DISPLAY_BRIGHTNESS", "value": 289475076, - "description": "Property to represent brightness of the displays which are controlled separately.\nSome cars have one or more displays whose brightness is controlled separately and this property is to inform the brightness of each passenger display. In cars where all displays' brightness is controlled together, they must use DISPLAY_BRIGHTNESS.\nOnly one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by AAOS.\nThe display port uniquely identifies a physical connector on the device for display output, ranging from 0 to 255.\nWriting this property must cause an on property change event that contains the same [display port, brightness] tuple even if the new display brightness is the same as the current value.\nTo get the display brightness for a specific display port, the GetValueRequest must contain a VehiclePropValue, which contains one int32Value: displayPort. Getting this property without specifying the the display port is undefined behavior.\nint32Values[0] : display port int32Values[1] : brightness" + "description": "Property to represent brightness of the displays which are controlled separately.\nSome cars have one or more displays whose brightness is controlled separately and this property is to inform the brightness of each passenger display. In cars where all displays' brightness is controlled together, they must use DISPLAY_BRIGHTNESS.\nOnly one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by AAOS.\nIf this is supported, PER_DISPLAY_MAX_BRIGHTNESS must be supported to represent the max display brightness for each display. Otherwise, the max display brightness is by default 1. The VehicleAreaConfig.maxInt32Value must not be used to represent max display brightness, because maxInt32Value is defined to be the max value for all the elements inside the integer value, which includes display port and brightness. So it is not meaningful.\nThe display port uniquely identifies a physical connector on the device for display output, ranging from 0 to 255.\nWriting this property must cause an on property change event that contains the same [display port, brightness] tuple even if the new display brightness is the same as the current value.\nTo get the display brightness for a specific display port, the GetValueRequest must contain a VehiclePropValue, which contains one int32Value: displayPort. Getting this property without specifying the the display port is undefined behavior.\nint32Values[0] : display port int32Values[1] : brightness" }, { "name": "Valet mode enabled", @@ -1363,6 +1363,11 @@ "data_enum": "CameraServiceState", "description": "Reports current state of CarEvsService types.\nInforms other components of current state of each CarEvsService service type with values defined in CameraServiceState. CarEvsService will update this property whenever a service type transitions into a new state.\nint32[0]: Current state of REARVIEW service type. int32[1]: Current state of SURROUNDVIEW service type. int32[2]: Current state of FRONTVIEW service type. int32[3]: Current state of LEFTVIEW service type. int32[4]: Current state of RIGHTVIEW service type. int32[5]: Current state of DRIVERVIEW service type. int32[6]: Current state of FRONT_PASSENGERVIEW service type. int32[7]: Current state of REAR_PASSENGERVIEW service type." }, + { + "name": "PER_DISPLAY_MAX_BRIGHTNESS", + "value": 289476430, + "description": "Property to represent max brightness of the displays which are controlled separately.\nThis is only used if PER_DISPLAY_BRIGHTNESS is supported.\nThe display port uniquely identifies a physical connector on the device for display output, ranging from 0 to 255.\nint32Values[0] : display port number int32Values[1] : max brightness for display port number specified at int32Values[0] int32Values[2] : display port number int32Values[3] : max brightness for display port number specified at int32Values[2] ..." + }, { "name": "AUTOMATIC_EMERGENCY_BRAKING_ENABLED", "value": 287313920, diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h index 51a3025740..6d07fe5c00 100644 --- a/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/4/cpp/AccessForVehicleProperty.h @@ -263,6 +263,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE}, {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyAccess::READ}, {VehicleProperty::CAMERA_SERVICE_CURRENT_STATE, VehiclePropertyAccess::WRITE}, + {VehicleProperty::PER_DISPLAY_MAX_BRIGHTNESS, VehiclePropertyAccess::READ}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h index 60e9a72138..5ecee95708 100644 --- a/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/4/cpp/ChangeModeForVehicleProperty.h @@ -263,6 +263,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CAMERA_SERVICE_CURRENT_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::PER_DISPLAY_MAX_BRIGHTNESS, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h index 0e80bd85b2..8b9c1bdf39 100644 --- a/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/4/cpp/VersionForVehicleProperty.h @@ -262,6 +262,7 @@ std::unordered_map VersionForVehicleProperty = { {VehicleProperty::CLUSTER_HEARTBEAT, 3}, {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, 3}, {VehicleProperty::CAMERA_SERVICE_CURRENT_STATE, 3}, + {VehicleProperty::PER_DISPLAY_MAX_BRIGHTNESS, 3}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, 2}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, 2}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, 2}, diff --git a/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java index afb6cab547..e9f35a5e9b 100644 --- a/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/4/java/AccessForVehicleProperty.java @@ -256,6 +256,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.CAMERA_SERVICE_CURRENT_STATE, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.PER_DISPLAY_MAX_BRIGHTNESS, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java index 12aff40b34..3fb52b771e 100644 --- a/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/4/java/ChangeModeForVehicleProperty.java @@ -256,6 +256,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CAMERA_SERVICE_CURRENT_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.PER_DISPLAY_MAX_BRIGHTNESS, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl_property/Android.bp b/automotive/vehicle/aidl_property/Android.bp index 2aaf6b6b96..b8a978ba32 100644 --- a/automotive/vehicle/aidl_property/Android.bp +++ b/automotive/vehicle/aidl_property/Android.bp @@ -28,7 +28,7 @@ aidl_interface { // This HAL was originally part of android.hardware.automotive.vehicle "android/hardware/automotive/vehicle/*.aidl", ], - frozen: true, + frozen: false, stability: "vintf", backend: { cpp: { diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index be8d3ac6ab..4c5dad23c8 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -262,6 +262,7 @@ enum VehicleProperty { CLUSTER_HEARTBEAT = (((0x0F4B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 299896651 */, VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL = (((0x0F4C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410892 */, CAMERA_SERVICE_CURRENT_STATE = (((0x0F4D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 289476429 */, + PER_DISPLAY_MAX_BRIGHTNESS = (((0x0F4E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 289476430 */, AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313920 */, AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411073 */, FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313922 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl index e54c179954..0863adf745 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -1757,6 +1757,12 @@ enum VehicleProperty { * implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by * AAOS. * + * If this is supported, PER_DISPLAY_MAX_BRIGHTNESS must be supported to represent the max + * display brightness for each display. Otherwise, the max display brightness is by default 1. + * The VehicleAreaConfig.maxInt32Value must not be used to represent max display brightness, + * because maxInt32Value is defined to be the max value for all the elements inside the integer + * value, which includes display port and brightness. So it is not meaningful. + * * The display port uniquely identifies a physical connector on the device * for display output, ranging from 0 to 255. * @@ -5214,6 +5220,27 @@ enum VehicleProperty { CAMERA_SERVICE_CURRENT_STATE = 0x0F4D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32_VEC, + /** + * Property to represent max brightness of the displays which are controlled separately. + * + * This is only used if PER_DISPLAY_BRIGHTNESS is supported. + * + * The display port uniquely identifies a physical connector on the device + * for display output, ranging from 0 to 255. + * + * int32Values[0] : display port number + * int32Values[1] : max brightness for display port number specified at int32Values[0] + * int32Values[2] : display port number + * int32Values[3] : max brightness for display port number specified at int32Values[2] + * ... + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + * @version 3 + */ + PER_DISPLAY_MAX_BRIGHTNESS = 0x0F4E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + + VehiclePropertyType.INT32_VEC, + /*********************************************************************************************** * Start of ADAS Properties * diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml index 1f51d07968..0e714a4ebc 100644 --- a/compatibility_matrices/compatibility_matrix.202504.xml +++ b/compatibility_matrices/compatibility_matrix.202504.xml @@ -84,7 +84,7 @@ android.hardware.automotive.vehicle - 1-3 + 1-4 IVehicle default From a9171f9d8d2fe821389406da01eebc6840aad52b Mon Sep 17 00:00:00 2001 From: Sneha Patil Date: Thu, 6 Jun 2024 09:42:39 +0000 Subject: [PATCH 2/3] Update the input duration to reduce the number of samples to process Bug: 305866207 Test: atest VtsHalBassBoostTargetTest atest VtsHalVolumeTargetTest atest VtsHalVirtualizerTargetTest atest VtsHalPresetReverbTargetTest Change-Id: I6dc4fa6006634e570d075f8099401bd3dc572da1 --- audio/aidl/vts/VtsHalBassBoostTargetTest.cpp | 4 ++-- audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp | 2 +- audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp | 2 +- audio/aidl/vts/VtsHalVolumeTargetTest.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp index abc5a915a6..5ce2a20603 100644 --- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp +++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp @@ -114,7 +114,7 @@ class BassBoostEffectHelper : public EffectHelper { } static constexpr int kSamplingFrequency = 44100; - static constexpr int kDurationMilliSec = 2000; + static constexpr int kDurationMilliSec = 720; static constexpr int kInputSize = kSamplingFrequency * kDurationMilliSec / 1000; long mInputFrameCount, mOutputFrameCount; std::shared_ptr mFactory; @@ -231,7 +231,7 @@ class BassBoostDataTest : public ::testing::TestWithParam mStrengthValues; int32_t mChannelLayout; diff --git a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp index 2229ff837a..542f0d8d40 100644 --- a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp +++ b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp @@ -82,7 +82,7 @@ class PresetReverbHelper : public EffectHelper { } static constexpr int kSamplingFrequency = 44100; - static constexpr int kDurationMilliSec = 2000; + static constexpr int kDurationMilliSec = 500; static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000; int mStereoChannelCount = getChannelCount(AudioChannelLayout::make( diff --git a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp index f121f7c8c6..b449f3c192 100644 --- a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp +++ b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp @@ -96,7 +96,7 @@ class VirtualizerHelper : public EffectHelper { static constexpr int kSamplingFrequency = 44100; static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO; - static constexpr int kDurationMilliSec = 2000; + static constexpr int kDurationMilliSec = 720; static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000; int kChannelCount = getChannelCount( AudioChannelLayout::make(kDefaultChannelLayout)); diff --git a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp index db2f4a9625..5930dcf2b8 100644 --- a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp +++ b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp @@ -94,7 +94,7 @@ class VolumeControlHelper : public EffectHelper { } static constexpr int kSamplingFrequency = 44100; - static constexpr int kDurationMilliSec = 2000; + static constexpr int kDurationMilliSec = 720; static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000; static constexpr int kMinLevel = -96; static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO; @@ -174,7 +174,7 @@ class VolumeDataTest : public ::testing::TestWithParam, static constexpr int kMaxAudioSample = 1; static constexpr int kTransitionDuration = 300; - static constexpr int kNPointFFT = 32768; + static constexpr int kNPointFFT = 16384; static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT; static constexpr size_t offset = kSamplingFrequency * kTransitionDuration / 1000; static constexpr float kBaseLevel = 0; From e9dcae53e41ca10a12a036d26dee86f47f668c8b Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 11 Jun 2024 15:36:20 +0100 Subject: [PATCH 3/3] KeyMint: version gate attestation of IMEI2 aosp/3106417 added extra tests with for device ID attestation, but didn't include a version gate for attesting to the second IMEI value, which is only present in KeyMint v3+. Test: VtsAidlKeyMintTargetTest Change-Id: I95f47942058781709efe96d38442e0518e39705d --- security/keymint/aidl/vts/functional/KeyMintTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp index 3c49a82ba6..527b5e07ea 100644 --- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp +++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp @@ -2059,7 +2059,7 @@ TEST_P(NewKeyGenerationTest, EcdsaAttestationIdTags) { extra_tags.Authorization(TAG_ATTESTATION_ID_IMEI, imei.data(), imei.size()); } string second_imei = get_imei(1); - if (!second_imei.empty()) { + if (!second_imei.empty() && isSecondImeiIdAttestationRequired()) { extra_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, second_imei.data(), second_imei.size()); } @@ -2135,7 +2135,7 @@ TEST_P(NewKeyGenerationTest, EcdsaAttestationIdAllTags) { extra_tags.Authorization(TAG_ATTESTATION_ID_IMEI, imei.data(), imei.size()); } string second_imei = get_imei(1); - if (!second_imei.empty()) { + if (!second_imei.empty() && isSecondImeiIdAttestationRequired()) { extra_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, second_imei.data(), second_imei.size()); }