Loading radio/1.6/IRadio.hal +64 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.hardware.radio@1.6; import @1.0::CdmaSmsMessage; import @1.0::GsmSmsMessage; import @1.2::DataRequestReason; import @1.5::IRadio; import @1.5::AccessNetwork; Loading Loading @@ -87,4 +90,65 @@ interface IRadio extends @1.5::IRadio { oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork, DataProfileInfo dataProfileInfo, bool roamingAllowed, DataRequestReason reason, vec<LinkAddress> addresses, vec<string> dnses); /** * Send an SMS message * * @param serial Serial number of request. * @param message GsmSmsMessage as defined in types.hal * * Response function is IRadioResponse.sendSmsResponse_1_6() * * Note this API is the same as the 1.0 * * Based on the return error, caller decides to resend if sending sms * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) */ oneway sendSms_1_6(int32_t serial, GsmSmsMessage message); /** * Send an SMS message. Identical to sendSms_1_6, * except that more messages are expected to be sent soon. If possible, * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command) * * @param serial Serial number of request. * @param message GsmSmsMessage as defined in types.hal * * Response function is IRadioResponse.sendSMSExpectMoreResponse_1_6() * * Note this API is the same as the 1.0 * * Based on the return error, caller decides to resend if sending sms * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) */ oneway sendSMSExpectMore_1_6(int32_t serial, GsmSmsMessage message); /** * Send a CDMA SMS message * * @param serial Serial number of request. * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal * * Response callback is IRadioResponse.sendCdmaSmsResponse_1_6() * * Note this API is the same as the 1.0 * */ oneway sendCdmaSms_1_6(int32_t serial, CdmaSmsMessage sms); /** * Send an SMS message. Identical to sendCdmaSms_1_6, * except that more messages are expected to be sent soon. * * @param serial Serial number of request. * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal * * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse_1_6() * * Note this API is the same as the 1.5 * */ oneway sendCdmaSmsExpectMore_1_6(int32_t serial, CdmaSmsMessage sms); }; radio/1.6/IRadioResponse.hal +135 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ package android.hardware.radio@1.6; import @1.0::RadioResponseInfo; import @1.0::SendSmsResult; import @1.6::RadioResponseInfo; import @1.5::IRadioResponse; import @1.6::SetupDataCallResult; Loading Loading @@ -54,4 +55,137 @@ interface IRadioResponse extends @1.5::IRadioResponse { * RadioError:SIM_ABSENT */ oneway getDataCallListResponse_1_6(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse); /** * @param info Response info struct containing response type, serial no. and error * @param sms Response to sms sent as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendSmsResponse_1_6(RadioResponseInfo info, SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error * @param sms Response to sms sent as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendSMSExpectMoreResponse_1_6(RadioResponseInfo info, SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error * @param sms Sms result struct as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:INVALID_ARGUMENTS * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:ENCODING_ERR * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendCdmaSmsResponse_1_6(RadioResponseInfo info, SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error * @param sms Response to sms sent as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendCdmaSmsExpectMoreResponse_1_6(RadioResponseInfo info, SendSmsResult sms); }; radio/1.6/types.hal +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.hardware.radio@1.6; import @1.0::RadioError; import @1.0::RadioResponseType; import @1.5::SetupDataCallResult; import android.hidl.safe_union@1.0::Monostate; Loading Loading @@ -98,6 +100,29 @@ enum QosPortRange : int32_t { MAX = 65535 }; enum RadioError : @1.0::RadioError { /** 1X voice and SMS are not allowed simulteneously. */ SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67, /** Access is barred. */ ACCESS_BARRED = 68, /** * SMS is blocked due to call control, e.g., resource unavailable * in the SMR entity. */ BLOCKED_DUE_TO_CALL = 69 }; /** * Overwritten from @1.0::RadioResponseInfo in order to update the RadioError to 1.6 version. */ struct RadioResponseInfo { RadioResponseType type; // Response type int32_t serial; // Serial number of the request RadioError error; // Response error }; /** * Defines range of ports. start and end are the first and last port numbers * (inclusive) in the range. Both start and end are in QosPortRange.MIN to Loading radio/1.6/vts/functional/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ cc_test { "radio_response.cpp", "radio_indication.cpp", "VtsHalRadioV1_6TargetTest.cpp", "vts_test_util_v1_6.cpp", ], static_libs: [ "RadioVtsTestUtilBase", Loading radio/1.6/vts/functional/radio_hidl_hal_api.cpp +159 −6 Original line number Diff line number Diff line Loading @@ -65,12 +65,165 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6) { EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); if (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error, {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::SIM_ABSENT, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } else if (cardStatus.base.base.base.cardState == CardState::PRESENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::NONE, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } } /* * Test IRadio_1_6.sendSms() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendSms_1_6) { LOG(DEBUG) << "sendSms"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; msg.pdu = "01000b916105770203f3000006d4f29c3e9b01"; radio_v1_6->sendSms(serial, msg); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); EXPECT_EQ(0, radioRsp_v1_6->sendSmsResult.errorCode); } LOG(DEBUG) << "sendSms finished"; } /* * Test IRadio_1_6.sendSMSExpectMore() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendSMSExpectMore_1_6) { LOG(DEBUG) << "sendSMSExpectMore"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; msg.pdu = "01000b916105770203f3000006d4f29c3e9b01"; radio_v1_6->sendSMSExpectMore(serial, msg); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } LOG(DEBUG) << "sendSMSExpectMore finished"; } /* * Test IRadio_1_6.sendCdmaSms() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendCdmaSms_1_6) { LOG(DEBUG) << "sendCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress CdmaSmsAddress cdmaSmsAddress; cdmaSmsAddress.digitMode = CdmaSmsDigitMode::FOUR_BIT; cdmaSmsAddress.numberMode = CdmaSmsNumberMode::NOT_DATA_NETWORK; cdmaSmsAddress.numberType = CdmaSmsNumberType::UNKNOWN; cdmaSmsAddress.numberPlan = CdmaSmsNumberPlan::UNKNOWN; cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; // Create a CdmaSmsSubAddress CdmaSmsSubaddress cdmaSmsSubaddress; cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddressType::NSAP; cdmaSmsSubaddress.odd = false; cdmaSmsSubaddress.digits = (std::vector<uint8_t>){}; // Create a CdmaSmsMessage android::hardware::radio::V1_0::CdmaSmsMessage cdmaSmsMessage; cdmaSmsMessage.teleserviceId = 4098; cdmaSmsMessage.isServicePresent = false; cdmaSmsMessage.serviceCategory = 0; cdmaSmsMessage.address = cdmaSmsAddress; cdmaSmsMessage.subAddress = cdmaSmsSubaddress; cdmaSmsMessage.bearerData = (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; radio_v1_6->sendCdmaSms(serial, cdmaSmsMessage); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } LOG(DEBUG) << "sendCdmaSms finished"; } /* * Test IRadio_1_6.sendCdmaSmsExpectMore() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendCdmaSmsExpectMore_1_6) { serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress CdmaSmsAddress cdmaSmsAddress; cdmaSmsAddress.digitMode = CdmaSmsDigitMode::FOUR_BIT; cdmaSmsAddress.numberMode = CdmaSmsNumberMode::NOT_DATA_NETWORK; cdmaSmsAddress.numberType = CdmaSmsNumberType::UNKNOWN; cdmaSmsAddress.numberPlan = CdmaSmsNumberPlan::UNKNOWN; cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; // Create a CdmaSmsSubAddress CdmaSmsSubaddress cdmaSmsSubaddress; cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddressType::NSAP; cdmaSmsSubaddress.odd = false; cdmaSmsSubaddress.digits = (std::vector<uint8_t>){}; // Create a CdmaSmsMessage android::hardware::radio::V1_0::CdmaSmsMessage cdmaSmsMessage; cdmaSmsMessage.teleserviceId = 4098; cdmaSmsMessage.isServicePresent = false; cdmaSmsMessage.serviceCategory = 0; cdmaSmsMessage.address = cdmaSmsAddress; cdmaSmsMessage.subAddress = cdmaSmsSubaddress; cdmaSmsMessage.bearerData = (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; radio_v1_6->sendCdmaSmsExpectMore(serial, cdmaSmsMessage); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } } Loading
radio/1.6/IRadio.hal +64 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.hardware.radio@1.6; import @1.0::CdmaSmsMessage; import @1.0::GsmSmsMessage; import @1.2::DataRequestReason; import @1.5::IRadio; import @1.5::AccessNetwork; Loading Loading @@ -87,4 +90,65 @@ interface IRadio extends @1.5::IRadio { oneway setupDataCall_1_6(int32_t serial, AccessNetwork accessNetwork, DataProfileInfo dataProfileInfo, bool roamingAllowed, DataRequestReason reason, vec<LinkAddress> addresses, vec<string> dnses); /** * Send an SMS message * * @param serial Serial number of request. * @param message GsmSmsMessage as defined in types.hal * * Response function is IRadioResponse.sendSmsResponse_1_6() * * Note this API is the same as the 1.0 * * Based on the return error, caller decides to resend if sending sms * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) */ oneway sendSms_1_6(int32_t serial, GsmSmsMessage message); /** * Send an SMS message. Identical to sendSms_1_6, * except that more messages are expected to be sent soon. If possible, * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command) * * @param serial Serial number of request. * @param message GsmSmsMessage as defined in types.hal * * Response function is IRadioResponse.sendSMSExpectMoreResponse_1_6() * * Note this API is the same as the 1.0 * * Based on the return error, caller decides to resend if sending sms * fails. RadioError:SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) * and RadioError:GENERIC_FAILURE means no retry (i.e. error cause is 500) */ oneway sendSMSExpectMore_1_6(int32_t serial, GsmSmsMessage message); /** * Send a CDMA SMS message * * @param serial Serial number of request. * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal * * Response callback is IRadioResponse.sendCdmaSmsResponse_1_6() * * Note this API is the same as the 1.0 * */ oneway sendCdmaSms_1_6(int32_t serial, CdmaSmsMessage sms); /** * Send an SMS message. Identical to sendCdmaSms_1_6, * except that more messages are expected to be sent soon. * * @param serial Serial number of request. * @param sms Cdma Sms to be sent described by CdmaSmsMessage in types.hal * * Response callback is IRadioResponse.sendCdmaSMSExpectMoreResponse_1_6() * * Note this API is the same as the 1.5 * */ oneway sendCdmaSmsExpectMore_1_6(int32_t serial, CdmaSmsMessage sms); };
radio/1.6/IRadioResponse.hal +135 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ package android.hardware.radio@1.6; import @1.0::RadioResponseInfo; import @1.0::SendSmsResult; import @1.6::RadioResponseInfo; import @1.5::IRadioResponse; import @1.6::SetupDataCallResult; Loading Loading @@ -54,4 +55,137 @@ interface IRadioResponse extends @1.5::IRadioResponse { * RadioError:SIM_ABSENT */ oneway getDataCallListResponse_1_6(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse); /** * @param info Response info struct containing response type, serial no. and error * @param sms Response to sms sent as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendSmsResponse_1_6(RadioResponseInfo info, SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error * @param sms Response to sms sent as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendSMSExpectMoreResponse_1_6(RadioResponseInfo info, SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error * @param sms Sms result struct as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:INVALID_ARGUMENTS * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:INTERNAL_ERR * RadioError:SYSTEM_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:OPERATION_NOT_ALLOWED * RadioError:ENCODING_ERR * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendCdmaSmsResponse_1_6(RadioResponseInfo info, SendSmsResult sms); /** * @param info Response info struct containing response type, serial no. and error * @param sms Response to sms sent as defined by SendSmsResult in types.hal * * Valid errors returned: * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:SMS_SEND_FAIL_RETRY * RadioError:NETWORK_REJECT * RadioError:INVALID_STATE * RadioError:INVALID_ARGUMENTS * RadioError:NO_MEMORY * RadioError:REQUEST_RATE_LIMITED * RadioError:INVALID_SMS_FORMAT * RadioError:SYSTEM_ERR * RadioError:FDN_CHECK_FAILURE * RadioError:ENCODING_ERR * RadioError:INVALID_SMSC_ADDRESS * RadioError:MODEM_ERR * RadioError:NETWORK_ERR * RadioError:INTERNAL_ERR * RadioError:REQUEST_NOT_SUPPORTED * RadioError:INVALID_MODEM_STATE * RadioError:NETWORK_NOT_READY * RadioError:OPERATION_NOT_ALLOWED * RadioError:NO_RESOURCES * RadioError:CANCELLED * RadioError:SIM_ABSENT * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED * RadioError:ACCESS_BARRED * RadioError:BLOCKED_DUE_TO_CALL */ oneway sendCdmaSmsExpectMoreResponse_1_6(RadioResponseInfo info, SendSmsResult sms); };
radio/1.6/types.hal +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.hardware.radio@1.6; import @1.0::RadioError; import @1.0::RadioResponseType; import @1.5::SetupDataCallResult; import android.hidl.safe_union@1.0::Monostate; Loading Loading @@ -98,6 +100,29 @@ enum QosPortRange : int32_t { MAX = 65535 }; enum RadioError : @1.0::RadioError { /** 1X voice and SMS are not allowed simulteneously. */ SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED = 67, /** Access is barred. */ ACCESS_BARRED = 68, /** * SMS is blocked due to call control, e.g., resource unavailable * in the SMR entity. */ BLOCKED_DUE_TO_CALL = 69 }; /** * Overwritten from @1.0::RadioResponseInfo in order to update the RadioError to 1.6 version. */ struct RadioResponseInfo { RadioResponseType type; // Response type int32_t serial; // Serial number of the request RadioError error; // Response error }; /** * Defines range of ports. start and end are the first and last port numbers * (inclusive) in the range. Both start and end are in QosPortRange.MIN to Loading
radio/1.6/vts/functional/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ cc_test { "radio_response.cpp", "radio_indication.cpp", "VtsHalRadioV1_6TargetTest.cpp", "vts_test_util_v1_6.cpp", ], static_libs: [ "RadioVtsTestUtilBase", Loading
radio/1.6/vts/functional/radio_hidl_hal_api.cpp +159 −6 Original line number Diff line number Diff line Loading @@ -65,12 +65,165 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6) { EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); if (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error, {RadioError::SIM_ABSENT, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::SIM_ABSENT, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } else if (cardStatus.base.base.base.cardState == CardState::PRESENT) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_6->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::NONE, ::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE, ::android::hardware::radio::V1_6::RadioError::OP_NOT_ALLOWED_BEFORE_REG_TO_NW})); } } /* * Test IRadio_1_6.sendSms() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendSms_1_6) { LOG(DEBUG) << "sendSms"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; msg.pdu = "01000b916105770203f3000006d4f29c3e9b01"; radio_v1_6->sendSms(serial, msg); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); EXPECT_EQ(0, radioRsp_v1_6->sendSmsResult.errorCode); } LOG(DEBUG) << "sendSms finished"; } /* * Test IRadio_1_6.sendSMSExpectMore() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendSMSExpectMore_1_6) { LOG(DEBUG) << "sendSMSExpectMore"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; msg.pdu = "01000b916105770203f3000006d4f29c3e9b01"; radio_v1_6->sendSMSExpectMore(serial, msg); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } LOG(DEBUG) << "sendSMSExpectMore finished"; } /* * Test IRadio_1_6.sendCdmaSms() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendCdmaSms_1_6) { LOG(DEBUG) << "sendCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress CdmaSmsAddress cdmaSmsAddress; cdmaSmsAddress.digitMode = CdmaSmsDigitMode::FOUR_BIT; cdmaSmsAddress.numberMode = CdmaSmsNumberMode::NOT_DATA_NETWORK; cdmaSmsAddress.numberType = CdmaSmsNumberType::UNKNOWN; cdmaSmsAddress.numberPlan = CdmaSmsNumberPlan::UNKNOWN; cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; // Create a CdmaSmsSubAddress CdmaSmsSubaddress cdmaSmsSubaddress; cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddressType::NSAP; cdmaSmsSubaddress.odd = false; cdmaSmsSubaddress.digits = (std::vector<uint8_t>){}; // Create a CdmaSmsMessage android::hardware::radio::V1_0::CdmaSmsMessage cdmaSmsMessage; cdmaSmsMessage.teleserviceId = 4098; cdmaSmsMessage.isServicePresent = false; cdmaSmsMessage.serviceCategory = 0; cdmaSmsMessage.address = cdmaSmsAddress; cdmaSmsMessage.subAddress = cdmaSmsSubaddress; cdmaSmsMessage.bearerData = (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; radio_v1_6->sendCdmaSms(serial, cdmaSmsMessage); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } LOG(DEBUG) << "sendCdmaSms finished"; } /* * Test IRadio_1_6.sendCdmaSmsExpectMore() for the response returned. */ TEST_P(RadioHidlTest_v1_6, sendCdmaSmsExpectMore_1_6) { serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress CdmaSmsAddress cdmaSmsAddress; cdmaSmsAddress.digitMode = CdmaSmsDigitMode::FOUR_BIT; cdmaSmsAddress.numberMode = CdmaSmsNumberMode::NOT_DATA_NETWORK; cdmaSmsAddress.numberType = CdmaSmsNumberType::UNKNOWN; cdmaSmsAddress.numberPlan = CdmaSmsNumberPlan::UNKNOWN; cdmaSmsAddress.digits = (std::vector<uint8_t>){11, 1, 6, 5, 10, 7, 7, 2, 10, 3, 10, 3}; // Create a CdmaSmsSubAddress CdmaSmsSubaddress cdmaSmsSubaddress; cdmaSmsSubaddress.subaddressType = CdmaSmsSubaddressType::NSAP; cdmaSmsSubaddress.odd = false; cdmaSmsSubaddress.digits = (std::vector<uint8_t>){}; // Create a CdmaSmsMessage android::hardware::radio::V1_0::CdmaSmsMessage cdmaSmsMessage; cdmaSmsMessage.teleserviceId = 4098; cdmaSmsMessage.isServicePresent = false; cdmaSmsMessage.serviceCategory = 0; cdmaSmsMessage.address = cdmaSmsAddress; cdmaSmsMessage.subAddress = cdmaSmsSubaddress; cdmaSmsMessage.bearerData = (std::vector<uint8_t>){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; radio_v1_6->sendCdmaSmsExpectMore(serial, cdmaSmsMessage); 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 (cardStatus.base.base.base.cardState == CardState::ABSENT) { ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_6->rspInfo.error, {::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS, ::android::hardware::radio::V1_6::RadioError::INVALID_STATE, ::android::hardware::radio::V1_6::RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } }