From f03a62f25c94c4848272a584bdbdb259f6d07b35 Mon Sep 17 00:00:00 2001 From: Zoey Chen Date: Mon, 12 Apr 2021 13:53:05 +0800 Subject: [PATCH] [ANAPIC Review] Remove config 1.3 hal Bug: 183738012 Test: build Change-Id: Ie0eec5576d08ddcd9a8f5ee1a1d9e2b32772653e --- .../1.6/vts/functional/radio_hidl_hal_api.cpp | 14 +++---- .../vts/functional/radio_hidl_hal_test.cpp | 10 ++--- .../functional/radio_hidl_hal_utils_v1_6.h | 4 +- radio/config/1.3/Android.bp | 1 - radio/config/1.3/IRadioConfigResponse.hal | 17 ++++++-- radio/config/1.3/types.hal | 42 ------------------- .../functional/radio_config_hidl_hal_utils.h | 6 +-- .../vts/functional/radio_config_response.cpp | 4 +- 8 files changed, 29 insertions(+), 69 deletions(-) delete mode 100644 radio/config/1.3/types.hal diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp index 6cf4567782..e794d2eb3e 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp @@ -175,7 +175,7 @@ TEST_P(RadioHidlTest_v1_6, getSlicingConfig) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); @@ -378,7 +378,7 @@ TEST_P(RadioHidlTest_v1_6, setNrDualConnectivityState) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); @@ -403,7 +403,7 @@ TEST_P(RadioHidlTest_v1_6, isNrDualConnectivityEnabled) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); @@ -429,7 +429,7 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); @@ -449,7 +449,7 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); @@ -469,7 +469,7 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); @@ -488,7 +488,7 @@ TEST_P(RadioHidlTest_v1_6, setDataThrottling) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); - if (getRadioHalCapabilities().modemReducedFeatureSet1) { + if (getRadioHalCapabilities()) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED})); diff --git a/radio/1.6/vts/functional/radio_hidl_hal_test.cpp b/radio/1.6/vts/functional/radio_hidl_hal_test.cpp index 6255f66f69..5d514a0e6e 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_test.cpp @@ -86,16 +86,14 @@ void RadioHidlTest_v1_6::getDataCallList() { * disabled. *

* Typical usage within VTS: - * if (getRadioHalCapabilities().modemReducedFeatureSet) return; + * if (getRadioHalCapabilities()) return; */ -HalDeviceCapabilities RadioHidlTest_v1_6::getRadioHalCapabilities() { +bool RadioHidlTest_v1_6::getRadioHalCapabilities() { sp<::android::hardware::radio::config::V1_3::IRadioConfig> radioConfig_v1_3 = ::android::hardware::radio::config::V1_3::IRadioConfig::getService(); if (radioConfig_v1_3.get() == nullptr) { // If v1_3 isn't present, the values are initialized to false - HalDeviceCapabilities radioHalCapabilities; - memset(&radioHalCapabilities, 0, sizeof(radioHalCapabilities)); - return radioHalCapabilities; + return false; } else { // Get radioHalDeviceCapabilities from the radio config sp radioConfigRsp = new (std::nothrow) RadioConfigResponse(*this); @@ -104,6 +102,6 @@ HalDeviceCapabilities RadioHidlTest_v1_6::getRadioHalCapabilities() { radioConfig_v1_3->getHalDeviceCapabilities(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); - return radioConfigRsp->halDeviceCapabilities; + return radioConfigRsp->modemReducedFeatureSet1; } } diff --git a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h index 4fc17e54d0..114091a9d8 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h +++ b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h @@ -38,14 +38,12 @@ using namespace ::android::hardware::radio::V1_3; using namespace ::android::hardware::radio::V1_2; using namespace ::android::hardware::radio::V1_1; using namespace ::android::hardware::radio::V1_0; -using namespace ::android::hardware::radio::config::V1_3; using ::android::sp; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; -using ::android::hardware::radio::config::V1_3::HalDeviceCapabilities; #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 @@ -1115,7 +1113,7 @@ class RadioHidlTest_v1_6 : public ::testing::TestWithParam, public: virtual void SetUp() override; - HalDeviceCapabilities getRadioHalCapabilities(); + bool getRadioHalCapabilities(); /* radio service handle */ sp<::android::hardware::radio::V1_6::IRadio> radio_v1_6; diff --git a/radio/config/1.3/Android.bp b/radio/config/1.3/Android.bp index cc5944df44..dc0d82cabd 100644 --- a/radio/config/1.3/Android.bp +++ b/radio/config/1.3/Android.bp @@ -13,7 +13,6 @@ hidl_interface { name: "android.hardware.radio.config@1.3", root: "android.hardware", srcs: [ - "types.hal", "IRadioConfig.hal", "IRadioConfigResponse.hal", ], diff --git a/radio/config/1.3/IRadioConfigResponse.hal b/radio/config/1.3/IRadioConfigResponse.hal index 863754f374..15eefed82c 100644 --- a/radio/config/1.3/IRadioConfigResponse.hal +++ b/radio/config/1.3/IRadioConfigResponse.hal @@ -18,7 +18,6 @@ package android.hardware.radio.config@1.3; import android.hardware.radio@1.6::RadioResponseInfo; import @1.2::IRadioConfigResponse; -import HalDeviceCapabilities; /** * Interface declaring response functions to solicited radio config requests. @@ -26,8 +25,18 @@ import HalDeviceCapabilities; interface IRadioConfigResponse extends @1.2::IRadioConfigResponse { /** * @param info Response info struct containing response type, serial no. and error - * @param capabilities Capabilities struct containing the capabilities of the - * device related to the Radio HAL + * @param modemReducedFeatureSet1 True indicates that the modem does NOT support the following + * features. + * - Providing either + * android.hardware.radio@1.6::LinkCapacityEstimate:secondaryDownlinkCapacityKbps + * or android.hardware.radio@1.6::LinkCapacityEstimate:secondaryUplinkCapacityKbps + * when given from + * android.hardware.radio@1.6::RadioIndication:currentLinkCapacityEstimate + * - Calling android.hardware.radio@1.6::IRadio.setNrDualConnectivityState + * or querying android.hardware.radio@1.6::IRadio.isNrDualConnectivityEnabled + * - Requesting android.hardware.radio@1.6::IRadio.setDataThrottling() + * - Providing android.hardware.radio@1.6::SlicingConfig through + * android.hardware.radio@1.6::getSlicingConfig() * * Valid errors returned: * RadioError:NONE @@ -35,5 +44,5 @@ interface IRadioConfigResponse extends @1.2::IRadioConfigResponse { * RadioError:INTERNAL_ERR */ oneway getHalDeviceCapabilitiesResponse(RadioResponseInfo info, - HalDeviceCapabilities capabilities); + bool modemReducedFeatureSet1); }; diff --git a/radio/config/1.3/types.hal b/radio/config/1.3/types.hal deleted file mode 100644 index 8667f0ab4f..0000000000 --- a/radio/config/1.3/types.hal +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.config@1.3; - -/** - * Contains the device capabilities with respect to the Radio HAL. - */ -struct HalDeviceCapabilities { - /** - * True indicates that the modem does NOT support the following features: - *

- */ - bool modemReducedFeatureSet1; -}; diff --git a/radio/config/1.3/vts/functional/radio_config_hidl_hal_utils.h b/radio/config/1.3/vts/functional/radio_config_hidl_hal_utils.h index 50038eb478..7235798f43 100644 --- a/radio/config/1.3/vts/functional/radio_config_hidl_hal_utils.h +++ b/radio/config/1.3/vts/functional/radio_config_hidl_hal_utils.h @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -48,7 +47,6 @@ using ::android::hardware::radio::config::V1_1::ModemsConfig; using ::android::hardware::radio::config::V1_1::PhoneCapability; using ::android::hardware::radio::config::V1_2::IRadioConfigIndication; using ::android::hardware::radio::config::V1_2::SimSlotStatus; -using ::android::hardware::radio::config::V1_3::HalDeviceCapabilities; using ::android::hardware::radio::config::V1_3::IRadioConfig; using ::android::hardware::radio::config::V1_3::IRadioConfigResponse; using ::android::hardware::radio::V1_0::RadioResponseInfo; @@ -65,7 +63,7 @@ class RadioConfigResponse : public IRadioConfigResponse { public: RadioResponseInfo rspInfo; PhoneCapability phoneCap; - HalDeviceCapabilities halDeviceCapabilities; + bool modemReducedFeatureSet1; RadioConfigResponse(RadioResponseWaiter& parent); virtual ~RadioConfigResponse() = default; @@ -93,7 +91,7 @@ class RadioConfigResponse : public IRadioConfigResponse { Return getHalDeviceCapabilitiesResponse( const ::android::hardware::radio::V1_6::RadioResponseInfo& info, - const HalDeviceCapabilities& halDeviceCapabilities); + bool modemReducedFeatureSet1); }; /* Callback class for radio config indication */ diff --git a/radio/config/1.3/vts/functional/radio_config_response.cpp b/radio/config/1.3/vts/functional/radio_config_response.cpp index 5501ae25e8..6188733f66 100644 --- a/radio/config/1.3/vts/functional/radio_config_response.cpp +++ b/radio/config/1.3/vts/functional/radio_config_response.cpp @@ -65,8 +65,8 @@ Return RadioConfigResponse::setModemsConfigResponse( Return RadioConfigResponse::getHalDeviceCapabilitiesResponse( const ::android::hardware::radio::V1_6::RadioResponseInfo& info, - const ::android::hardware::radio::config::V1_3::HalDeviceCapabilities& capabilities) { - halDeviceCapabilities = capabilities; + bool modemReducedFeatures) { + modemReducedFeatureSet1 = modemReducedFeatures; parent.notify(info.serial); return Void(); }