From b004dbc19fdd9c92d19d329f5df453e90ee88e11 Mon Sep 17 00:00:00 2001 From: Eric Schwarzenbach Date: Wed, 14 Mar 2018 16:22:38 -0700 Subject: [PATCH] Update RegState for new CellIdentity types Bug: 74826109 Test: make, make vts Change-Id: I6350e5da5bc064e665e54d161ee589c3eadf901a Merged-In: I6350e5da5bc064e665e54d161ee589c3eadf901a (cherry picked from commit 74befb69b9c532e5be77a1a64eb38713b8d51118) --- radio/1.2/Android.bp | 3 + radio/1.2/IRadioResponse.hal | 27 ++++ radio/1.2/types.hal | 127 ++++++++++++++++++ .../1.2/vts/functional/radio_hidl_hal_api.cpp | 37 +++++ .../functional/radio_hidl_hal_utils_v1_2.h | 6 + radio/1.2/vts/functional/radio_response.cpp | 12 +- 6 files changed, 211 insertions(+), 1 deletion(-) diff --git a/radio/1.2/Android.bp b/radio/1.2/Android.bp index a9c80b7f4a..c90a03c374 100644 --- a/radio/1.2/Android.bp +++ b/radio/1.2/Android.bp @@ -24,6 +24,7 @@ hidl_interface { "Call", "CardStatus", "CellConnectionStatus", + "CellIdentity", "CellIdentityCdma", "CellIdentityGsm", "CellIdentityLte", @@ -36,6 +37,7 @@ hidl_interface { "CellInfoLte", "CellInfoTdscdma", "CellInfoWcdma", + "DataRegStateResult", "DataRequestReason", "IncrementalResultsPeriodicityRange", "IndicationFilter", @@ -48,6 +50,7 @@ hidl_interface { "ScanIntervalRange", "SignalStrength", "TdscdmaSignalStrength", + "VoiceRegStateResult", "WcdmaSignalStrength", ], gen_java: true, diff --git a/radio/1.2/IRadioResponse.hal b/radio/1.2/IRadioResponse.hal index f26c9eccea..300aa37285 100644 --- a/radio/1.2/IRadioResponse.hal +++ b/radio/1.2/IRadioResponse.hal @@ -98,4 +98,31 @@ interface IRadioResponse extends @1.1::IRadioResponse { * RadioError:INTERNAL_ERR */ oneway getSignalStrengthResponse_1_2(RadioResponseInfo info, SignalStrength signalStrength); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param voiceRegResponse Current Voice registration response as defined by VoiceRegStateResult + * in types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway getVoiceRegistrationStateResponse_1_2(RadioResponseInfo info, + VoiceRegStateResult voiceRegResponse); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param dataRegResponse Current Data registration response as defined by DataRegStateResult in + * types.hal + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:NOT_PROVISIONED + */ + oneway getDataRegistrationStateResponse_1_2(RadioResponseInfo info, + DataRegStateResult dataRegResponse); }; diff --git a/radio/1.2/types.hal b/radio/1.2/types.hal index b68895e15b..ac2f7534f5 100644 --- a/radio/1.2/types.hal +++ b/radio/1.2/types.hal @@ -32,6 +32,7 @@ import @1.0::GsmSignalStrength; import @1.0::LteSignalStrength; import @1.0::RadioConst; import @1.0::RadioError; +import @1.0::RegState; import @1.0::SignalStrength; import @1.0::TdScdmaSignalStrength; import @1.0::TimeStampType; @@ -462,3 +463,129 @@ struct SignalStrength { TdScdmaSignalStrength tdScdma; WcdmaSignalStrength wcdma; }; + +struct CellIdentity { + /** + * Cell type for selecting from union CellInfo. + * Only one of the below vectors must be of size 1 based on a + * valid CellInfoType and others must be of size 0. + * If cell info type is NONE, then all the vectors must be of size 0. + */ + CellInfoType cellInfoType; + vec cellIdentityGsm; + vec cellIdentityWcdma; + vec cellIdentityCdma; + vec cellIdentityLte; + vec cellIdentityTdscdma; +}; + +struct VoiceRegStateResult { + /** + * Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP, + * REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED, + * UNKNOWN, REG_ROAMING defined in RegState + */ + RegState regState; + /** + * Indicates the available voice radio technology, valid values as + * defined by RadioTechnology. + */ + int32_t rat; + /** + * concurrent services support indicator. if registered on a CDMA system. + * false - Concurrent services not supported, + * true - Concurrent services supported + */ + bool cssSupported; + /** + * TSB-58 Roaming Indicator if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + int32_t roamingIndicator; + /** + * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO system + * or -1 if not. 0=not in the PRL, 1=in the PRL + */ + int32_t systemIsInPrl; + /** + * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1 if not. + * Valid values are 0-255. + */ + int32_t defaultRoamingIndicator; + /** + * reasonForDenial if registration state is 3 + * (Registration denied) this is an enumerated reason why + * registration was denied. See 3GPP TS 24.008, + * 10.5.3.6 and Annex G. + * 0 - General + * 1 - Authentication Failure + * 2 - IMSI unknown in HLR + * 3 - Illegal MS + * 4 - Illegal ME + * 5 - PLMN not allowed + * 6 - Location area not allowed + * 7 - Roaming not allowed + * 8 - No Suitable Cells in this Location Area + * 9 - Network failure + * 10 - Persistent location update reject + * 11 - PLMN not allowed + * 12 - Location area not allowed + * 13 - Roaming not allowed in this Location Area + * 15 - No Suitable Cells in this Location Area + * 17 - Network Failure + * 20 - MAC Failure + * 21 - Sync Failure + * 22 - Congestion + * 23 - GSM Authentication unacceptable + * 25 - Not Authorized for this CSG + * 32 - Service option not supported + * 33 - Requested service option not subscribed + * 34 - Service option temporarily out of order + * 38 - Call cannot be identified + * 48-63 - Retry upon entry into a new cell + * 95 - Semantically incorrect message + * 96 - Invalid mandatory information + * 97 - Message type non-existent or not implemented + * 98 - Message type not compatible with protocol state + * 99 - Information element non-existent or not implemented + * 100 - Conditional IE error + * 101 - Message not compatible with protocol state + * 111 - Protocol error, unspecified + */ + int32_t reasonForDenial; + + CellIdentity cellIdentity; +}; + +struct DataRegStateResult { + /** + * Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP, + * REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED, + * UNKNOWN, REG_ROAMING defined in RegState + */ + RegState regState; + /** + * Indicates the available data radio technology, + * valid values as defined by RadioTechnology. + */ + int32_t rat; + /** + * If registration state is 3 (Registration + * denied) this is an enumerated reason why + * registration was denied. See 3GPP TS 24.008, + * Annex G.6 "Additional cause codes for GMM". + * 7 == GPRS services not allowed + * 8 == GPRS services and non-GPRS services not allowed + * 9 == MS identity cannot be derived by the network + * 10 == Implicitly detached + * 14 == GPRS services not allowed in this PLMN + * 16 == MSC temporarily not reachable + * 40 == No PDP context activated + */ + int32_t reasonDataDenied; + /** + * The maximum number of simultaneous Data Calls must be established using setupDataCall(). + */ + int32_t maxDataCalls; + CellIdentity cellIdentity; +}; 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 34a87e1316..ee130f8544 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp @@ -673,3 +673,40 @@ TEST_F(RadioHidlTest_v1_2, getCellInfoList_1_2) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, {RadioError::NONE, RadioError::NO_NETWORK_FOUND})); } + +/* + * Test IRadio.getVoiceRegistrationState() for the response returned. + */ +TEST_F(RadioHidlTest_v1_2, getVoiceRegistrationState) { + int serial = GetRandomSerialNumber(); + + Return res = radio_v1_2->getVoiceRegistrationState(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); + + ALOGI("getVoiceRegistrationStateResponse_1_2, rspInfo.error = %s\n", + toString(radioRsp_v1_2->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_2->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE})); +} + +/* + * Test IRadio.getDataRegistrationState() for the response returned. + */ +TEST_F(RadioHidlTest_v1_2, getDataRegistrationState) { + int serial = GetRandomSerialNumber(); + + Return res = radio_v1_2->getDataRegistrationState(serial); + ASSERT_OK(res); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); + + ALOGI("getVoiceRegistrationStateResponse_1_2, rspInfo.error = %s\n", + toString(radioRsp_v1_2->rspInfo.error).c_str()); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_v1_2->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::NOT_PROVISIONED})); +} 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 45fbd04411..ce46878a7a 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 @@ -416,6 +416,12 @@ class RadioResponse_v1_2 : public V1_1::IRadioResponse { Return getCellInfoListResponse_1_2( const RadioResponseInfo& info, const ::android::hardware::hidl_vec& cellInfo); + + Return getVoiceRegistrationStateResponse_1_2( + const RadioResponseInfo& info, const V1_2::VoiceRegStateResult& voiceRegResponse); + + Return getDataRegistrationStateResponse_1_2( + const RadioResponseInfo& info, const V1_2::DataRegStateResult& dataRegResponse); }; /* Callback class for radio indication */ diff --git a/radio/1.2/vts/functional/radio_response.cpp b/radio/1.2/vts/functional/radio_response.cpp index d96f76b417..9195689ca8 100644 --- a/radio/1.2/vts/functional/radio_response.cpp +++ b/radio/1.2/vts/functional/radio_response.cpp @@ -731,4 +731,14 @@ Return RadioResponse_v1_2::getCellInfoListResponse_1_2( rspInfo = info; parent_v1_2.notify(); return Void(); -} \ No newline at end of file +} + +Return RadioResponse_v1_2::getVoiceRegistrationStateResponse_1_2( + const RadioResponseInfo& /*info*/, const V1_2::VoiceRegStateResult& /*voiceRegResponse*/) { + return Void(); +} + +Return RadioResponse_v1_2::getDataRegistrationStateResponse_1_2( + const RadioResponseInfo& /*info*/, const V1_2::DataRegStateResult& /*dataRegResponse*/) { + return Void(); +}