From e8bfa9c4e1b7303ebb613e308783d7df6d9fdbe0 Mon Sep 17 00:00:00 2001 From: Yomna Nasser Date: Tue, 17 Nov 2020 22:00:55 +0000 Subject: [PATCH] Add getAllowedNetworkTypesBitmap HAL API Adds corresponding query API getAllowedNetworkTypesBitmap to existing setAllowedNetworkTypeBitmap. Test: atest Bug: 171791177 Change-Id: Ib8f0075dda41d4876a14f7223a067e34626a4675 Merged-In: Ib8f0075dda41d4876a14f7223a067e34626a4675 --- radio/1.6/IRadio.hal | 16 +++++++++++++++- radio/1.6/IRadioResponse.hal | 18 ++++++++++++++++++ .../vts/functional/radio_hidl_hal_utils_v1_6.h | 6 ++++++ radio/1.6/vts/functional/radio_response.cpp | 8 ++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal index 2c8ac5ea35..456655825e 100644 --- a/radio/1.6/IRadio.hal +++ b/radio/1.6/IRadio.hal @@ -327,11 +327,25 @@ interface IRadio extends @1.5::IRadio { * @param serial Serial number of request. * @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily * - * Response callbask is IRadioResponse.setNetworkTypeBitmapResponse() + * Response callback is IRadioResponse.setNetworkTypeBitmapResponse() */ oneway setAllowedNetworkTypeBitmap( uint32_t serial, bitfield networkTypeBitmap); + /** + * Requests bitmap representing the currently allowed network types. + * + * Requests the bitmap set by the corresponding method + * setAllowedNetworkTypeBitmap, which sets a strict set of RATs for the + * radio to use. Differs from getPreferredNetworkType and getPreferredNetworkTypeBitmap + * in that those request *preferences*. + * + * @param serial Serial number of request. + * + * Response callback is IRadioResponse.getNetworkTypeBitmapResponse() + */ + oneway getAllowedNetworkTypeBitmap(uint32_t serial); + /** * Control data throttling at modem. * - DataThrottlingAction:NO_DATA_THROTTLING should clear any existing diff --git a/radio/1.6/IRadioResponse.hal b/radio/1.6/IRadioResponse.hal index 3b2061f32d..f13ee2b527 100644 --- a/radio/1.6/IRadioResponse.hal +++ b/radio/1.6/IRadioResponse.hal @@ -17,6 +17,7 @@ package android.hardware.radio@1.6; import @1.0::SendSmsResult; +import @1.4::RadioAccessFamily; import @1.5::IRadioResponse; import @1.6::CellInfo; import @1.6::RegStateResult; @@ -309,6 +310,23 @@ interface IRadioResponse extends @1.5::IRadioResponse { */ oneway setAllowedNetworkTypeBitmapResponse(RadioResponseInfo info); + /** + * Callback of IRadio.getAllowedNetworkTypeBitmap(int, bitfield) + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:OPERATION_NOT_ALLOWED + * RadioError:MODE_NOT_SUPPORTED + * RadioError:INTERNAL_ERR + * RadioError:INVALID_ARGUMENTS + * RadioError:MODEM_ERR + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:NO_RESOURCES + */ + oneway getAllowedNetworkTypeBitmapResponse( + RadioResponseInfo info, bitfield networkTypeBitmap); + /** * @param info Response info struct containing response type, serial no. and error * 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 111fcd1325..ab56540067 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 @@ -793,6 +793,12 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon Return setAllowedNetworkTypeBitmapResponse( const ::android::hardware::radio::V1_6::RadioResponseInfo& info); + Return getAllowedNetworkTypeBitmapResponse( + const ::android::hardware::radio::V1_6::RadioResponseInfo& info, + const ::android::hardware::hidl_bitfield< + ::android::hardware::radio::V1_4::RadioAccessFamily> + networkTypeBitmap); + Return setDataThrottlingResponse( const ::android::hardware::radio::V1_6::RadioResponseInfo& info); diff --git a/radio/1.6/vts/functional/radio_response.cpp b/radio/1.6/vts/functional/radio_response.cpp index 68d1f202b7..e37efdd9f0 100644 --- a/radio/1.6/vts/functional/radio_response.cpp +++ b/radio/1.6/vts/functional/radio_response.cpp @@ -1157,6 +1157,14 @@ Return RadioResponse_v1_6::setAllowedNetworkTypeBitmapResponse( return Void(); } +Return RadioResponse_v1_6::getAllowedNetworkTypeBitmapResponse( + const ::android::hardware::radio::V1_6::RadioResponseInfo& /*info*/, + const ::android::hardware::hidl_bitfield< + ::android::hardware::radio::V1_4::RadioAccessFamily> + /*networkTypeBitmap*/) { + return Void(); +} + Return RadioResponse_v1_6::setDataThrottlingResponse( const ::android::hardware::radio::V1_6::RadioResponseInfo& info) { rspInfo = info;