diff options
author | android-build-team Robot | 2018-04-15 02:21:24 -0500 |
---|---|---|
committer | android-build-team Robot | 2018-04-15 02:21:24 -0500 |
commit | 8474aad58120e73876c8c09dc78552bdcb69f260 (patch) | |
tree | 6e84ec2c3069fd7877471d605f37b8bc84d65a56 | |
parent | ba70b6434d3680a8765bb056dd4039c08cd9fb77 (diff) | |
parent | 7fe93ba5c9011c73a6e0d7579d6eb2bf7373b5ed (diff) | |
download | platform-hardware-interfaces-8474aad58120e73876c8c09dc78552bdcb69f260.tar.gz platform-hardware-interfaces-8474aad58120e73876c8c09dc78552bdcb69f260.tar.xz platform-hardware-interfaces-8474aad58120e73876c8c09dc78552bdcb69f260.zip |
Snap for 4722539 from 7fe93ba5c9011c73a6e0d7579d6eb2bf7373b5ed to pi-release
Change-Id: I1189105dd321d9cbb282641bcac012233965ee41
-rw-r--r-- | camera/provider/2.4/default/CameraProvider.cpp | 3 | ||||
-rw-r--r-- | compatibility_matrices/Android.mk | 29 | ||||
-rw-r--r-- | current.txt | 4 | ||||
-rw-r--r-- | neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp | 4 | ||||
-rw-r--r-- | neuralnetworks/1.1/IDevice.hal | 5 | ||||
-rw-r--r-- | neuralnetworks/1.1/types.hal | 21 | ||||
-rw-r--r-- | neuralnetworks/1.1/vts/functional/ValidateModel.cpp | 36 | ||||
-rw-r--r-- | neuralnetworks/1.1/vts/functional/ValidateRequest.cpp | 4 | ||||
-rw-r--r-- | radio/1.2/vts/functional/radio_hidl_hal_api.cpp | 32 | ||||
-rw-r--r-- | radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h | 2 | ||||
-rw-r--r-- | radio/1.2/vts/functional/radio_response.cpp | 6 |
11 files changed, 124 insertions, 22 deletions
diff --git a/camera/provider/2.4/default/CameraProvider.cpp b/camera/provider/2.4/default/CameraProvider.cpp index 8e37b267..63139390 100644 --- a/camera/provider/2.4/default/CameraProvider.cpp +++ b/camera/provider/2.4/default/CameraProvider.cpp | |||
@@ -298,7 +298,8 @@ bool CameraProvider::initialize() { | |||
298 | return true; | 298 | return true; |
299 | } | 299 | } |
300 | 300 | ||
301 | mPreferredHal3MinorVersion = property_get_int32("ro.camera.wrapper.hal3TrebleMinorVersion", 3); | 301 | mPreferredHal3MinorVersion = |
302 | property_get_int32("ro.vendor.camera.wrapper.hal3TrebleMinorVersion", 3); | ||
302 | ALOGV("Preferred HAL 3 minor version is %d", mPreferredHal3MinorVersion); | 303 | ALOGV("Preferred HAL 3 minor version is %d", mPreferredHal3MinorVersion); |
303 | switch(mPreferredHal3MinorVersion) { | 304 | switch(mPreferredHal3MinorVersion) { |
304 | case 2: | 305 | case 2: |
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk index 948b4fe1..ee97433f 100644 --- a/compatibility_matrices/Android.mk +++ b/compatibility_matrices/Android.mk | |||
@@ -34,30 +34,47 @@ include $(CLEAR_VARS) | |||
34 | LOCAL_MODULE := framework_compatibility_matrix.legacy.xml | 34 | LOCAL_MODULE := framework_compatibility_matrix.legacy.xml |
35 | LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml | 35 | LOCAL_MODULE_STEM := compatibility_matrix.legacy.xml |
36 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 36 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
37 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 | 37 | LOCAL_KERNEL_VERSIONS := \ |
38 | 3.18.0 \ | ||
39 | 4.4.0 \ | ||
40 | 4.9.0 \ | ||
41 | 4.14.0 \ | ||
42 | |||
38 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 43 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
39 | 44 | ||
40 | include $(CLEAR_VARS) | 45 | include $(CLEAR_VARS) |
41 | LOCAL_MODULE := framework_compatibility_matrix.1.xml | 46 | LOCAL_MODULE := framework_compatibility_matrix.1.xml |
42 | LOCAL_MODULE_STEM := compatibility_matrix.1.xml | 47 | LOCAL_MODULE_STEM := compatibility_matrix.1.xml |
43 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 48 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
44 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 | 49 | LOCAL_KERNEL_VERSIONS := \ |
50 | 3.18.0 \ | ||
51 | 4.4.0 \ | ||
52 | 4.9.0 \ | ||
53 | 4.14.0 \ | ||
54 | |||
45 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 55 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
46 | 56 | ||
47 | include $(CLEAR_VARS) | 57 | include $(CLEAR_VARS) |
48 | LOCAL_MODULE := framework_compatibility_matrix.2.xml | 58 | LOCAL_MODULE := framework_compatibility_matrix.2.xml |
49 | LOCAL_MODULE_STEM := compatibility_matrix.2.xml | 59 | LOCAL_MODULE_STEM := compatibility_matrix.2.xml |
50 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 60 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
51 | LOCAL_KERNEL_VERSIONS := 3.18.0 4.4.0 4.9.0 | 61 | LOCAL_KERNEL_VERSIONS := \ |
52 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 62 | 3.18.0 \ |
63 | 4.4.0 \ | ||
64 | 4.9.0 \ | ||
65 | 4.14.0 \ | ||
53 | 66 | ||
54 | # TODO(b/72409164): STOPSHIP: update kernel version requirements | 67 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
55 | 68 | ||
56 | include $(CLEAR_VARS) | 69 | include $(CLEAR_VARS) |
57 | LOCAL_MODULE := framework_compatibility_matrix.3.xml | 70 | LOCAL_MODULE := framework_compatibility_matrix.3.xml |
58 | LOCAL_MODULE_STEM := compatibility_matrix.3.xml | 71 | LOCAL_MODULE_STEM := compatibility_matrix.3.xml |
59 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) | 72 | LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM) |
60 | LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0 | 73 | LOCAL_KERNEL_VERSIONS := \ |
74 | 4.4.0 \ | ||
75 | 4.9.0 \ | ||
76 | 4.14.0 \ | ||
77 | |||
61 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) | 78 | include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX) |
62 | 79 | ||
63 | # Framework Compatibility Matrix (common to all FCM versions) | 80 | # Framework Compatibility Matrix (common to all FCM versions) |
diff --git a/current.txt b/current.txt index e79e2d6f..7e4b1021 100644 --- a/current.txt +++ b/current.txt | |||
@@ -338,8 +338,8 @@ e15ebdf1e0a326ff5b8a59668d4d8cd3852bd88388eae91de13f5f7e1af50ed1 android.hardwar | |||
338 | b8c7ed58aa8740361e63d0ce9e7c94227572a629f356958840b34809d2393a7c android.hardware.media.bufferpool@1.0::IClientManager | 338 | b8c7ed58aa8740361e63d0ce9e7c94227572a629f356958840b34809d2393a7c android.hardware.media.bufferpool@1.0::IClientManager |
339 | 4a2c0dc82780e6c90731725a103feab8ab6ecf85a64e049b9cbd2b2c61620fe1 android.hardware.media.bufferpool@1.0::IConnection | 339 | 4a2c0dc82780e6c90731725a103feab8ab6ecf85a64e049b9cbd2b2c61620fe1 android.hardware.media.bufferpool@1.0::IConnection |
340 | 6aef1218e5949f867b0104752ac536c1b707222a403341720de90141df129e3e android.hardware.media.bufferpool@1.0::types | 340 | 6aef1218e5949f867b0104752ac536c1b707222a403341720de90141df129e3e android.hardware.media.bufferpool@1.0::types |
341 | 3e4d8e0085ebe8549efb8ad4b8b400a141a3fa3f47ae23696b3e05a1612eb003 android.hardware.neuralnetworks@1.1::IDevice | 341 | 7698dc2382a2eeb43541840e3ee624f34108efdfb976b2bfa7c13ef15fb8c4c4 android.hardware.neuralnetworks@1.1::IDevice |
342 | 50db076b03a6760557fc60ef433ba9dd2ff983cf3305eeb504b0fff3eaa604ff android.hardware.neuralnetworks@1.1::types | 342 | 5604001029a255648a9e955de0a822a48d9ba7cc259b106fb8be0cd43dc8eece android.hardware.neuralnetworks@1.1::types |
343 | 8d3d86da0bfa4bf070970d8303c659f67f35d670c287d45a3f542e4fedadd578 android.hardware.nfc@1.1::INfc | 343 | 8d3d86da0bfa4bf070970d8303c659f67f35d670c287d45a3f542e4fedadd578 android.hardware.nfc@1.1::INfc |
344 | e85f566698d2a2c28100e264fcf2c691a066756ddf8dd341d009ff50cfe10614 android.hardware.nfc@1.1::INfcClientCallback | 344 | e85f566698d2a2c28100e264fcf2c691a066756ddf8dd341d009ff50cfe10614 android.hardware.nfc@1.1::INfcClientCallback |
345 | 5e278fcaa3287d397d8eebe1c22aaa28150f5caae1cf9381cd6dc32cb37899c5 android.hardware.nfc@1.1::types | 345 | 5e278fcaa3287d397d8eebe1c22aaa28150f5caae1cf9381cd6dc32cb37899c5 android.hardware.nfc@1.1::types |
diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp index 4f9d5283..ed1fb944 100644 --- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp +++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp | |||
@@ -242,8 +242,8 @@ void Execute(const sp<V1_1::IDevice>& device, std::function<V1_1::Model(void)> c | |||
242 | // launch prepare model | 242 | // launch prepare model |
243 | sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback(); | 243 | sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback(); |
244 | ASSERT_NE(nullptr, preparedModelCallback.get()); | 244 | ASSERT_NE(nullptr, preparedModelCallback.get()); |
245 | Return<ErrorStatus> prepareLaunchStatus = | 245 | Return<ErrorStatus> prepareLaunchStatus = device->prepareModel_1_1( |
246 | device->prepareModel_1_1(model, preparedModelCallback); | 246 | model, ExecutionPreference::FAST_SINGLE_ANSWER, preparedModelCallback); |
247 | ASSERT_TRUE(prepareLaunchStatus.isOk()); | 247 | ASSERT_TRUE(prepareLaunchStatus.isOk()); |
248 | ASSERT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(prepareLaunchStatus)); | 248 | ASSERT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(prepareLaunchStatus)); |
249 | 249 | ||
diff --git a/neuralnetworks/1.1/IDevice.hal b/neuralnetworks/1.1/IDevice.hal index d2c48433..1335bde1 100644 --- a/neuralnetworks/1.1/IDevice.hal +++ b/neuralnetworks/1.1/IDevice.hal | |||
@@ -102,6 +102,8 @@ interface IDevice extends @1.0::IDevice { | |||
102 | * Multiple threads can call prepareModel on the same model concurrently. | 102 | * Multiple threads can call prepareModel on the same model concurrently. |
103 | * | 103 | * |
104 | * @param model The model to be prepared for execution. | 104 | * @param model The model to be prepared for execution. |
105 | * @param preference Indicates the intended execution behavior of a prepared | ||
106 | * model. | ||
105 | * @param callback A callback object used to return the error status of | 107 | * @param callback A callback object used to return the error status of |
106 | * preparing the model for execution and the prepared model | 108 | * preparing the model for execution and the prepared model |
107 | * if successful, nullptr otherwise. The callback object's | 109 | * if successful, nullptr otherwise. The callback object's |
@@ -115,6 +117,7 @@ interface IDevice extends @1.0::IDevice { | |||
115 | * - INVALID_ARGUMENT if one of the input arguments is | 117 | * - INVALID_ARGUMENT if one of the input arguments is |
116 | * invalid | 118 | * invalid |
117 | */ | 119 | */ |
118 | prepareModel_1_1(Model model, IPreparedModelCallback callback) | 120 | prepareModel_1_1(Model model, ExecutionPreference preference, |
121 | IPreparedModelCallback callback) | ||
119 | generates (ErrorStatus status); | 122 | generates (ErrorStatus status); |
120 | }; | 123 | }; |
diff --git a/neuralnetworks/1.1/types.hal b/neuralnetworks/1.1/types.hal index b4fccaee..8290fbbb 100644 --- a/neuralnetworks/1.1/types.hal +++ b/neuralnetworks/1.1/types.hal | |||
@@ -382,3 +382,24 @@ struct Model { | |||
382 | */ | 382 | */ |
383 | bool relaxComputationFloat32toFloat16; | 383 | bool relaxComputationFloat32toFloat16; |
384 | }; | 384 | }; |
385 | |||
386 | /** | ||
387 | * Execution preferences. | ||
388 | */ | ||
389 | enum ExecutionPreference : int32_t { | ||
390 | /** | ||
391 | * Prefer executing in a way that minimizes battery drain. | ||
392 | * This is desirable for compilations that will be executed often. | ||
393 | */ | ||
394 | LOW_POWER = 0, | ||
395 | /** | ||
396 | * Prefer returning a single answer as fast as possible, even if this causes | ||
397 | * more power consumption. | ||
398 | */ | ||
399 | FAST_SINGLE_ANSWER = 1, | ||
400 | /** | ||
401 | * Prefer maximizing the throughput of successive frames, for example when | ||
402 | * processing successive frames coming from the camera. | ||
403 | */ | ||
404 | SUSTAINED_SPEED = 2, | ||
405 | }; | ||
diff --git a/neuralnetworks/1.1/vts/functional/ValidateModel.cpp b/neuralnetworks/1.1/vts/functional/ValidateModel.cpp index 7a20e26f..3aa55f8c 100644 --- a/neuralnetworks/1.1/vts/functional/ValidateModel.cpp +++ b/neuralnetworks/1.1/vts/functional/ValidateModel.cpp | |||
@@ -50,13 +50,13 @@ static void validateGetSupportedOperations(const sp<IDevice>& device, const std: | |||
50 | } | 50 | } |
51 | 51 | ||
52 | static void validatePrepareModel(const sp<IDevice>& device, const std::string& message, | 52 | static void validatePrepareModel(const sp<IDevice>& device, const std::string& message, |
53 | const V1_1::Model& model) { | 53 | const V1_1::Model& model, ExecutionPreference preference) { |
54 | SCOPED_TRACE(message + " [prepareModel_1_1]"); | 54 | SCOPED_TRACE(message + " [prepareModel_1_1]"); |
55 | 55 | ||
56 | sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback(); | 56 | sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback(); |
57 | ASSERT_NE(nullptr, preparedModelCallback.get()); | 57 | ASSERT_NE(nullptr, preparedModelCallback.get()); |
58 | Return<ErrorStatus> prepareLaunchStatus = | 58 | Return<ErrorStatus> prepareLaunchStatus = |
59 | device->prepareModel_1_1(model, preparedModelCallback); | 59 | device->prepareModel_1_1(model, preference, preparedModelCallback); |
60 | ASSERT_TRUE(prepareLaunchStatus.isOk()); | 60 | ASSERT_TRUE(prepareLaunchStatus.isOk()); |
61 | ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(prepareLaunchStatus)); | 61 | ASSERT_EQ(ErrorStatus::INVALID_ARGUMENT, static_cast<ErrorStatus>(prepareLaunchStatus)); |
62 | 62 | ||
@@ -67,15 +67,24 @@ static void validatePrepareModel(const sp<IDevice>& device, const std::string& m | |||
67 | ASSERT_EQ(nullptr, preparedModel.get()); | 67 | ASSERT_EQ(nullptr, preparedModel.get()); |
68 | } | 68 | } |
69 | 69 | ||
70 | static bool validExecutionPreference(ExecutionPreference preference) { | ||
71 | return preference == ExecutionPreference::LOW_POWER || | ||
72 | preference == ExecutionPreference::FAST_SINGLE_ANSWER || | ||
73 | preference == ExecutionPreference::SUSTAINED_SPEED; | ||
74 | } | ||
75 | |||
70 | // Primary validation function. This function will take a valid model, apply a | 76 | // Primary validation function. This function will take a valid model, apply a |
71 | // mutation to it to invalidate the model, then pass it to interface calls that | 77 | // mutation to it to invalidate the model, then pass it to interface calls that |
72 | // use the model. Note that the model here is passed by value, and any mutation | 78 | // use the model. Note that the model here is passed by value, and any mutation |
73 | // to the model does not leave this function. | 79 | // to the model does not leave this function. |
74 | static void validate(const sp<IDevice>& device, const std::string& message, V1_1::Model model, | 80 | static void validate(const sp<IDevice>& device, const std::string& message, V1_1::Model model, |
75 | const std::function<void(Model*)>& mutation) { | 81 | const std::function<void(Model*)>& mutation, |
82 | ExecutionPreference preference = ExecutionPreference::FAST_SINGLE_ANSWER) { | ||
76 | mutation(&model); | 83 | mutation(&model); |
77 | validateGetSupportedOperations(device, message, model); | 84 | if (validExecutionPreference(preference)) { |
78 | validatePrepareModel(device, message, model); | 85 | validateGetSupportedOperations(device, message, model); |
86 | } | ||
87 | validatePrepareModel(device, message, model, preference); | ||
79 | } | 88 | } |
80 | 89 | ||
81 | // Delete element from hidl_vec. hidl_vec doesn't support a "remove" operation, | 90 | // Delete element from hidl_vec. hidl_vec doesn't support a "remove" operation, |
@@ -486,6 +495,22 @@ static void addOperationOutputTest(const sp<IDevice>& device, const V1_1::Model& | |||
486 | } | 495 | } |
487 | } | 496 | } |
488 | 497 | ||
498 | ///////////////////////// VALIDATE EXECUTION PREFERENCE ///////////////////////// | ||
499 | |||
500 | static const int32_t invalidExecutionPreferences[] = { | ||
501 | static_cast<int32_t>(ExecutionPreference::LOW_POWER) - 1, // lower bound | ||
502 | static_cast<int32_t>(ExecutionPreference::SUSTAINED_SPEED) + 1, // upper bound | ||
503 | }; | ||
504 | |||
505 | static void mutateExecutionPreferenceTest(const sp<IDevice>& device, const V1_1::Model& model) { | ||
506 | for (int32_t preference : invalidExecutionPreferences) { | ||
507 | const std::string message = | ||
508 | "mutateExecutionPreferenceTest: preference " + std::to_string(preference); | ||
509 | validate(device, message, model, [](Model*) {}, | ||
510 | static_cast<ExecutionPreference>(preference)); | ||
511 | } | ||
512 | } | ||
513 | |||
489 | ////////////////////////// ENTRY POINT ////////////////////////////// | 514 | ////////////////////////// ENTRY POINT ////////////////////////////// |
490 | 515 | ||
491 | void ValidationTest::validateModel(const V1_1::Model& model) { | 516 | void ValidationTest::validateModel(const V1_1::Model& model) { |
@@ -503,6 +528,7 @@ void ValidationTest::validateModel(const V1_1::Model& model) { | |||
503 | removeOperationOutputTest(device, model); | 528 | removeOperationOutputTest(device, model); |
504 | addOperationInputTest(device, model); | 529 | addOperationInputTest(device, model); |
505 | addOperationOutputTest(device, model); | 530 | addOperationOutputTest(device, model); |
531 | mutateExecutionPreferenceTest(device, model); | ||
506 | } | 532 | } |
507 | 533 | ||
508 | } // namespace functional | 534 | } // namespace functional |
diff --git a/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp b/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp index bd966144..b42f561c 100644 --- a/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp +++ b/neuralnetworks/1.1/vts/functional/ValidateRequest.cpp | |||
@@ -60,8 +60,8 @@ static void createPreparedModel(const sp<IDevice>& device, const V1_1::Model& mo | |||
60 | // launch prepare model | 60 | // launch prepare model |
61 | sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback(); | 61 | sp<PreparedModelCallback> preparedModelCallback = new PreparedModelCallback(); |
62 | ASSERT_NE(nullptr, preparedModelCallback.get()); | 62 | ASSERT_NE(nullptr, preparedModelCallback.get()); |
63 | Return<ErrorStatus> prepareLaunchStatus = | 63 | Return<ErrorStatus> prepareLaunchStatus = device->prepareModel_1_1( |
64 | device->prepareModel_1_1(model, preparedModelCallback); | 64 | model, ExecutionPreference::FAST_SINGLE_ANSWER, preparedModelCallback); |
65 | ASSERT_TRUE(prepareLaunchStatus.isOk()); | 65 | ASSERT_TRUE(prepareLaunchStatus.isOk()); |
66 | ASSERT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(prepareLaunchStatus)); | 66 | ASSERT_EQ(ErrorStatus::NONE, static_cast<ErrorStatus>(prepareLaunchStatus)); |
67 | 67 | ||
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp index c2524e49..0febd380 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp | |||
@@ -715,4 +715,34 @@ TEST_F(RadioHidlTest_v1_2, getDataRegistrationState) { | |||
715 | ASSERT_TRUE(CheckAnyOfErrors( | 715 | ASSERT_TRUE(CheckAnyOfErrors( |
716 | radioRsp_v1_2->rspInfo.error, | 716 | radioRsp_v1_2->rspInfo.error, |
717 | {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED})); | 717 | {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED})); |
718 | } \ No newline at end of file | 718 | } |
719 | |||
720 | /* | ||
721 | * Test IRadio.getAvailableBandModes() for the response returned. | ||
722 | */ | ||
723 | TEST_F(RadioHidlTest_v1_2, getAvailableBandModes) { | ||
724 | int serial = GetRandomSerialNumber(); | ||
725 | |||
726 | Return<void> res = radio_v1_2->getAvailableBandModes(serial); | ||
727 | ASSERT_OK(res); | ||
728 | EXPECT_EQ(std::cv_status::no_timeout, wait()); | ||
729 | EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); | ||
730 | EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); | ||
731 | ALOGI("getAvailableBandModes, rspInfo.error = %s\n", | ||
732 | toString(radioRsp_v1_2->rspInfo.error).c_str()); | ||
733 | ASSERT_TRUE( | ||
734 | CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, | ||
735 | {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, | ||
736 | RadioError::INTERNAL_ERR, | ||
737 | // If REQUEST_NOT_SUPPORTED is returned, then it should also be returned | ||
738 | // for setRandMode(). | ||
739 | RadioError::REQUEST_NOT_SUPPORTED})); | ||
740 | bool hasUnspecifiedBandMode = false; | ||
741 | if (radioRsp_v1_2->rspInfo.error == RadioError::NONE) { | ||
742 | for (const RadioBandMode& mode : radioRsp_v1_2->radioBandModes) { | ||
743 | // Automatic mode selection must be supported | ||
744 | if (mode == RadioBandMode::BAND_MODE_UNSPECIFIED) hasUnspecifiedBandMode = true; | ||
745 | } | ||
746 | ASSERT_TRUE(hasUnspecifiedBandMode); | ||
747 | } | ||
748 | } | ||
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h index 2703ca51..2d0ea295 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h +++ b/radio/1.2/vts/functional/radio_hidl_hal_utils_v1_2.h | |||
@@ -52,6 +52,8 @@ class RadioResponse_v1_2 : public ::android::hardware::radio::V1_2::IRadioRespon | |||
52 | RadioHidlTest_v1_2& parent_v1_2; | 52 | RadioHidlTest_v1_2& parent_v1_2; |
53 | 53 | ||
54 | public: | 54 | public: |
55 | hidl_vec<RadioBandMode> radioBandModes; | ||
56 | |||
55 | RadioResponseInfo rspInfo; | 57 | RadioResponseInfo rspInfo; |
56 | 58 | ||
57 | RadioResponse_v1_2(RadioHidlTest_v1_2& parent_v1_2); | 59 | RadioResponse_v1_2(RadioHidlTest_v1_2& parent_v1_2); |
diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp index 2977ed68..85ec3e06 100644 --- a/radio/1.2/vts/functional/radio_response.cpp +++ b/radio/1.2/vts/functional/radio_response.cpp | |||
@@ -317,8 +317,10 @@ Return<void> RadioResponse_v1_2::setBandModeResponse(const RadioResponseInfo& /* | |||
317 | } | 317 | } |
318 | 318 | ||
319 | Return<void> RadioResponse_v1_2::getAvailableBandModesResponse( | 319 | Return<void> RadioResponse_v1_2::getAvailableBandModesResponse( |
320 | const RadioResponseInfo& /*info*/, | 320 | const RadioResponseInfo& info, const ::android::hardware::hidl_vec<RadioBandMode>& bandModes) { |
321 | const ::android::hardware::hidl_vec<RadioBandMode>& /*bandModes*/) { | 321 | rspInfo = info; |
322 | radioBandModes = bandModes; | ||
323 | parent_v1_2.notify(); | ||
322 | return Void(); | 324 | return Void(); |
323 | } | 325 | } |
324 | 326 | ||