summaryrefslogtreecommitdiffstats
path: root/radio/1.5
diff options
context:
space:
mode:
authorNathan Harold <nharold@google.com>2020-06-24 14:29:20 -0700
committerNathan Harold <nharold@google.com>2020-06-24 15:23:39 -0700
commit25d2378734861ff6d5f96e4037a86dadafe8ab10 (patch)
tree8da3071ee1453a17bd1d271da78e114029cc6aa6 /radio/1.5
parentfbcb5a89c91b2bb4a8b27c88338cae35cc973d90 (diff)
downloadplatform_hardware_interfaces-25d2378734861ff6d5f96e4037a86dadafe8ab10.tar.gz
platform_hardware_interfaces-25d2378734861ff6d5f96e4037a86dadafe8ab10.tar.bz2
platform_hardware_interfaces-25d2378734861ff6d5f96e4037a86dadafe8ab10.zip
Allow Unsupported BarringInfo in RVC for Radio 1.5
Allow devices launching with IRadio 1.5 this year to not support BarringInfo. Bug: 159582898 Test: atest VtsHalRadioV1_5TargetTest -- -t getBarringInfo Change-Id: I05b749fa3cfb3648148fd2666d7eb6f43f3c45d2
Diffstat (limited to 'radio/1.5')
-rw-r--r--radio/1.5/vts/functional/radio_hidl_hal_api.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
index 32c02cb137..ee97431a0f 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <android-base/properties.h>
#include <radio_hidl_hal_utils_v1_5.h>
#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
@@ -1174,6 +1175,17 @@ TEST_P(RadioHidlTest_v1_5, getBarringInfo) {
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_5->rspInfo.serial);
+ int32_t firstApiLevel = android::base::GetIntProperty<int32_t>("ro.product.first_api_level", 0);
+ // Allow devices shipping with Radio::1_5 and Android 11 to not support barring info.
+ if (firstApiLevel > 0 && firstApiLevel <= 30) {
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
+ {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
+ // Early exit for devices that don't support barring info.
+ if (radioRsp_v1_5->rspInfo.error != RadioError::NONE) {
+ return;
+ }
+ }
+
ASSERT_TRUE(radioRsp_v1_5->barringInfos.size() > 0);
std::set<BarringInfo::ServiceType> reportedServices;