From 5ae16f33f3be458656d2a1c955d2cf05a2758efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= Date: Fri, 21 Aug 2020 16:46:07 +0200 Subject: [PATCH] Add setAllowedNetworkTypeBitmap There are currently two methods that cover the network family types: setPreferredNetworkType and setPreferredNetworkTypeBitmap. They both serve a similar purpose and have been previously interpreted as a suggestion to the modem on the type of networks requested by the OS. This change introduces a new method (setAllowedNetworkTypeBitmap) which will coexist with these methods. This new method must be interpreted as a strict set of Radio Access Technology (RAT) that should be accepted by the modem. For instance, one may first use setAllowedNetworkTypeBitmap to exclude 2G technology from the list of usable RAT. Then, they may use setPreferredNetworkType to describe their preference for 4G. Test: mm Bug: 171791177 Change-Id: I7f5fdf9bf5a80c47e9ad838b740b2d6e40ffea60 Merged-In: I7f5fdf9bf5a80c47e9ad838b740b2d6e40ffea60 --- radio/1.6/IRadio.hal | 15 +++++++++++++++ radio/1.6/IRadioResponse.hal | 16 ++++++++++++++++ .../vts/functional/radio_hidl_hal_utils_v1_6.h | 5 ++++- radio/1.6/vts/functional/radio_response.cpp | 7 +++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal index eb20542e7e..747b2f2ddc 100644 --- a/radio/1.6/IRadio.hal +++ b/radio/1.6/IRadio.hal @@ -21,6 +21,7 @@ import @1.0::CdmaSmsMessage; import @1.0::GsmSmsMessage; import @1.1::CardPowerState; import @1.2::DataRequestReason; +import @1.4::RadioAccessFamily; import @1.5::IRadio; import @1.5::AccessNetwork; import @1.5::DataProfileInfo; @@ -305,4 +306,18 @@ interface IRadio extends @1.5::IRadio { * Response function is IRadioResponse.cancelHandoverResponse() */ oneway cancelHandover(int32_t serial, int32_t callId); + + /** + * Requests to set the network type for searching and registering. + * + * Instruct the radio to *only* accept the types of network provided. This + * is stronger than setPreferredNetworkType which is a suggestion. + * + * @param serial Serial number of request. + * @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily + * + * Response callbask is IRadioResponse.setNetworkTypeBitmapResponse() + */ + oneway setAllowedNetworkTypeBitmap( + uint32_t serial, bitfield networkTypeBitmap); }; diff --git a/radio/1.6/IRadioResponse.hal b/radio/1.6/IRadioResponse.hal index 07322be29b..523185eab0 100644 --- a/radio/1.6/IRadioResponse.hal +++ b/radio/1.6/IRadioResponse.hal @@ -290,4 +290,20 @@ interface IRadioResponse extends @1.5::IRadioResponse { * RadioError:INVALID_CALL_ID */ oneway cancelHandoverResponse(RadioResponseInfo info); + + /** + * Callback of IRadio.setAllowedNetworkTypeBitmap(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 setAllowedNetworkTypeBitmapResponse(RadioResponseInfo info); }; 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 850425dbe4..5682f11da4 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 @@ -58,7 +58,7 @@ using ::android::hardware::Void; class RadioHidlTest_v1_6; extern ::android::hardware::radio::V1_5::CardStatus cardStatus; -/* Callback class for radio response v1_5 */ +/* Callback class for radio response v1_6 */ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioResponse { protected: RadioHidlTest_v1_6& parent_v1_6; @@ -789,6 +789,9 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon Return cancelHandoverResponse( const ::android::hardware::radio::V1_6::RadioResponseInfo& info); + + Return setAllowedNetworkTypeBitmapResponse( + const ::android::hardware::radio::V1_6::RadioResponseInfo& info); }; /* Callback class for radio indication */ diff --git a/radio/1.6/vts/functional/radio_response.cpp b/radio/1.6/vts/functional/radio_response.cpp index fc56947f50..dc4f57db3d 100644 --- a/radio/1.6/vts/functional/radio_response.cpp +++ b/radio/1.6/vts/functional/radio_response.cpp @@ -1149,3 +1149,10 @@ Return RadioResponse_v1_6::cancelHandoverResponse( parent_v1_6.notify(info.serial); return Void(); } + +Return RadioResponse_v1_6::setAllowedNetworkTypeBitmapResponse( + const ::android::hardware::radio::V1_6::RadioResponseInfo& info) { + rspInfo = info; + parent_v1_6.notify(info.serial); + return Void(); +}