diff --git a/services/hril/include/hril_base.h b/services/hril/include/hril_base.h index 1b6584296a2bb4265f2fa00926b1a9012a411b9d..2cc1c6beba75034ba3dc513362cb95755004cea5 100644 --- a/services/hril/include/hril_base.h +++ b/services/hril/include/hril_base.h @@ -151,11 +151,11 @@ template int32_t HRilBase::ProcessResponse( int32_t code, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - using RespFunc = int32_t (T::*)(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo, + using RespFunc = int32_t (*)(T * stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo & responseInfo, const void *response, size_t responseLen); auto func = GetFunc(respMemberFuncMap_, code); if (func != nullptr) { - return (static_cast(this)->*func)(code, responseInfo, response, responseLen); + return func(static_cast(this), code, responseInfo, response, responseLen); } return HRIL_ERR_INVALID_PARAMETER; } @@ -167,12 +167,13 @@ int32_t HRilBase::ProcessNotify( if (reportInfo == nullptr) { return HRIL_ERR_INVALID_PARAMETER; } - using NotiFunc = int32_t (T::*)(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + using NotiFunc = + int32_t (*)(T * stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); int32_t code = reportInfo->notifyId; HRilErrNumber error = (HRilErrNumber)reportInfo->error; auto func = GetFunc(notiMemberFuncMap_, code); if (func != nullptr) { - return (static_cast(this)->*func)(notifyType, error, response, responseLen); + return func(static_cast(this), notifyType, error, response, responseLen); } return HRIL_ERR_INVALID_PARAMETER; } diff --git a/services/hril/include/hril_call.h b/services/hril/include/hril_call.h index 2934fd2065d9ae01680c72f0e6c09d06f6b96df8..e34d8efbc12c884ee2c4d18cc500a361512ee5e1 100644 --- a/services/hril/include/hril_call.h +++ b/services/hril/include/hril_call.h @@ -68,88 +68,95 @@ public: bool IsCallNotification(uint32_t code); int32_t SetVonrSwitch(int32_t serialId, int32_t status); - int32_t GetCallListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t DialResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, - size_t responseLen); - int32_t HangupResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t RejectResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t HoldCallResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UnHoldCallResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SwitchCallResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetLastCallErrorCodeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t AnswerResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetClipResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetClipResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t CombineConferenceResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SeparateConferenceResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t CallSupplementResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCallWaitingResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetCallWaitingResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCallTransferInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetCallTransferInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCallRestrictionResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetCallRestrictionResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetClirResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetClirResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t StartDtmfResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SendDtmfResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t StopDtmfResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCallPreferenceModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetCallPreferenceModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetUssdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetUssdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetMuteResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetMuteResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetEmergencyCallListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCallFailReasonResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetEmergencyCallListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetBarringPasswordResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t CloseUnFinishedUssdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetVonrSwitchResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + static int32_t GetCallListResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t DialResponse(HRilCall *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t HangupResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t RejectResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t HoldCallResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UnHoldCallResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SwitchCallResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetLastCallErrorCodeResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t AnswerResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetClipResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetClipResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t CombineConferenceResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SeparateConferenceResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t CallSupplementResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCallWaitingResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetCallWaitingResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCallTransferInfoResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetCallTransferInfoResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCallRestrictionResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetCallRestrictionResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetClirResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetClirResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t StartDtmfResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SendDtmfResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t StopDtmfResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCallPreferenceModeResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetCallPreferenceModeResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetUssdResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetUssdResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetMuteResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetMuteResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetEmergencyCallListResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCallFailReasonResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetEmergencyCallListResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetBarringPasswordResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t CloseUnFinishedUssdResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetVonrSwitchResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t CallStateUpdated(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CallUssdNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CallRingbackVoiceNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CallSrvccStatusNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CallEmergencyNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CallSsNotice(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CallRsrvccStatusNotify(int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallStateUpdated( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallUssdNotice( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallRingbackVoiceNotice( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallSrvccStatusNotice( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallEmergencyNotice( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallSsNotice( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CallRsrvccStatusNotify( + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen); void BuildICallList( HDI::Ril::V1_1::CallInfoList &callInfoList, const void *response, size_t responseLen); void BuildIEmergencyCallList( diff --git a/services/hril/include/hril_data.h b/services/hril/include/hril_data.h index 78ad4aed5f814db1dcd985fffe97ca6cf679f435..564d0cc0d000fe5baeeefef03a6698514bd17c0b 100644 --- a/services/hril/include/hril_data.h +++ b/services/hril/include/hril_data.h @@ -32,41 +32,41 @@ public: int32_t SendDataPerformanceMode( int32_t serialId, const OHOS::HDI::Ril::V1_1::DataPerformanceInfo &dataPerformanceInfo); int32_t SendDataSleepMode(int32_t serialId, const OHOS::HDI::Ril::V1_1::DataSleepInfo &dataSleepInfo); - int32_t ActivatePdpContextResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t DeactivatePdpContextResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetPdpContextListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetInitApnInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t PdpContextListUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t DataLinkCapabilityUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t ActivatePdpContextResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t DeactivatePdpContextResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetPdpContextListResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetInitApnInfoResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t PdpContextListUpdated( + HRilData *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t DataLinkCapabilityUpdated( + HRilData *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); int32_t ProcessDataResponse( int32_t code, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); int32_t ProcessDataRequest(int32_t code, struct HdfSBuf *data); int32_t ProcessDataNotify(const struct ReportInfo *reportInfo, const void *response, size_t responseLen); int32_t GetLinkCapability(int32_t serialId); - int32_t GetLinkCapabilityResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t GetLinkCapabilityResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); int32_t GetLinkBandwidthInfo(int32_t serialId, int32_t cid); - int32_t GetLinkBandwidthInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t GetLinkBandwidthInfoResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); int32_t SetLinkBandwidthReportingRule( int32_t serialId, const OHOS::HDI::Ril::V1_1::DataLinkBandwidthReportingRule &linkBandwidthRule); - int32_t SetLinkBandwidthReportingRuleResponse(int32_t requestNum, + static int32_t SetLinkBandwidthReportingRuleResponse(HRilData *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); int32_t SetDataProfileInfo(int32_t serialId, const OHOS::HDI::Ril::V1_1::DataProfilesInfo &dataProfilesInfo); - int32_t SetDataProfileInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t SetDataProfileInfoResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); int32_t SetDataPermitted(int32_t serialId, int32_t dataPermitted); - int32_t SetDataPermittedResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t SetDataPermittedResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); int32_t CleanAllConnections(int32_t serialId); - int32_t CleanAllConnectionsResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t CleanAllConnectionsResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); bool IsDataRespOrNotify(uint32_t code); bool IsDataResponse(uint32_t code); diff --git a/services/hril/include/hril_modem.h b/services/hril/include/hril_modem.h index 0ce15201d8d49de0118eb10b34f230e95bfc4be6..5d71cab73adda3d4a3d72726310ebd9ffaac8c69 100644 --- a/services/hril/include/hril_modem.h +++ b/services/hril/include/hril_modem.h @@ -33,25 +33,28 @@ public: int32_t GetMeid(int32_t serialId); int32_t GetVoiceRadioTechnology(int32_t serialId); int32_t GetBasebandVersion(int32_t serialId); - int32_t ShutDownResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetRadioStateResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetRadioStateResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetImeiResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetImeiSvResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetMeidResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetVoiceRadioTechnologyResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetBasebandVersionResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t RadioStateUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t VoiceRadioTechUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t DsdsModeUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t ShutDownResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetRadioStateResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetRadioStateResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetImeiResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetImeiSvResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetMeidResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetVoiceRadioTechnologyResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetBasebandVersionResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t RadioStateUpdated( + HRilModem *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t VoiceRadioTechUpdated( + HRilModem *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t DsdsModeUpdated( + HRilModem *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); void AddHandlerToMap(); bool IsModemRespOrNotify(uint32_t code); void RegisterModemFuncs(const HRilModemReq *modemFuncs); diff --git a/services/hril/include/hril_network.h b/services/hril/include/hril_network.h index c2ce93dc819d43ee497c34682d3f15fb22811d9d..e2f00feafad87ebc99665dcc44275b3f8ae71614 100644 --- a/services/hril/include/hril_network.h +++ b/services/hril/include/hril_network.h @@ -45,69 +45,75 @@ public: int32_t GetRrcConnectionState(int32_t serialId); int32_t GetNrSsbId(int32_t serialId); - int32_t GetSignalStrengthResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCsRegStatusResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetPsRegStatusResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetOperatorInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetNetworkSearchInformationResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetNetworkSelectionModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetNetworkSelectionModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetPreferredNetworkResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetPreferredNetworkResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetNeighboringCellInfoListResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetNeighboringCellInfoListResponse_1_2(int32_t requestNum, + static int32_t GetSignalStrengthResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCsRegStatusResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetPsRegStatusResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetOperatorInfoResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetNetworkSearchInformationResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetNetworkSelectionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetNetworkSelectionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetPreferredNetworkResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetPreferredNetworkResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetNeighboringCellInfoListResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetNeighboringCellInfoListResponse_1_2(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCurrentCellInfoResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCurrentCellInfoResponse_1_1(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCurrentCellInfoResponse_1_2(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetPhysicalChannelConfigResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetLocateUpdatesResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetNotificationFilterResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetDeviceStateResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetNrOptionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetNrOptionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetRrcConnectionStateResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetNrSsbIdResponse(HRilNetwork *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t GetCurrentCellInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCurrentCellInfoResponse_1_1(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCurrentCellInfoResponse_1_2(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetPhysicalChannelConfigResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetLocateUpdatesResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetNotificationFilterResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetDeviceStateResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetNrOptionModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetNrOptionModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetRrcConnectionStateResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetNrSsbIdResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t NetworkCsRegStatusUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkPsRegStatusUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t SignalStrengthUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkTimeUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkTimeZoneUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkPhyChnlCfgUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkCurrentCellUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t GetRrcConnectionStateUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkCurrentCellUpdated_1_1( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t NetworkCurrentCellUpdated_1_2( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkCsRegStatusUpdated( + HRilNetwork *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkPsRegStatusUpdated( + HRilNetwork *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SignalStrengthUpdated( + HRilNetwork *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkTimeUpdated( + HRilNetwork *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkTimeZoneUpdated( + HRilNetwork *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkPhyChnlCfgUpdated( + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkCurrentCellUpdated( + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t GetRrcConnectionStateUpdated( + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkCurrentCellUpdated_1_1( + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NetworkCurrentCellUpdated_1_2( + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen); void RegisterNetworkFuncs(const HRilNetworkReq *networkFuncs); bool IsNetworkRespOrNotify(uint32_t code); - int32_t ResidentNetworkUpdated(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t ResidentNetworkUpdated( + HRilNetwork *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); private: void AddHandlerToMap(); diff --git a/services/hril/include/hril_sim.h b/services/hril/include/hril_sim.h index 873401f3257b2a737bcd416e1c11557db7680182..ff9deae82dcfb970f79553b8f1712b90df9464fd 100644 --- a/services/hril/include/hril_sim.h +++ b/services/hril/include/hril_sim.h @@ -61,69 +61,73 @@ public: private: void AddHandlerToMap(); void AddNotificationHandlerToMap(); - int32_t GetSimIOResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetSimCardStatusResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetImsiResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetSimLockStatusResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetSimLockResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t ChangeSimPasswordResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UnlockPinResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UnlockPukResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UnlockPin2Response(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UnlockPuk2Response(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetActiveSimResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimStkSendTerminalResponseResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimStkSendEnvelopeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimStkSendCallSetupRequestResultResponse(int32_t requestNum, + static int32_t GetSimIOResponse(HRilSim *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t SimStkIsReadyResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetRadioProtocolResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetRadioProtocolResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimOpenLogicalChannelResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimCloseLogicalChannelResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimTransmitApduLogicalChannelResponse(int32_t requestNum, + static int32_t GetSimCardStatusResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetImsiResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetSimLockStatusResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetSimLockResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t ChangeSimPasswordResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UnlockPinResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UnlockPukResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UnlockPin2Response(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UnlockPuk2Response(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetActiveSimResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimStkSendTerminalResponseResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimStkSendEnvelopeResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimStkSendCallSetupRequestResultResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimStkIsReadyResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetRadioProtocolResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetRadioProtocolResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimOpenLogicalChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimCloseLogicalChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimTransmitApduLogicalChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimTransmitApduBasicChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SimAuthenticationResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UnlockSimLockResponse(HRilSim *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t SimTransmitApduBasicChannelResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SimAuthenticationResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UnlockSimLockResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); HDI::Ril::V1_1::IccIoResultInfo ProcessIccIoResponse(HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t SendSimMatchedOperatorInfoResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t SendSimMatchedOperatorInfoResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t SimStateUpdated(int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimStkSessionEndNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimStkProactiveNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimStkAlphaNotify(int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimStkEventNotify(int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimStkCallSetupNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimRefreshNotify(int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); - int32_t SimRadioProtocolUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimStateUpdated( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimStkSessionEndNotify( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimStkProactiveNotify( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimStkAlphaNotify( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimStkEventNotify( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimStkCallSetupNotify( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimRefreshNotify( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SimRadioProtocolUpdated( + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen); private: bool IsSimResponse(uint32_t code); diff --git a/services/hril/include/hril_sms.h b/services/hril/include/hril_sms.h index 5042fe255bf8aeebea8c78e1db556100383a9f4d..f5b2f397f0a5c57713e37abd0a95f5c95f8fe095 100644 --- a/services/hril/include/hril_sms.h +++ b/services/hril/include/hril_sms.h @@ -45,44 +45,49 @@ public: int32_t DelCdmaSimMessage(int32_t serialId, int32_t index); int32_t UpdateCdmaSimMessage(int32_t serialId, const OHOS::HDI::Ril::V1_1::SmsMessageIOInfo &smsMessageIOInfo); - int32_t SendGsmSmsResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SendCdmaSmsResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t AddSimMessageResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t DelSimMessageResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UpdateSimMessageResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetSmscAddrResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetSmscAddrResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetCBConfigResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCBConfigResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SetCdmaCBConfigResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t GetCdmaCBConfigResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SendSmsMoreModeResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t SendSmsAckResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t AddCdmaSimMessageResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t DelCdmaSimMessageResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); - int32_t UpdateCdmaSimMessageResponse(int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, - const void *response, size_t responseLen); + static int32_t SendGsmSmsResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SendCdmaSmsResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t AddSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t DelSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UpdateSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetSmscAddrResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetSmscAddrResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SetCdmaCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t GetCdmaCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SendSmsMoreModeResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t SendSmsAckResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t AddCdmaSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t DelCdmaSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); + static int32_t UpdateCdmaSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen); - int32_t SmsStatusReportNotify(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NewSmsStoredOnSimNotify(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NewSmsNotify(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t NewCdmaSmsNotify(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); - int32_t CBConfigNotify(int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t SmsStatusReportNotify( + HRilSms *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NewSmsStoredOnSimNotify( + HRilSms *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NewSmsNotify( + HRilSms *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t NewCdmaSmsNotify( + HRilSms *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); + static int32_t CBConfigNotify( + HRilSms *stub, int32_t indType, HRilErrNumber error, const void *response, size_t responseLen); private: void AddHandlerToMap(); diff --git a/services/hril/src/hril_call.cpp b/services/hril/src/hril_call.cpp index 569fdf0b71a9de99e9d70d3472683562f7fad5e1..e5042a53a8a75699f836261d42c4ccad5ac7d134 100644 --- a/services/hril/src/hril_call.cpp +++ b/services/hril/src/hril_call.cpp @@ -341,53 +341,74 @@ void HRilCall::BuildICallList( } } -int32_t HRilCall::GetCallListResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetCallListResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilCallInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::CallInfoList callList = {}; if (response != nullptr) { - BuildICallList(callList, response, responseLen); + stub->BuildICallList(callList, response, responseLen); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallListResponse, callList); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallListResponse, callList); } -int32_t HRilCall::DialResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::DialResponse(HRilCall *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DialResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DialResponse); } -int32_t HRilCall::HangupResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::HangupResponse(HRilCall *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::HangupResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::HangupResponse); } -int32_t HRilCall::RejectResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::RejectResponse(HRilCall *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::RejectResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::RejectResponse); } -int32_t HRilCall::AnswerResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::AnswerResponse(HRilCall *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::AnswerResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::AnswerResponse); } -int32_t HRilCall::HoldCallResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::HoldCallResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::HoldCallResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::HoldCallResponse); } -int32_t HRilCall::GetClipResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetClipResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilGetClipResult)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -399,48 +420,69 @@ int32_t HRilCall::GetClipResponse( getClipResult.action = pGetClip->action; getClipResult.clipStat = pGetClip->clipStat; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetClipResponse, getClipResult); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetClipResponse, getClipResult); } -int32_t HRilCall::SetClipResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetClipResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetClipResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetClipResponse); } -int32_t HRilCall::UnHoldCallResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::UnHoldCallResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnHoldCallResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnHoldCallResponse); } -int32_t HRilCall::SwitchCallResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SwitchCallResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SwitchCallResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SwitchCallResponse); } -int32_t HRilCall::CombineConferenceResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::CombineConferenceResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::CombineConferenceResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::CombineConferenceResponse); } -int32_t HRilCall::SeparateConferenceResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SeparateConferenceResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SeparateConferenceResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SeparateConferenceResponse); } -int32_t HRilCall::CallSupplementResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::CallSupplementResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::CallSupplementResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::CallSupplementResponse); } -int32_t HRilCall::GetCallWaitingResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetCallWaitingResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilCallWaitResult)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -452,27 +494,33 @@ int32_t HRilCall::GetCallWaitingResponse( callWaitResult.status = result->status; callWaitResult.classCw = result->classCw; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallWaitingResponse, callWaitResult); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallWaitingResponse, callWaitResult); } -int32_t HRilCall::SetCallWaitingResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetCallWaitingResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallWaitingResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallWaitingResponse); } -int32_t HRilCall::GetCallTransferInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetCallTransferInfoResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilCFQueryInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::CallForwardQueryInfoList cFQueryList = {}; if (response != nullptr) { - BuildICallForwardQueryInfoList(cFQueryList, responseInfo, response, responseLen); + stub->BuildICallForwardQueryInfoList(cFQueryList, responseInfo, response, responseLen); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallTransferInfoResponse, cFQueryList); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallTransferInfoResponse, cFQueryList); } void HRilCall::BuildICallForwardQueryInfoList(HDI::Ril::V1_1::CallForwardQueryInfoList &cFQueryList, @@ -500,15 +548,21 @@ void HRilCall::BuildICallForwardQueryInfoList(HDI::Ril::V1_1::CallForwardQueryIn } } -int32_t HRilCall::SetCallTransferInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetCallTransferInfoResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallTransferInfoResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallTransferInfoResponse); } -int32_t HRilCall::GetClirResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetClirResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilGetCallClirResult)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -520,18 +574,24 @@ int32_t HRilCall::GetClirResponse( getClirResult.action = pGetClir->action; getClirResult.clirStat = pGetClir->clirStat; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetClirResponse, getClirResult); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetClirResponse, getClirResult); } -int32_t HRilCall::SetClirResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetClirResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetClirResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetClirResponse); } -int32_t HRilCall::GetCallRestrictionResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetCallRestrictionResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilCallRestrictionResult)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -543,42 +603,60 @@ int32_t HRilCall::GetCallRestrictionResponse( resultT.status = result->status; resultT.classCw = result->classCw; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallRestrictionResponse, resultT); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallRestrictionResponse, resultT); } -int32_t HRilCall::SetCallRestrictionResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetCallRestrictionResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallRestrictionResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallRestrictionResponse); } -int32_t HRilCall::SetBarringPasswordResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetBarringPasswordResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetBarringPasswordResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetBarringPasswordResponse); } -int32_t HRilCall::StartDtmfResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::StartDtmfResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::StartDtmfResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::StartDtmfResponse); } -int32_t HRilCall::SendDtmfResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SendDtmfResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendDtmfResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendDtmfResponse); } -int32_t HRilCall::StopDtmfResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::StopDtmfResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::StopDtmfResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::StopDtmfResponse); } -int32_t HRilCall::GetCallPreferenceModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetCallPreferenceModeResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -587,24 +665,33 @@ int32_t HRilCall::GetCallPreferenceModeResponse( if (response != nullptr) { mode = *((int32_t *)response); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallPreferenceModeResponse, mode); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallPreferenceModeResponse, mode); } -int32_t HRilCall::SetCallPreferenceModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetCallPreferenceModeResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallPreferenceModeResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCallPreferenceModeResponse); } -int32_t HRilCall::SetUssdResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetUssdResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetUssdResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetUssdResponse); } -int32_t HRilCall::GetMuteResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetMuteResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -613,18 +700,24 @@ int32_t HRilCall::GetMuteResponse( if (response != nullptr) { mute = *((int32_t *)response); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetMuteResponse, mute); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetMuteResponse, mute); } -int32_t HRilCall::SetMuteResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetMuteResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetMuteResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetMuteResponse); } -int32_t HRilCall::GetUssdResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetUssdResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -633,12 +726,15 @@ int32_t HRilCall::GetUssdResponse( if (response != nullptr) { cusd = *((int32_t *)response); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetUssdResponse, cusd); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetUssdResponse, cusd); } -int32_t HRilCall::GetCallFailReasonResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetCallFailReasonResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -647,7 +743,7 @@ int32_t HRilCall::GetCallFailReasonResponse( if (response != nullptr) { callFail = *((int32_t *)response); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallFailReasonResponse, callFail); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCallFailReasonResponse, callFail); } void HRilCall::BuildIEmergencyCallList( @@ -674,18 +770,21 @@ void HRilCall::BuildIEmergencyCallList( } } -int32_t HRilCall::GetEmergencyCallListResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::GetEmergencyCallListResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilEmergencyInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::EmergencyInfoList callList = {}; if (response != nullptr) { - BuildIEmergencyCallList(callList, response, responseLen); + stub->BuildIEmergencyCallList(callList, response, responseLen); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetEmergencyCallListResponse, callList); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetEmergencyCallListResponse, callList); } int32_t HRilCall::SetEmergencyCallList( @@ -725,33 +824,48 @@ void HRilCall::CopyToHRilEmergencyInfoArray( } } -int32_t HRilCall::SetEmergencyCallListResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetEmergencyCallListResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetEmergencyCallListResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetEmergencyCallListResponse); } -int32_t HRilCall::CloseUnFinishedUssdResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::CloseUnFinishedUssdResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::CloseUnFinishedUssdResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::CloseUnFinishedUssdResponse); } -int32_t HRilCall::SetVonrSwitchResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilCall::SetVonrSwitchResponse(HRilCall *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetVonrSwitchResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetVonrSwitchResponse); } int32_t HRilCall::CallStateUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilCall *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallStateUpdated); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallStateUpdated); } int32_t HRilCall::CallUssdNotice( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilCall *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr) || (responseLen % sizeof(HRilUssdNoticeInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -760,11 +874,15 @@ int32_t HRilCall::CallUssdNotice( const HRilUssdNoticeInfo *hUssdNoticeInfo = reinterpret_cast(response); ussdNoticeInfo.type = hUssdNoticeInfo->m; ussdNoticeInfo.message = hUssdNoticeInfo->str == nullptr ? "" : hUssdNoticeInfo->str; - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallUssdNotice, ussdNoticeInfo); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallUssdNotice, ussdNoticeInfo); } -int32_t HRilCall::CallSsNotice(int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) +int32_t HRilCall::CallSsNotice( + HRilCall *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr) || (responseLen % sizeof(HRilSsNoticeInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -775,12 +893,15 @@ int32_t HRilCall::CallSsNotice(int32_t notifyType, const HRilErrNumber error, co ssNoticeInfo.requestType = hSsNoticeInfo->requestType; ssNoticeInfo.serviceClass = hSsNoticeInfo->serviceClass; ssNoticeInfo.result = hSsNoticeInfo->result; - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallSsNotice, ssNoticeInfo); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallSsNotice, ssNoticeInfo); } int32_t HRilCall::CallSrvccStatusNotice( - int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen) + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr) || (responseLen % sizeof(HRilCallSrvccStatus)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -788,12 +909,15 @@ int32_t HRilCall::CallSrvccStatusNotice( HDI::Ril::V1_1::SrvccStatus srvccStatus = {}; const HRilCallSrvccStatus *hSrvccStatus = reinterpret_cast(response); srvccStatus.status = hSrvccStatus->status; - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallSrvccStatusNotice, srvccStatus); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallSrvccStatusNotice, srvccStatus); } int32_t HRilCall::CallRingbackVoiceNotice( - int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen) + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -801,25 +925,31 @@ int32_t HRilCall::CallRingbackVoiceNotice( HDI::Ril::V1_1::RingbackVoice ringbackVoice = {}; const int32_t *ringbackVoiceFlag = reinterpret_cast(response); ringbackVoice.status = *ringbackVoiceFlag; - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallRingbackVoiceNotice, ringbackVoice); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallRingbackVoiceNotice, ringbackVoice); } int32_t HRilCall::CallEmergencyNotice( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilCall *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen == 0 || (responseLen % sizeof(HRilEmergencyInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::EmergencyInfoList callList = {}; - BuildIEmergencyCallList(callList, response, responseLen); - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallEmergencyNotice, callList); + stub->BuildIEmergencyCallList(callList, response, responseLen); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallEmergencyNotice, callList); } int32_t HRilCall::CallRsrvccStatusNotify( - int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen) + HRilCall *stub, int32_t notifyType, HRilErrNumber error, const void *response, size_t responseLen) { - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallRsrvccStatusNotify); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::CallRsrvccStatusNotify); } void HRilCall::RegisterCallFuncs(const HRilCallReq *callFuncs) diff --git a/services/hril/src/hril_data.cpp b/services/hril/src/hril_data.cpp index 5d709865c1524767aaebf004c168160e30a34060..93083b25e190d54d265c54a2c87fca9504ff6db2 100644 --- a/services/hril/src/hril_data.cpp +++ b/services/hril/src/hril_data.cpp @@ -237,21 +237,30 @@ int32_t HRilData::CleanAllConnections(int32_t serialId) return RequestVendor(serialId, HREQ_DATA_CLEAN_ALL_CONNECTIONS, dataFuncs_, &HRilDataReq::CleanAllConnections); } -int32_t HRilData::CleanAllConnectionsResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::CleanAllConnectionsResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::CleanAllConnectionsResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::CleanAllConnectionsResponse); } -int32_t HRilData::DeactivatePdpContextResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::DeactivatePdpContextResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DeactivatePdpContextResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DeactivatePdpContextResponse); } -int32_t HRilData::ActivatePdpContextResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::ActivatePdpContextResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilDataCallResponse)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -260,60 +269,75 @@ int32_t HRilData::ActivatePdpContextResponse( result.reason = HRIL_ERROR_UNSPECIFIED_RSN; result.cid = -1; if (response != nullptr) { - SwitchRilDataToHal((HRilDataCallResponse *)response, result); + stub->SwitchRilDataToHal((HRilDataCallResponse *)response, result); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::ActivatePdpContextResponse, result); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::ActivatePdpContextResponse, result); } -int32_t HRilData::GetPdpContextListResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::GetPdpContextListResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilDataCallResponse)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::DataCallResultList dataCallResultList = {}; if (response != nullptr) { - SwitchHRilDataListToHal(response, responseLen, dataCallResultList.dcList); + stub->SwitchHRilDataListToHal(response, responseLen, dataCallResultList.dcList); } dataCallResultList.size = dataCallResultList.dcList.size(); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPdpContextListResponse, dataCallResultList); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPdpContextListResponse, dataCallResultList); } -int32_t HRilData::SetInitApnInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::SetInitApnInfoResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetInitApnInfoResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetInitApnInfoResponse); } -int32_t HRilData::SetDataProfileInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::SetDataProfileInfoResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { return HRIL_ERR_SUCCESS; } -int32_t HRilData::SetLinkBandwidthReportingRuleResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::SetLinkBandwidthReportingRuleResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetLinkBandwidthReportingRuleResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetLinkBandwidthReportingRuleResponse); } int32_t HRilData::PdpContextListUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilData *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr) || (responseLen % sizeof(HRilDataCallResponse)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::DataCallResultList dataCallResultList = {}; - SwitchHRilDataListToHal(response, responseLen, dataCallResultList.dcList); + stub->SwitchHRilDataListToHal(response, responseLen, dataCallResultList.dcList); dataCallResultList.size = dataCallResultList.dcList.size(); - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::PdpContextListUpdated, dataCallResultList); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::PdpContextListUpdated, dataCallResultList); } int32_t HRilData::DataLinkCapabilityUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilData *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr) || (responseLen % sizeof(HRilDataLinkCapability)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -324,12 +348,16 @@ int32_t HRilData::DataLinkCapabilityUpdated( dataLinkCapability.primaryUplinkKbps = result->primaryUplinkKbps; dataLinkCapability.secondaryDownlinkKbps = result->secondaryDownlinkKbps; dataLinkCapability.secondaryUplinkKbps = result->secondaryUplinkKbps; - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::DataLinkCapabilityUpdated, dataLinkCapability); + return stub->Notify( + notifyType, error, &HDI::Ril::V1_1::IRilCallback::DataLinkCapabilityUpdated, dataLinkCapability); } -int32_t HRilData::GetLinkCapabilityResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::GetLinkCapabilityResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilDataLinkCapability)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -342,12 +370,15 @@ int32_t HRilData::GetLinkCapabilityResponse( dataLinkCapability.secondaryDownlinkKbps = result->secondaryDownlinkKbps; dataLinkCapability.secondaryUplinkKbps = result->secondaryUplinkKbps; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetLinkCapabilityResponse, dataLinkCapability); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetLinkCapabilityResponse, dataLinkCapability); } -int32_t HRilData::GetLinkBandwidthInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::GetLinkBandwidthInfoResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilLinkBandwidthInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -365,14 +396,17 @@ int32_t HRilData::GetLinkBandwidthInfoResponse( uplinkAndDownlinkBandwidthInfo.dlSambr = result->dlSambr; uplinkAndDownlinkBandwidthInfo.averagingWindow = result->averagingWindow; } - return Response( + return stub->Response( responseInfo, &HDI::Ril::V1_1::IRilCallback::GetLinkBandwidthInfoResponse, uplinkAndDownlinkBandwidthInfo); } -int32_t HRilData::SetDataPermittedResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilData::SetDataPermittedResponse(HRilData *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetDataPermittedResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetDataPermittedResponse); } void HRilData::RegisterDataFuncs(const HRilDataReq *dataFuncs) diff --git a/services/hril/src/hril_modem.cpp b/services/hril/src/hril_modem.cpp index d382bbb016336145a0f4579641553fe5ca747842..49f0ef43ed4900aa5046eee2b3d932578f47d527 100644 --- a/services/hril/src/hril_modem.cpp +++ b/services/hril/src/hril_modem.cpp @@ -66,8 +66,11 @@ int32_t HRilModem::GetBasebandVersion(int32_t serialId) } int32_t HRilModem::RadioStateUpdated( - const int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilModem *stub, const int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -76,12 +79,15 @@ int32_t HRilModem::RadioStateUpdated( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::RadioStateUpdated, *(const int32_t *)response); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::RadioStateUpdated, *(const int32_t *)response); } int32_t HRilModem::VoiceRadioTechUpdated( - const int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilModem *stub, const int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(HRilVoiceRadioInfo)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -91,13 +97,16 @@ int32_t HRilModem::VoiceRadioTechUpdated( return HRIL_ERR_NULL_POINT; } HDI::Ril::V1_1::VoiceRadioTechnology voiceRadioTech = {}; - BuildIVoiceRadioTechnology(voiceRadioTech, *(const HRilVoiceRadioInfo *)response); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::VoiceRadioTechUpdated, voiceRadioTech); + stub->BuildIVoiceRadioTechnology(voiceRadioTech, *(const HRilVoiceRadioInfo *)response); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::VoiceRadioTechUpdated, voiceRadioTech); } int32_t HRilModem::DsdsModeUpdated( - const int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilModem *stub, const int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -106,25 +115,34 @@ int32_t HRilModem::DsdsModeUpdated( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Notify( + return stub->Notify( indType, error, &HDI::Ril::V1_1::IRilCallback::DsdsModeUpdated, *(static_cast(response))); } -int32_t HRilModem::ShutDownResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::ShutDownResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::ShutDownResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::ShutDownResponse); } -int32_t HRilModem::SetRadioStateResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::SetRadioStateResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetRadioStateResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetRadioStateResponse); } -int32_t HRilModem::GetRadioStateResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::GetRadioStateResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -133,12 +151,16 @@ int32_t HRilModem::GetRadioStateResponse( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetRadioStateResponse, *(const int32_t *)response); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetRadioStateResponse, *(const int32_t *)response); } -int32_t HRilModem::GetImeiResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::GetImeiResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(char)) != 0) { TELEPHONY_LOGE("GetImeiResponse:Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -147,12 +169,16 @@ int32_t HRilModem::GetImeiResponse( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetImeiResponse, std::string((const char *)response)); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetImeiResponse, std::string((const char *)response)); } -int32_t HRilModem::GetImeiSvResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::GetImeiSvResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(char)) != 0) { TELEPHONY_LOGE("GetImeiSvResponse:Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -161,13 +187,16 @@ int32_t HRilModem::GetImeiSvResponse( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Response( + return stub->Response( responseInfo, &HDI::Ril::V1_3::IRilCallback::GetImeiSvResponse, std::string((const char *)response)); } -int32_t HRilModem::GetMeidResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::GetMeidResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } std::string meidResponse = ""; if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(char)) != 0) { TELEPHONY_LOGE("GetMeidResponse:Invalid parameter, responseLen:%{public}zu", responseLen); @@ -183,12 +212,15 @@ int32_t HRilModem::GetMeidResponse( } else { meidResponse = std::string((const char *)response); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetMeidResponse, meidResponse); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetMeidResponse, meidResponse); } -int32_t HRilModem::GetVoiceRadioTechnologyResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::GetVoiceRadioTechnologyResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::VoiceRadioTechnology voiceRadioTech = {}; if (response == nullptr) { TELEPHONY_LOGE("GetVoiceRadioTechnologyResponse Invalid response: nullptr"); @@ -196,9 +228,9 @@ int32_t HRilModem::GetVoiceRadioTechnologyResponse( responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_INVALID_RESPONSE; } } else { - BuildIVoiceRadioTechnology(voiceRadioTech, *(const HRilVoiceRadioInfo *)response); + stub->BuildIVoiceRadioTechnology(voiceRadioTech, *(const HRilVoiceRadioInfo *)response); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetVoiceRadioTechnologyResponse, voiceRadioTech); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetVoiceRadioTechnologyResponse, voiceRadioTech); } void HRilModem::BuildIVoiceRadioTechnology( @@ -215,9 +247,12 @@ void HRilModem::BuildIVoiceRadioTechnology( voiceRadioTech.actName = (hRiadioInfo.actName == nullptr) ? "" : hRiadioInfo.actName; } -int32_t HRilModem::GetBasebandVersionResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilModem::GetBasebandVersionResponse(HRilModem *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(char)) != 0) { TELEPHONY_LOGE("GetBasebandVersionResponse:Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -226,7 +261,7 @@ int32_t HRilModem::GetBasebandVersionResponse( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Response( + return stub->Response( responseInfo, &HDI::Ril::V1_1::IRilCallback::GetBasebandVersionResponse, std::string((const char *)response)); } diff --git a/services/hril/src/hril_network.cpp b/services/hril/src/hril_network.cpp index cad3378eaa31711023be262cf94933e8cfc870e1..9d2c1a7e38626a9939e2a8e19ab4f1e84323675c 100644 --- a/services/hril/src/hril_network.cpp +++ b/services/hril/src/hril_network.cpp @@ -185,9 +185,12 @@ int32_t HRilNetwork::GetNrSsbId(int32_t serialId) serialId, HREQ_NETWORK_GET_NR_SSBID_INFO, networkFuncs_, &HRilNetworkReq::GetNrSsbId); } -int32_t HRilNetwork::GetSignalStrengthResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetSignalStrengthResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::Rssi rssi = {}; if (response == nullptr || responseLen != sizeof(HRilRssi)) { TELEPHONY_LOGE("GetSignalStrengthResponse response is invalid"); @@ -195,14 +198,17 @@ int32_t HRilNetwork::GetSignalStrengthResponse( responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_INVALID_RESPONSE; } } else { - ExchangeRilRssiToHdf(response, rssi); + stub->ExchangeRilRssiToHdf(response, rssi); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSignalStrengthResponse, rssi); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSignalStrengthResponse, rssi); } -int32_t HRilNetwork::GetCsRegStatusResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetCsRegStatusResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::CsRegStatusInfo csRegStatusInfo = {}; if (response == nullptr || responseLen != sizeof(HRilRegStatusInfo)) { TELEPHONY_LOGE("GetCsRegStatusResponse response is invalid"); @@ -221,12 +227,15 @@ int32_t HRilNetwork::GetCsRegStatusResponse( csRegStatusInfo.notifyType, csRegStatusInfo.regStatus, csRegStatusInfo.lacCode, csRegStatusInfo.cellId, csRegStatusInfo.radioTechnology); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCsRegStatusResponse, csRegStatusInfo); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCsRegStatusResponse, csRegStatusInfo); } -int32_t HRilNetwork::GetPsRegStatusResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetPsRegStatusResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::PsRegStatusInfo psRegStatusInfo = {}; if (response == nullptr || responseLen != sizeof(HRilRegStatusInfo)) { TELEPHONY_LOGE("GetPsRegStatusResponse response is invalid"); @@ -251,12 +260,15 @@ int32_t HRilNetwork::GetPsRegStatusResponse( psRegStatusInfo.radioTechnology, psRegStatusInfo.isDcNrRestricted, psRegStatusInfo.isNrAvailable, psRegStatusInfo.isEnDcAvailable); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPsRegStatusResponse, psRegStatusInfo); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPsRegStatusResponse, psRegStatusInfo); } -int32_t HRilNetwork::GetOperatorInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetOperatorInfoResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::OperatorInfo operatorInfoResult = {}; if (response == nullptr || responseLen == 0) { TELEPHONY_LOGE("GetOperatorInfoResponse response is invalid"); @@ -272,12 +284,15 @@ int32_t HRilNetwork::GetOperatorInfoResponse( operatorInfoResult.longName.c_str(), operatorInfoResult.shortName.c_str(), operatorInfoResult.numeric.c_str()); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetOperatorInfoResponse, operatorInfoResult); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetOperatorInfoResponse, operatorInfoResult); } -int32_t HRilNetwork::GetNetworkSearchInformationResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetNetworkSearchInformationResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::AvailableNetworkList availableNetworkList = {}; if (response == nullptr || responseLen == 0) { TELEPHONY_LOGE("GetNetworkSearchInformationResponse response is invalid"); @@ -286,15 +301,18 @@ int32_t HRilNetwork::GetNetworkSearchInformationResponse( } } else { availableNetworkList.itemNum = 0; - BuildOperatorList(availableNetworkList, response, responseLen); + stub->BuildOperatorList(availableNetworkList, response, responseLen); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNetworkSearchInformationResponse, - availableNetworkList); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNetworkSearchInformationResponse, availableNetworkList); } -int32_t HRilNetwork::GetNetworkSelectionModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetNetworkSelectionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::SetNetworkModeInfo selectModeInfo = {}; if (response == nullptr || responseLen != sizeof(int32_t)) { TELEPHONY_LOGE("GetNetworkSelectionModeResponse response is invalid"); @@ -306,24 +324,33 @@ int32_t HRilNetwork::GetNetworkSelectionModeResponse( selectModeInfo.selectMode = *resp; TELEPHONY_LOGI("GetNetworkSelectionModeResponse selectMode: %{public}d", selectModeInfo.selectMode); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNetworkSelectionModeResponse, selectModeInfo); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNetworkSelectionModeResponse, selectModeInfo); } -int32_t HRilNetwork::SetNetworkSelectionModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::SetNetworkSelectionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetNetworkSelectionModeResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetNetworkSelectionModeResponse); } -int32_t HRilNetwork::SetPreferredNetworkResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::SetPreferredNetworkResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetPreferredNetworkResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetPreferredNetworkResponse); } -int32_t HRilNetwork::GetPreferredNetworkResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetPreferredNetworkResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::PreferredNetworkTypeInfo preferredNetworkTypeInfo = {}; if (response == nullptr || responseLen != sizeof(int32_t)) { TELEPHONY_LOGE("GetPreferredNetworkResponse response is invalid"); @@ -335,12 +362,16 @@ int32_t HRilNetwork::GetPreferredNetworkResponse( preferredNetworkTypeInfo.preferredNetworkType = *resp; TELEPHONY_LOGI("GetPreferredNetworkResponse preferredNetworkType: %{public}d", *resp); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPreferredNetworkResponse, preferredNetworkTypeInfo); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPreferredNetworkResponse, preferredNetworkTypeInfo); } -int32_t HRilNetwork::GetNeighboringCellInfoListResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetNeighboringCellInfoListResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::CellListNearbyInfo cellInfoList; if (response == nullptr || responseLen != sizeof(CellInfoList)) { TELEPHONY_LOGE("GetNeighboringCellInfoListResponse response is invalid"); @@ -350,17 +381,21 @@ int32_t HRilNetwork::GetNeighboringCellInfoListResponse( } else { cellInfoList.itemNum = 0; cellInfoList.cellNearbyInfo.clear(); - if (BuildNeighboringCellList(cellInfoList, response, responseLen) != 0) { + if (stub->BuildNeighboringCellList(cellInfoList, response, responseLen) != 0) { TELEPHONY_LOGE("GetNeighboringCellInfoListResponse BuildNeighboringCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNeighboringCellInfoListResponse, cellInfoList); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNeighboringCellInfoListResponse, cellInfoList); } -int32_t HRilNetwork::GetNeighboringCellInfoListResponse_1_2( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetNeighboringCellInfoListResponse_1_2(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_2::CellListNearbyInfo_1_2 cellInfoList; if (response == nullptr || responseLen != sizeof(CellInfoList)) { TELEPHONY_LOGE("response is invalid"); @@ -370,17 +405,21 @@ int32_t HRilNetwork::GetNeighboringCellInfoListResponse_1_2( } else { cellInfoList.itemNum = 0; cellInfoList.cellNearbyInfo.clear(); - if (BuildNeighboringCellList(cellInfoList, response, responseLen) != 0) { + if (stub->BuildNeighboringCellList(cellInfoList, response, responseLen) != 0) { TELEPHONY_LOGE("BuildNeighboringCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } } - return Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::GetNeighboringCellInfoListResponse_1_2, cellInfoList); + return stub->Response( + responseInfo, &HDI::Ril::V1_2::IRilCallback::GetNeighboringCellInfoListResponse_1_2, cellInfoList); } -int32_t HRilNetwork::GetCurrentCellInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetCurrentCellInfoResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::CellListCurrentInfo cellList; if (response == nullptr || responseLen != sizeof(CurrentCellInfoList)) { TELEPHONY_LOGE("GetCurrentCellInfoResponse response is invalid"); @@ -390,17 +429,20 @@ int32_t HRilNetwork::GetCurrentCellInfoResponse( } else { cellList.itemNum = 0; cellList.cellCurrentInfo.clear(); - if (BuildCurrentCellList(cellList, response, responseLen) != 0) { + if (stub->BuildCurrentCellList(cellList, response, responseLen) != 0) { TELEPHONY_LOGE("GetCurrentCellInfoResponse BuildCurrentCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCurrentCellInfoResponse, cellList); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCurrentCellInfoResponse, cellList); } -int32_t HRilNetwork::GetCurrentCellInfoResponse_1_1( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetCurrentCellInfoResponse_1_1(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::CellListCurrentInfo_1_1 cellList; if (response == nullptr || responseLen != sizeof(CurrentCellInfoList)) { TELEPHONY_LOGE("response is invalid"); @@ -410,17 +452,20 @@ int32_t HRilNetwork::GetCurrentCellInfoResponse_1_1( } else { cellList.itemNum = 0; cellList.cellCurrentInfo.clear(); - if (BuildCurrentCellList(cellList, response, responseLen) != 0) { + if (stub->BuildCurrentCellList(cellList, response, responseLen) != 0) { TELEPHONY_LOGE("BuildCurrentCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCurrentCellInfoResponse_1_1, cellList); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCurrentCellInfoResponse_1_1, cellList); } -int32_t HRilNetwork::GetCurrentCellInfoResponse_1_2( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetCurrentCellInfoResponse_1_2(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_2::CellListCurrentInfo_1_2 cellList; if (response == nullptr || responseLen != sizeof(CurrentCellInfoList)) { TELEPHONY_LOGE("response is invalid"); @@ -430,17 +475,20 @@ int32_t HRilNetwork::GetCurrentCellInfoResponse_1_2( } else { cellList.itemNum = 0; cellList.cellCurrentInfo.clear(); - if (BuildCurrentCellList(cellList, response, responseLen) != 0) { + if (stub->BuildCurrentCellList(cellList, response, responseLen) != 0) { TELEPHONY_LOGE("BuildCurrentCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } } - return Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::GetCurrentCellInfoResponse_1_2, cellList); + return stub->Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::GetCurrentCellInfoResponse_1_2, cellList); } -int32_t HRilNetwork::GetPhysicalChannelConfigResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetPhysicalChannelConfigResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::ChannelConfigInfoList phyChnlCfgList = {}; if (response == nullptr || responseLen != sizeof(HRilChannelConfigList)) { TELEPHONY_LOGE("GetPhysicalChannelConfigResponse response is invalid"); @@ -481,36 +529,52 @@ int32_t HRilNetwork::GetPhysicalChannelConfigResponse( } TELEPHONY_LOGI("GetPhysicalChannelConfigResponse itemNum:%{public}d", phyChnlCfgList.itemNum); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPhysicalChannelConfigResponse, phyChnlCfgList); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetPhysicalChannelConfigResponse, phyChnlCfgList); } -int32_t HRilNetwork::SetLocateUpdatesResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::SetLocateUpdatesResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetLocateUpdatesResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetLocateUpdatesResponse); } -int32_t HRilNetwork::SetNotificationFilterResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::SetNotificationFilterResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetNotificationFilterResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetNotificationFilterResponse); } -int32_t HRilNetwork::SetDeviceStateResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::SetDeviceStateResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetDeviceStateResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetDeviceStateResponse); } -int32_t HRilNetwork::SetNrOptionModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::SetNrOptionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetNrOptionModeResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetNrOptionModeResponse); } -int32_t HRilNetwork::GetNrOptionModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetNrOptionModeResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } int32_t nrOptionMode = 0; if (response == nullptr || responseLen != sizeof(int32_t)) { TELEPHONY_LOGE("GetNrOptionModeResponse response is invalid"); @@ -521,12 +585,15 @@ int32_t HRilNetwork::GetNrOptionModeResponse( nrOptionMode = *(static_cast(response)); TELEPHONY_LOGI("GetNrOptionModeResponse nrOptionMode: %{public}d", nrOptionMode); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNrOptionModeResponse, nrOptionMode); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetNrOptionModeResponse, nrOptionMode); } -int32_t HRilNetwork::GetRrcConnectionStateResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetRrcConnectionStateResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } int32_t rrcConnectionState = 0; if (response == nullptr || responseLen != sizeof(int32_t)) { TELEPHONY_LOGE("GetRrcConnectionStateResponse response is invalid"); @@ -537,12 +604,16 @@ int32_t HRilNetwork::GetRrcConnectionStateResponse( rrcConnectionState = *(static_cast(response)); TELEPHONY_LOGD("GetRrcConnectionStateResponse rrcConnectionState: %{public}d", rrcConnectionState); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetRrcConnectionStateResponse, rrcConnectionState); + return stub->Response( + responseInfo, &HDI::Ril::V1_1::IRilCallback::GetRrcConnectionStateResponse, rrcConnectionState); } -int32_t HRilNetwork::GetNrSsbIdResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilNetwork::GetNrSsbIdResponse(HRilNetwork *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_2::NrCellSsbIds nrCellSsbIds; if (response == nullptr || responseLen != sizeof(NrCellSsbIdsVendor)) { TELEPHONY_LOGE("Response is invalid"); @@ -559,17 +630,20 @@ int32_t HRilNetwork::GetNrSsbIdResponse( nrCellSsbIds.sCellSsbList.clear(); nrCellSsbIds.nbCellCount = 0; nrCellSsbIds.nbCellSsbList.clear(); - if (BuildNrCellSsbIdsInfo(nrCellSsbIds, response, responseLen) != 0) { + if (stub->BuildNrCellSsbIdsInfo(nrCellSsbIds, response, responseLen) != 0) { TELEPHONY_LOGE("BuildNrCellSsbIdsInfo failed"); return HRIL_ERR_GENERIC_FAILURE; } } - return Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::GetNrSsbIdResponse, nrCellSsbIds); + return stub->Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::GetNrSsbIdResponse, nrCellSsbIds); } int32_t HRilNetwork::NetworkCsRegStatusUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(HRilRegStatusInfo)) { TELEPHONY_LOGE("response is invalid"); return HRIL_ERR_INVALID_PARAMETER; @@ -585,12 +659,15 @@ int32_t HRilNetwork::NetworkCsRegStatusUpdated( "lacCode:%{private}d, cellId:%{private}d, radioTechnology:%{public}d", regStatusInfoNotify.notifyType, regStatusInfoNotify.regStatus, regStatusInfoNotify.lacCode, regStatusInfoNotify.cellId, regStatusInfoNotify.radioTechnology); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkCsRegStatusUpdated, regStatusInfoNotify); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkCsRegStatusUpdated, regStatusInfoNotify); } int32_t HRilNetwork::NetworkPsRegStatusUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(HRilRegStatusInfo)) { TELEPHONY_LOGE("response is invalid"); return HRIL_ERR_INVALID_PARAMETER; @@ -612,44 +689,56 @@ int32_t HRilNetwork::NetworkPsRegStatusUpdated( regStatusInfoNotify.notifyType, regStatusInfoNotify.regStatus, regStatusInfoNotify.lacCode, regStatusInfoNotify.cellId, regStatusInfoNotify.radioTechnology, regStatusInfoNotify.isDcNrRestricted, regStatusInfoNotify.isNrAvailable, regStatusInfoNotify.isEnDcAvailable); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkPsRegStatusUpdated, regStatusInfoNotify); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkPsRegStatusUpdated, regStatusInfoNotify); } int32_t HRilNetwork::SignalStrengthUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(HRilRssi)) { TELEPHONY_LOGE("SignalStrengthUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::Rssi rssi = {}; - ExchangeRilRssiToHdf(response, rssi); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::SignalStrengthUpdated, rssi); + stub->ExchangeRilRssiToHdf(response, rssi); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::SignalStrengthUpdated, rssi); } int32_t HRilNetwork::NetworkTimeUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr) { TELEPHONY_LOGE("NetworkTimeUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; } - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkTimeUpdated, (const char *)response); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkTimeUpdated, (const char *)response); } int32_t HRilNetwork::NetworkTimeZoneUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr) { TELEPHONY_LOGE("NetworkTimeZoneUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; } - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkTimeZoneUpdated, (const char *)response); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkTimeZoneUpdated, (const char *)response); } int32_t HRilNetwork::NetworkPhyChnlCfgUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(HRilChannelConfigList)) { TELEPHONY_LOGE("NetworkPhyChnlCfgUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; @@ -678,12 +767,15 @@ int32_t HRilNetwork::NetworkPhyChnlCfgUpdated( phyChnlCfgList.channelConfigInfos.push_back(phyChnlCfg); } TELEPHONY_LOGI("NetworkPhyChnlCfgUpdated itemNum:%{public}d", phyChnlCfgList.itemNum); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkPhyChnlCfgUpdated, phyChnlCfgList); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkPhyChnlCfgUpdated, phyChnlCfgList); } int32_t HRilNetwork::NetworkCurrentCellUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(HRilRegStatusInfo)) { TELEPHONY_LOGE("NetworkCurrentCellUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; @@ -691,16 +783,19 @@ int32_t HRilNetwork::NetworkCurrentCellUpdated( HDI::Ril::V1_1::CellListCurrentInfo cellList; cellList.itemNum = 0; cellList.cellCurrentInfo.clear(); - if (BuildCurrentCellList(cellList, response, responseLen) != 0) { + if (stub->BuildCurrentCellList(cellList, response, responseLen) != 0) { TELEPHONY_LOGE("NetworkCurrentCellUpdated BuildCurrentCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkCurrentCellUpdated, cellList); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkCurrentCellUpdated, cellList); } int32_t HRilNetwork::NetworkCurrentCellUpdated_1_2( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(CurrentCellInfoList)) { TELEPHONY_LOGE("response is invalid"); return HRIL_ERR_INVALID_PARAMETER; @@ -708,16 +803,19 @@ int32_t HRilNetwork::NetworkCurrentCellUpdated_1_2( HDI::Ril::V1_2::CellListCurrentInfo_1_2 cellList; cellList.itemNum = 0; cellList.cellCurrentInfo.clear(); - if (BuildCurrentCellList(cellList, response, responseLen) != 0) { + if (stub->BuildCurrentCellList(cellList, response, responseLen) != 0) { TELEPHONY_LOGE("BuildCurrentCellInfoList failed"); return HRIL_ERR_GENERIC_FAILURE; } - return Notify(indType, error, &HDI::Ril::V1_2::IRilCallback::NetworkCurrentCellUpdated_1_2, cellList); + return stub->Notify(indType, error, &HDI::Ril::V1_2::IRilCallback::NetworkCurrentCellUpdated_1_2, cellList); } int32_t HRilNetwork::GetRrcConnectionStateUpdated( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if ((response == nullptr && responseLen != 0) || (responseLen % sizeof(int32_t)) != 0) { TELEPHONY_LOGE("Invalid parameter, responseLen:%{public}zu", responseLen); return HRIL_ERR_INVALID_PARAMETER; @@ -726,13 +824,16 @@ int32_t HRilNetwork::GetRrcConnectionStateUpdated( TELEPHONY_LOGE("response is null"); return HRIL_ERR_NULL_POINT; } - return Notify( + return stub->Notify( indType, error, &HDI::Ril::V1_1::IRilCallback::GetRrcConnectionStateUpdated, *(const int32_t *)response); } int32_t HRilNetwork::NetworkCurrentCellUpdated_1_1( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(CurrentCellInfoList)) { TELEPHONY_LOGE("response is invalid"); return HRIL_ERR_INVALID_PARAMETER; @@ -740,21 +841,24 @@ int32_t HRilNetwork::NetworkCurrentCellUpdated_1_1( HDI::Ril::V1_1::CellListCurrentInfo_1_1 cellList; cellList.itemNum = 0; cellList.cellCurrentInfo.clear(); - if (BuildCurrentCellList(cellList, response, responseLen) != 0) { + if (stub->BuildCurrentCellList(cellList, response, responseLen) != 0) { TELEPHONY_LOGE("BuildCurrentCellList failed"); return HRIL_ERR_GENERIC_FAILURE; } - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkCurrentCellUpdated_1_1, cellList); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NetworkCurrentCellUpdated_1_1, cellList); } -int32_t HRilNetwork::ResidentNetworkUpdated(int32_t indType, const HRilErrNumber error, const void *response, - size_t responseLen) +int32_t HRilNetwork::ResidentNetworkUpdated( + HRilNetwork *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr) { TELEPHONY_LOGE("ResidentNetworkUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; } - return Notify(indType, error, &HDI::Ril::V1_2::IRilCallback::ResidentNetworkUpdated, (const char *)response); + return stub->Notify(indType, error, &HDI::Ril::V1_2::IRilCallback::ResidentNetworkUpdated, (const char *)response); } void HRilNetwork::ExchangeRilRssiToHdf(const void *response, HDI::Ril::V1_1::Rssi &rssi) diff --git a/services/hril/src/hril_sim.cpp b/services/hril/src/hril_sim.cpp index 99f1d830d37f10e9479becc61673f45b36ba6337..32a2ef6400ad7ee557f8089a1c7178182a1eaa61 100644 --- a/services/hril/src/hril_sim.cpp +++ b/services/hril/src/hril_sim.cpp @@ -299,20 +299,26 @@ int32_t HRilSim::SendSimMatchedOperatorInfo( return ret; } -int32_t HRilSim::GetSimIOResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::GetSimIOResponse(HRilSim *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::IccIoResultInfo result = {}; - int32_t ret = BuildSimIOResp(result, responseInfo, response, responseLen); + int32_t ret = stub->BuildSimIOResp(result, responseInfo, response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSimIOResponse, result); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSimIOResponse, result); } -int32_t HRilSim::GetSimCardStatusResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::GetSimCardStatusResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_3::SimCardStatusInfo rilCardStatus = {}; if ((response == nullptr && responseLen != 0) || (response != nullptr && responseLen != sizeof(HRilCardState))) { @@ -324,7 +330,7 @@ int32_t HRilSim::GetSimCardStatusResponse( if (responseInfo.error == HDI::Ril::V1_1::RilErrType::NONE) { responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_INVALID_RESPONSE; } - return Response(responseInfo, &HDI::Ril::V1_3::IRilCallback::GetSimCardStatusResponse, rilCardStatus); + return stub->Response(responseInfo, &HDI::Ril::V1_3::IRilCallback::GetSimCardStatusResponse, rilCardStatus); } const HRilCardState *curPtr = static_cast(response); if (curPtr != nullptr) { @@ -333,115 +339,157 @@ int32_t HRilSim::GetSimCardStatusResponse( rilCardStatus.simState = curPtr->simState; rilCardStatus.iccid = (curPtr->iccid == nullptr) ? "" : curPtr->iccid; } - return Response(responseInfo, &HDI::Ril::V1_3::IRilCallback::GetSimCardStatusResponse, rilCardStatus); + return stub->Response(responseInfo, &HDI::Ril::V1_3::IRilCallback::GetSimCardStatusResponse, rilCardStatus); } -int32_t HRilSim::GetImsiResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::GetImsiResponse(HRilSim *stub, int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, + const void *response, size_t responseLen) { - int32_t ret = CheckCharData(response, responseLen); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + int32_t ret = stub->CheckCharData(response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetImsiResponse, (const char *)response); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetImsiResponse, (const char *)response); } -int32_t HRilSim::GetSimLockStatusResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::GetSimLockStatusResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } int32_t simLockStatus = 0; if (response == nullptr || responseLen != sizeof(int32_t)) { TELEPHONY_LOGE("GetSimStatusResponse: Invalid response"); if (responseInfo.error == HDI::Ril::V1_1::RilErrType::NONE) { responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_INVALID_RESPONSE; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSimLockStatusResponse, simLockStatus); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSimLockStatusResponse, simLockStatus); } simLockStatus = *(static_cast(response)); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSimLockStatusResponse, simLockStatus); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSimLockStatusResponse, simLockStatus); } -int32_t HRilSim::SetSimLockResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SetSimLockResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetSimLockResponse, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetSimLockResponse, result); } -int32_t HRilSim::ChangeSimPasswordResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::ChangeSimPasswordResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::ChangeSimPasswordResponse, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::ChangeSimPasswordResponse, result); } -int32_t HRilSim::UnlockPinResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::UnlockPinResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPinResponse, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPinResponse, result); } -int32_t HRilSim::UnlockPukResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::UnlockPukResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPukResponse, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPukResponse, result); } -int32_t HRilSim::UnlockPin2Response( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::UnlockPin2Response(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPin2Response, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPin2Response, result); } -int32_t HRilSim::UnlockPuk2Response( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::UnlockPuk2Response(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPuk2Response, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockPuk2Response, result); } -int32_t HRilSim::SetActiveSimResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SetActiveSimResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetActiveSimResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetActiveSimResponse); } -int32_t HRilSim::SimStkSendTerminalResponseResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimStkSendTerminalResponseResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkSendTerminalResponseResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkSendTerminalResponseResponse); } -int32_t HRilSim::SimStkSendEnvelopeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimStkSendEnvelopeResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkSendEnvelopeResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkSendEnvelopeResponse); } -int32_t HRilSim::SimStkSendCallSetupRequestResultResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimStkSendCallSetupRequestResultResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkSendCallSetupRequestResultResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkSendCallSetupRequestResultResponse); } -int32_t HRilSim::SimStkIsReadyResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimStkIsReadyResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkIsReadyResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimStkIsReadyResponse); } -int32_t HRilSim::GetRadioProtocolResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::GetRadioProtocolResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::RadioProtocol radioProtocol = {}; if (response == nullptr || responseLen != sizeof(HRilRadioProtocol)) { TELEPHONY_LOGE("GetRadioProtocolResponse response is invalid"); @@ -449,18 +497,22 @@ int32_t HRilSim::GetRadioProtocolResponse( responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_INVALID_RESPONSE; } } else { - BuildRadioProtocol(radioProtocol, response); - TELEPHONY_LOGI("HRilSim::GetRadioProtocolResponse slotId:%{public}d, serial:%{public}d" + stub->BuildRadioProtocol(radioProtocol, response); + TELEPHONY_LOGI( + "HRilSim::GetRadioProtocolResponse slotId:%{public}d, serial:%{public}d" "sessionId:%{public}d, phase:%{public}d, technology:%{public}d, modemId:%{public}d, status:%{public}d", - GetSlotId(), responseInfo.serial, radioProtocol.sessionId, radioProtocol.phase, radioProtocol.technology, - radioProtocol.modemId, radioProtocol.status); + stub->GetSlotId(), responseInfo.serial, radioProtocol.sessionId, radioProtocol.phase, + radioProtocol.technology, radioProtocol.modemId, radioProtocol.status); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetRadioProtocolResponse, radioProtocol); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetRadioProtocolResponse, radioProtocol); } -int32_t HRilSim::SetRadioProtocolResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SetRadioProtocolResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::RadioProtocol radioProtocol = {}; if (response == nullptr || responseLen != sizeof(HRilRadioProtocol)) { TELEPHONY_LOGE("SetRadioProtocolResponse response is invalid"); @@ -468,18 +520,22 @@ int32_t HRilSim::SetRadioProtocolResponse( responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_INVALID_RESPONSE; } } else { - BuildRadioProtocol(radioProtocol, response); - TELEPHONY_LOGI("HRilSim::SetRadioProtocolResponse slotId:%{public}d, serial:%{public}d" + stub->BuildRadioProtocol(radioProtocol, response); + TELEPHONY_LOGI( + "HRilSim::SetRadioProtocolResponse slotId:%{public}d, serial:%{public}d" "sessionId:%{public}d, phase:%{public}d, technology:%{public}d, modemId:%{public}d, status:%{public}d", - GetSlotId(), responseInfo.serial, radioProtocol.sessionId, radioProtocol.phase, radioProtocol.technology, - radioProtocol.modemId, radioProtocol.status); + stub->GetSlotId(), responseInfo.serial, radioProtocol.sessionId, radioProtocol.phase, + radioProtocol.technology, radioProtocol.modemId, radioProtocol.status); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetRadioProtocolResponse, radioProtocol); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetRadioProtocolResponse, radioProtocol); } -int32_t HRilSim::SimOpenLogicalChannelResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimOpenLogicalChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::OpenLogicalChannelResponse pOpenLogicalChannelResponse = {}; if (response == nullptr || responseLen != sizeof(HRilOpenLogicalChannelResponse)) { TELEPHONY_LOGE("Invalid response: response is nullptr"); @@ -490,55 +546,70 @@ int32_t HRilSim::SimOpenLogicalChannelResponse( pOpenLogicalChannelResponse.sw2 = pRilResponse->sw2; pOpenLogicalChannelResponse.channelId = pRilResponse->channelId; pOpenLogicalChannelResponse.response = (pRilResponse->response == nullptr) ? "" : pRilResponse->response; - return Response( + return stub->Response( responseInfo, &HDI::Ril::V1_1::IRilCallback::SimOpenLogicalChannelResponse, pOpenLogicalChannelResponse); } -int32_t HRilSim::SimCloseLogicalChannelResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimCloseLogicalChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimCloseLogicalChannelResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimCloseLogicalChannelResponse); } -int32_t HRilSim::SimTransmitApduLogicalChannelResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimTransmitApduLogicalChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::IccIoResultInfo result = {}; - int32_t ret = BuildSimIOResp(result, responseInfo, response, responseLen); + int32_t ret = stub->BuildSimIOResp(result, responseInfo, response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimTransmitApduLogicalChannelResponse, result); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimTransmitApduLogicalChannelResponse, result); } -int32_t HRilSim::SimTransmitApduBasicChannelResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimTransmitApduBasicChannelResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::IccIoResultInfo result = {}; - int32_t ret = BuildSimIOResp(result, responseInfo, response, responseLen); + int32_t ret = stub->BuildSimIOResp(result, responseInfo, response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimTransmitApduBasicChannelResponse, result); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimTransmitApduBasicChannelResponse, result); } -int32_t HRilSim::SimAuthenticationResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SimAuthenticationResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::IccIoResultInfo result = {}; - int32_t ret = BuildSimIOResp(result, responseInfo, response, responseLen); + int32_t ret = stub->BuildSimIOResp(result, responseInfo, response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimAuthenticationResponse, result); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SimAuthenticationResponse, result); } -int32_t HRilSim::UnlockSimLockResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::UnlockSimLockResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::LockStatusResp result = {}; - ResponseLockStatus(result, responseInfo, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockSimLockResponse, result); + stub->ResponseLockStatus(result, responseInfo, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UnlockSimLockResponse, result); } HDI::Ril::V1_1::IccIoResultInfo HRilSim::ProcessIccIoResponse( @@ -559,80 +630,108 @@ HDI::Ril::V1_1::IccIoResultInfo HRilSim::ProcessIccIoResponse( return result; } -int32_t HRilSim::SendSimMatchedOperatorInfoResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSim::SendSimMatchedOperatorInfoResponse(HRilSim *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::SendSimMatchedOperatorInfoResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_2::IRilCallback::SendSimMatchedOperatorInfoResponse); } int32_t HRilSim::SimStateUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStateUpdated); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStateUpdated); } int32_t HRilSim::SimStkSessionEndNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkSessionEndNotify); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkSessionEndNotify); } int32_t HRilSim::SimStkProactiveNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - int32_t ret = CheckCharData(response, responseLen); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + int32_t ret = stub->CheckCharData(response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkProactiveNotify, (const char *)response); + return stub->Notify( + notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkProactiveNotify, (const char *)response); } int32_t HRilSim::SimStkAlphaNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - int32_t ret = CheckCharData(response, responseLen); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + int32_t ret = stub->CheckCharData(response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkAlphaNotify, (const char *)response); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkAlphaNotify, (const char *)response); } int32_t HRilSim::SimStkEventNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - int32_t ret = CheckCharData(response, responseLen); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + int32_t ret = stub->CheckCharData(response, responseLen); if (ret != HRIL_ERR_SUCCESS) { return ret; } - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkEventNotify, (const char *)response); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkEventNotify, (const char *)response); } int32_t HRilSim::SimStkCallSetupNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkCallSetupNotify); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimStkCallSetupNotify); } int32_t HRilSim::SimRefreshNotify( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimRefreshNotify); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimRefreshNotify); } int32_t HRilSim::SimRadioProtocolUpdated( - int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSim *stub, int32_t notifyType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(HRilRadioProtocol)) { TELEPHONY_LOGE("SimRadioProtocolUpdated response is invalid"); return HRIL_ERR_INVALID_PARAMETER; } HDI::Ril::V1_1::RadioProtocol radioProtocol = {}; - BuildRadioProtocol(radioProtocol, response); + stub->BuildRadioProtocol(radioProtocol, response); TELEPHONY_LOGI("SimRadioProtocolUpdated slotId:%{public}d, sessionId:%{public}d, phase:%{public}d, " "technology:%{public}d, modemId:%{public}d, status:%{public}d", radioProtocol.slotId, radioProtocol.sessionId, static_cast(radioProtocol.phase), radioProtocol.technology, radioProtocol.modemId, static_cast(radioProtocol.status)); - return Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimRadioProtocolUpdated, radioProtocol); + return stub->Notify(notifyType, error, &HDI::Ril::V1_1::IRilCallback::SimRadioProtocolUpdated, radioProtocol); } bool HRilSim::IsSimResponse(uint32_t code) diff --git a/services/hril/src/hril_sms.cpp b/services/hril/src/hril_sms.cpp index 41a710573da552c21cd1e390d0961f0bb3333a3f..f12995770fdb4aa889075a20ef7efcd1e0d64234 100644 --- a/services/hril/src/hril_sms.cpp +++ b/services/hril/src/hril_sms.cpp @@ -465,50 +465,71 @@ int32_t HRilSms::UpdateCdmaSimMessage(int32_t serialId, const OHOS::HDI::Ril::V1 return HRIL_ERR_SUCCESS; } -int32_t HRilSms::SendGsmSmsResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SendGsmSmsResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::SendSmsResultInfo result = - MakeSendSmsResult(responseInfo, responseInfo.serial, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendGsmSmsResponse, result); + stub->MakeSendSmsResult(responseInfo, responseInfo.serial, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendGsmSmsResponse, result); } -int32_t HRilSms::SendCdmaSmsResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SendCdmaSmsResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::SendSmsResultInfo result = - MakeSendSmsResult(responseInfo, responseInfo.serial, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendCdmaSmsResponse, result); + stub->MakeSendSmsResult(responseInfo, responseInfo.serial, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendCdmaSmsResponse, result); } -int32_t HRilSms::AddSimMessageResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::AddSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } TELEPHONY_LOGI("AddSimMessageResponse send"); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::AddSimMessageResponse); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::AddSimMessageResponse); } -int32_t HRilSms::DelSimMessageResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::DelSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DelSimMessageResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DelSimMessageResponse); } -int32_t HRilSms::UpdateSimMessageResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::UpdateSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UpdateSimMessageResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UpdateSimMessageResponse); } -int32_t HRilSms::SetSmscAddrResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SetSmscAddrResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetSmscAddrResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetSmscAddrResponse); } -int32_t HRilSms::GetSmscAddrResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::GetSmscAddrResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::ServiceCenterAddress result; if (response == nullptr || responseLen != sizeof(HRilServiceCenterAddress)) { TELEPHONY_LOGE("Invalid response: response is nullptr"); @@ -527,18 +548,24 @@ int32_t HRilSms::GetSmscAddrResponse( } TELEPHONY_LOGI("result address:%{private}s, tosca:%{private}d", result.address.c_str(), result.tosca); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSmscAddrResponse, result); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetSmscAddrResponse, result); } -int32_t HRilSms::SetCBConfigResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SetCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCBConfigResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCBConfigResponse); } -int32_t HRilSms::GetCBConfigResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::GetCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::CBConfigInfo broadcastInfo; if (response == nullptr) { TELEPHONY_LOGE("Invalid response: response is nullptr"); @@ -549,14 +576,14 @@ int32_t HRilSms::GetCBConfigResponse( HRilCBConfigInfo *cellBroadcastInfo = (HRilCBConfigInfo *)response; size_t len = responseLen / sizeof(HRilCBConfigInfo); if (len != 0) { - if (!GetCBConfigInfo(cellBroadcastInfo, len, broadcastInfo)) { + if (!stub->GetCBConfigInfo(cellBroadcastInfo, len, broadcastInfo)) { TELEPHONY_LOGE("result is invalid"); } } TELEPHONY_LOGD("mode:%{public}d, mids:%{public}s, dcss:%{public}s", broadcastInfo.mode, broadcastInfo.mids.c_str(), broadcastInfo.dcss.c_str()); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCBConfigResponse, broadcastInfo); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCBConfigResponse, broadcastInfo); } bool HRilSms::GetCBConfigInfo( @@ -590,15 +617,21 @@ bool HRilSms::GetCBConfigInfo( return true; } -int32_t HRilSms::SetCdmaCBConfigResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SetCdmaCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCdmaCBConfigResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SetCdmaCBConfigResponse); } -int32_t HRilSms::GetCdmaCBConfigResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::GetCdmaCBConfigResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::CdmaCBConfigInfo broadcastInfo; if (response == nullptr || responseLen != sizeof(HRilCdmaCBConfigInfo)) { TELEPHONY_LOGE("Invalid response: response is nullptr"); @@ -613,81 +646,106 @@ int32_t HRilSms::GetCdmaCBConfigResponse( TELEPHONY_LOGE("checked:%{public}c, language:%{public}d, service:%{public}d", cellBroadcastInfo->checked, cellBroadcastInfo->language, cellBroadcastInfo->service); } - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCdmaCBConfigResponse, broadcastInfo); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::GetCdmaCBConfigResponse, broadcastInfo); } -int32_t HRilSms::SendSmsMoreModeResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SendSmsMoreModeResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HDI::Ril::V1_1::SendSmsResultInfo result = - MakeSendSmsResult(responseInfo, responseInfo.serial, response, responseLen); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendSmsMoreModeResponse, result); + stub->MakeSendSmsResult(responseInfo, responseInfo.serial, response, responseLen); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendSmsMoreModeResponse, result); } -int32_t HRilSms::SendSmsAckResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::SendSmsAckResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendSmsAckResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::SendSmsAckResponse); } -int32_t HRilSms::AddCdmaSimMessageResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::AddCdmaSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } TELEPHONY_LOGI("receive response"); - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::AddCdmaSimMessageResponse); + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::AddCdmaSimMessageResponse); } -int32_t HRilSms::DelCdmaSimMessageResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::DelCdmaSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DelCdmaSimMessageResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::DelCdmaSimMessageResponse); } -int32_t HRilSms::UpdateCdmaSimMessageResponse( - int32_t requestNum, HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) +int32_t HRilSms::UpdateCdmaSimMessageResponse(HRilSms *stub, int32_t requestNum, + HDI::Ril::V1_1::RilRadioResponseInfo &responseInfo, const void *response, size_t responseLen) { - return Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UpdateCdmaSimMessageResponse); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + return stub->Response(responseInfo, &HDI::Ril::V1_1::IRilCallback::UpdateCdmaSimMessageResponse); } int32_t HRilSms::SmsStatusReportNotify( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSms *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen == 0) { TELEPHONY_LOGE("invalid response"); return HRIL_ERR_GENERIC_FAILURE; } HDI::Ril::V1_1::SmsMessageInfo smsMessageInfo; - uint8_t *bytes = ConvertHexStringToBytes(response, responseLen); + uint8_t *bytes = stub->ConvertHexStringToBytes(response, responseLen); if (bytes == nullptr) { TELEPHONY_LOGE("ConvertHexStringToBytes in SmsStatusReportNotify is failed!"); return HRIL_ERR_GENERIC_FAILURE; } const size_t MESSAGE_SIZE = responseLen / HEX_WIDTH; smsMessageInfo.size = MESSAGE_SIZE; - smsMessageInfo.indicationType = static_cast(ConvertIntToRadioNoticeType(indType)); + smsMessageInfo.indicationType = static_cast(stub->ConvertIntToRadioNoticeType(indType)); uint8_t *temp = bytes; for (int32_t i = 0; i < smsMessageInfo.size; i++) { smsMessageInfo.pdu.push_back(*temp); temp++; } - SafeFrees(bytes); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::SmsStatusReportNotify, smsMessageInfo); + stub->SafeFrees(bytes); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::SmsStatusReportNotify, smsMessageInfo); } int32_t HRilSms::NewSmsStoredOnSimNotify( - int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) + HRilSms *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } if (response == nullptr || responseLen != sizeof(int32_t)) { TELEPHONY_LOGE("invalid response"); return HRIL_ERR_SUCCESS; } int32_t recordNumber = *(static_cast(response)); - indType = static_cast(ConvertIntToRadioNoticeType(indType)); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NewSmsStoredOnSimNotify, recordNumber, indType); + indType = static_cast(stub->ConvertIntToRadioNoticeType(indType)); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NewSmsStoredOnSimNotify, recordNumber, indType); } -int32_t HRilSms::NewSmsNotify(int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) +int32_t HRilSms::NewSmsNotify( + HRilSms *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HRilSmsResponse *smsResponse = nullptr; if (response == nullptr || responseLen == 0) { TELEPHONY_LOGE("NewSmsNotify: invalid response"); @@ -695,7 +753,7 @@ int32_t HRilSms::NewSmsNotify(int32_t indType, const HRilErrNumber error, const } else { smsResponse = (HRilSmsResponse *)response; } - uint8_t *bytes = ConvertHexStringToBytes(smsResponse->pdu, responseLen); + uint8_t *bytes = stub->ConvertHexStringToBytes(smsResponse->pdu, responseLen); if (bytes == nullptr) { TELEPHONY_LOGE("NewSmsNotify: ConvertHexStringToBytes failed"); return HRIL_ERR_GENERIC_FAILURE; @@ -709,12 +767,16 @@ int32_t HRilSms::NewSmsNotify(int32_t indType, const HRilErrNumber error, const smsMessageInfo.pdu.push_back(*temp); temp++; } - SafeFrees(bytes); - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NewSmsNotify, smsMessageInfo); + stub->SafeFrees(bytes); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NewSmsNotify, smsMessageInfo); } -int32_t HRilSms::NewCdmaSmsNotify(int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) +int32_t HRilSms::NewCdmaSmsNotify( + HRilSms *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } HRilSmsResponse *message = nullptr; if (response == nullptr || responseLen == 0) { TELEPHONY_LOGE("invalid response"); @@ -726,7 +788,7 @@ int32_t HRilSms::NewCdmaSmsNotify(int32_t indType, const HRilErrNumber error, co messageInfo.indicationType = indType; if (message->pdu != nullptr) { messageInfo.size = strlen(message->pdu) / HEX_WIDTH; - uint8_t *bytes = ConvertHexStringToBytes(message->pdu, strlen(message->pdu)); + uint8_t *bytes = stub->ConvertHexStringToBytes(message->pdu, strlen(message->pdu)); if (bytes == nullptr) { TELEPHONY_LOGE("bytes is nullptr"); return HRIL_ERR_GENERIC_FAILURE; @@ -736,16 +798,20 @@ int32_t HRilSms::NewCdmaSmsNotify(int32_t indType, const HRilErrNumber error, co messageInfo.pdu.push_back(*temp); temp++; } - SafeFrees(bytes); + stub->SafeFrees(bytes); } - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NewCdmaSmsNotify, messageInfo); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::NewCdmaSmsNotify, messageInfo); } -int32_t HRilSms::CBConfigNotify(int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) +int32_t HRilSms::CBConfigNotify( + HRilSms *stub, int32_t indType, const HRilErrNumber error, const void *response, size_t responseLen) { - HDI::Ril::V1_1::CBConfigReportInfo result = MakeCBConfigResult(response, responseLen); + if (stub == nullptr) { + return HRIL_ERR_NULL_POINT; + } + HDI::Ril::V1_1::CBConfigReportInfo result = stub->MakeCBConfigResult(response, responseLen); result.indicationType = indType; - return Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::CBConfigNotify, result); + return stub->Notify(indType, error, &HDI::Ril::V1_1::IRilCallback::CBConfigNotify, result); } bool HRilSms::IsSmsResponse(uint32_t code) diff --git a/services/hril/src/hril_timer_callback.cpp b/services/hril/src/hril_timer_callback.cpp index 56d8c8747a8b28180f7530e7f6432cd08916db62..a40bab4ce7b8811f691271ce28c4eb95cd3a97da 100644 --- a/services/hril/src/hril_timer_callback.cpp +++ b/services/hril/src/hril_timer_callback.cpp @@ -84,8 +84,9 @@ std::shared_ptr HRilTimerCallback::HRilSetTimerCallbac } HRilEventMessage eventMsg = { 0 }; - auto funcCallback = std::bind( - &HRilTimerCallback::TimerCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); + auto funcCallback = [this](int32_t fd, int16_t events, std::shared_ptr param) { + this->TimerCallback(fd, events, param); + }; event_->SetTimerEvent(eventMsg, event_->IVNALID_FD, false, funcCallback, pCbMsg); event_->AddTimerEvent(eventMsg, timeout); OnTriggerEvent(); @@ -110,8 +111,9 @@ void HRilTimerCallback::EventLoop() triggerWriteFd_ = pipedes[1]; fcntl(triggerReadFd_, F_SETFL, O_NONBLOCK); - auto func = std::bind(&HRilTimerCallback::FdTriggerCallback, this, std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3); + auto func = [this](int32_t fd, int16_t events, std::shared_ptr param) { + this->FdTriggerCallback(fd, events, param); + }; event_->SetTimerEvent(fdTriggerEvent_, triggerReadFd_, true, func, NULL); event_->AddEventMessage(fdTriggerEvent_); event_->EventMessageLoop(); diff --git a/test/unittest/ril_adapter_gtest/zero_branch_test.cpp b/test/unittest/ril_adapter_gtest/zero_branch_test.cpp index e2030e9a458bdd14db823c5c9e2022e4d8c15aba..98d938a284bc9335d20e2305a88ac5cf7ffb533f 100644 --- a/test/unittest/ril_adapter_gtest/zero_branch_test.cpp +++ b/test/unittest/ril_adapter_gtest/zero_branch_test.cpp @@ -292,48 +292,49 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Call_002, Function | MediumTest | Lev auto manager = std::make_shared(); auto call = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->DialResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->HangupResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->RejectResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->HoldCallResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->UnHoldCallResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SwitchCallResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->AnswerResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetClipResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->CombineConferenceResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SeparateConferenceResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallSupplementResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetCallWaitingResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetCallTransferInfoResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetCallRestrictionResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetClirResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->StartDtmfResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SendDtmfResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->StopDtmfResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetCallPreferenceModeResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetUssdResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetMuteResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetEmergencyCallListResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->SetBarringPasswordResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallStateUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallRsrvccStatusNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->SetVonrSwitchResponse(0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->DialResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->HangupResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->RejectResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->HoldCallResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->UnHoldCallResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SwitchCallResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->AnswerResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetClipResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->CombineConferenceResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SeparateConferenceResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallSupplementResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetCallWaitingResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetCallTransferInfoResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetCallRestrictionResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetClirResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->StartDtmfResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SendDtmfResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->StopDtmfResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetCallPreferenceModeResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetUssdResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetMuteResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetEmergencyCallListResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->SetBarringPasswordResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallStateUpdated(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 1)); + EXPECT_NE( + HDF_SUCCESS, call->CallRingbackVoiceNotice(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallRsrvccStatusNotify(call.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->SetVonrSwitchResponse(call.get(), 0, responseInfo, nullptr, 1)); } /** @@ -345,41 +346,44 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Call_003, Function | MediumTest | Lev { auto call = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(call.get(), 0, responseInfo, nullptr, 0)); HRilCallInfo callInfo; callInfo.number = const_cast(NUMBER); callInfo.alpha = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(0, responseInfo, &callInfo, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(0, responseInfo, &callInfo, sizeof(HRilCallInfo))); + EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(call.get(), 0, responseInfo, &callInfo, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallListResponse(call.get(), 0, responseInfo, &callInfo, sizeof(HRilCallInfo))); HDI::Ril::V1_1::CallInfoList callList; call->BuildICallList(callList, nullptr, sizeof(HRilCallInfo)); HRilGetClipResult clipResult; - EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(0, responseInfo, &clipResult, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(0, responseInfo, &clipResult, sizeof(HRilGetClipResult))); + EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(call.get(), 0, responseInfo, &clipResult, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetClipResponse(call.get(), 0, responseInfo, &clipResult, sizeof(HRilGetClipResult))); HRilCallWaitResult waitResult; - EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(0, responseInfo, &waitResult, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(0, responseInfo, &waitResult, sizeof(HRilCallWaitResult))); + EXPECT_NE(HDF_SUCCESS, call->GetCallWaitingResponse(call.get(), 0, responseInfo, &waitResult, 1)); + EXPECT_NE(HDF_SUCCESS, + call->GetCallWaitingResponse(call.get(), 0, responseInfo, &waitResult, sizeof(HRilCallWaitResult))); HRilCFQueryInfo queryInfo; - EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(0, responseInfo, &queryInfo, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(0, responseInfo, &queryInfo, sizeof(HRilCFQueryInfo))); + EXPECT_NE(HDF_SUCCESS, call->GetCallTransferInfoResponse(call.get(), 0, responseInfo, &queryInfo, 1)); + EXPECT_NE(HDF_SUCCESS, + call->GetCallTransferInfoResponse(call.get(), 0, responseInfo, &queryInfo, sizeof(HRilCFQueryInfo))); HRilGetCallClirResult clirResult; - EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(0, responseInfo, &clirResult, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(0, responseInfo, &clirResult, sizeof(HRilGetCallClirResult))); + EXPECT_NE(HDF_SUCCESS, call->GetClirResponse(call.get(), 0, responseInfo, &clirResult, 1)); + EXPECT_NE( + HDF_SUCCESS, call->GetClirResponse(call.get(), 0, responseInfo, &clirResult, sizeof(HRilGetCallClirResult))); HRilCallRestrictionResult restrictionResult; - EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(0, responseInfo, &restrictionResult, 1)); - EXPECT_NE(HDF_SUCCESS, - call->GetCallRestrictionResponse(0, responseInfo, &restrictionResult, sizeof(HRilCallRestrictionResult))); + EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse(call.get(), 0, responseInfo, &restrictionResult, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallRestrictionResponse( + call.get(), 0, responseInfo, &restrictionResult, sizeof(HRilCallRestrictionResult))); } /** @@ -391,35 +395,36 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Call_004, Function | MediumTest | Lev { auto call = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(call.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(call.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(call.get(), 0, responseInfo, nullptr, 0)); int32_t mode = 1; - EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(0, responseInfo, &mode, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(0, responseInfo, &mode, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(call.get(), 0, responseInfo, &mode, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallPreferenceModeResponse(call.get(), 0, responseInfo, &mode, sizeof(int32_t))); int32_t mute = 1; - EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(0, responseInfo, &mute, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(0, responseInfo, &mute, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(call.get(), 0, responseInfo, &mute, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetMuteResponse(call.get(), 0, responseInfo, &mute, sizeof(int32_t))); int32_t cusd = 1; - EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(0, responseInfo, &cusd, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(0, responseInfo, &cusd, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(call.get(), 0, responseInfo, &cusd, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetUssdResponse(call.get(), 0, responseInfo, &cusd, sizeof(int32_t))); int32_t callFail = 1; - EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(0, responseInfo, &callFail, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(0, responseInfo, &callFail, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(call.get(), 0, responseInfo, &callFail, 1)); + EXPECT_NE(HDF_SUCCESS, call->GetCallFailReasonResponse(call.get(), 0, responseInfo, &callFail, sizeof(int32_t))); HDI::Ril::V1_1::EmergencyInfoList callList; call->BuildIEmergencyCallList(callList, nullptr, sizeof(HRilEmergencyInfo)); HRilEmergencyInfo emgInfo; emgInfo.eccNum = const_cast(NUMBER); emgInfo.mcc = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(0, responseInfo, &emgInfo, 1)); - EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(0, responseInfo, &emgInfo, sizeof(HRilEmergencyInfo))); + EXPECT_NE(HDF_SUCCESS, call->GetEmergencyCallListResponse(call.get(), 0, responseInfo, &emgInfo, 1)); + EXPECT_NE(HDF_SUCCESS, + call->GetEmergencyCallListResponse(call.get(), 0, responseInfo, &emgInfo, sizeof(HRilEmergencyInfo))); } /** @@ -431,29 +436,29 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Call_005, Function | MediumTest | Lev { auto call = std::make_unique(0); HRilErrNumber err = HRilErrNumber::HRIL_ERR_NULL_POINT; - EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(call.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(call.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(call.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(call.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(call.get(), 0, err, nullptr, 0)); HRilUssdNoticeInfo ussdInfo; ussdInfo.str = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(0, err, &ussdInfo, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(0, err, &ussdInfo, sizeof(HRilUssdNoticeInfo))); + EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(call.get(), 0, err, &ussdInfo, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallUssdNotice(call.get(), 0, err, &ussdInfo, sizeof(HRilUssdNoticeInfo))); HRilSsNoticeInfo ssInfo; - EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(0, err, &ssInfo, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(0, err, &ssInfo, sizeof(HRilSsNoticeInfo))); + EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(call.get(), 0, err, &ssInfo, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallSsNotice(call.get(), 0, err, &ssInfo, sizeof(HRilSsNoticeInfo))); HRilCallSrvccStatus srvccStatus; - EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(0, err, &srvccStatus, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(0, err, &srvccStatus, sizeof(HRilCallSrvccStatus))); + EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(call.get(), 0, err, &srvccStatus, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallSrvccStatusNotice(call.get(), 0, err, &srvccStatus, sizeof(HRilCallSrvccStatus))); int32_t ringbackVoiceFlag = 0; - EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(0, err, &ringbackVoiceFlag, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(0, err, &ringbackVoiceFlag, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(call.get(), 0, err, &ringbackVoiceFlag, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallRingbackVoiceNotice(call.get(), 0, err, &ringbackVoiceFlag, sizeof(int32_t))); HRilEmergencyInfo emgInfo; emgInfo.eccNum = const_cast(NUMBER); emgInfo.mcc = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(0, err, &emgInfo, 1)); - EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(0, err, &emgInfo, sizeof(HRilEmergencyInfo))); + EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(call.get(), 0, err, &emgInfo, 1)); + EXPECT_NE(HDF_SUCCESS, call->CallEmergencyNotice(call.get(), 0, err, &emgInfo, sizeof(HRilEmergencyInfo))); } /** @@ -482,18 +487,19 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Data_002, Function | MediumTest | Lev auto manager = std::make_shared(); auto data = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->DeactivatePdpContextResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->SetInitApnInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->DataLinkCapabilityUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->SetLinkBandwidthReportingRuleResponse(0, responseInfo, nullptr, 0)); - EXPECT_EQ(HDF_SUCCESS, data->SetDataProfileInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->SetDataPermittedResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->CleanAllConnectionsResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->DeactivatePdpContextResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->SetInitApnInfoResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(data.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE( + HDF_SUCCESS, data->DataLinkCapabilityUpdated(data.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->SetLinkBandwidthReportingRuleResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_EQ(HDF_SUCCESS, data->SetDataProfileInfoResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->SetDataPermittedResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->CleanAllConnectionsResponse(data.get(), 0, responseInfo, nullptr, 0)); } /** @@ -506,16 +512,16 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Data_003, Function | MediumTest | Lev auto data = std::make_unique(0); HRilErrNumber err = HRilErrNumber::HRIL_ERR_NULL_POINT; HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->DataLinkCapabilityUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(data.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(data.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(data.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->DataLinkCapabilityUpdated(data.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(data.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(data.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(data.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(data.get(), 0, responseInfo, nullptr, 0)); HRilDataCallResponse pDataCall; int32_t len = sizeof(HRilDataCallResponse); pDataCall.type = const_cast(NUMBER); @@ -529,25 +535,27 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Data_003, Function | MediumTest | Lev HDI::Ril::V1_1::SetupDataCallResultInfo result; data->SwitchRilDataToHal(nullptr, result); data->SwitchRilDataToHal(&pDataCall, result); - EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(0, responseInfo, &pDataCall, 1)); - EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(0, responseInfo, &pDataCall, len)); + EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(data.get(), 0, responseInfo, &pDataCall, 1)); + EXPECT_NE(HDF_SUCCESS, data->ActivatePdpContextResponse(data.get(), 0, responseInfo, &pDataCall, len)); HDI::Ril::V1_1::DataCallResultList dataCallResultList; dataCallResultList.dcList.push_back(result); data->SwitchHRilDataListToHal(nullptr, 0, dataCallResultList.dcList); data->SwitchHRilDataListToHal(&pDataCall, len, dataCallResultList.dcList); - EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(0, responseInfo, &pDataCall, 1)); - EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(0, responseInfo, &pDataCall, len)); - EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(0, err, &pDataCall, 1)); - EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(0, err, &pDataCall, len)); + EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(data.get(), 0, responseInfo, &pDataCall, 1)); + EXPECT_NE(HDF_SUCCESS, data->GetPdpContextListResponse(data.get(), 0, responseInfo, &pDataCall, len)); + EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(data.get(), 0, err, &pDataCall, 1)); + EXPECT_NE(HDF_SUCCESS, data->PdpContextListUpdated(data.get(), 0, err, &pDataCall, len)); HRilDataLinkCapability capability; - EXPECT_NE(HDF_SUCCESS, data->DataLinkCapabilityUpdated(0, err, &capability, 1)); - EXPECT_NE(HDF_SUCCESS, data->DataLinkCapabilityUpdated(0, err, &capability, sizeof(HRilDataLinkCapability))); - EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(0, responseInfo, &capability, 1)); + EXPECT_NE(HDF_SUCCESS, data->DataLinkCapabilityUpdated(data.get(), 0, err, &capability, 1)); EXPECT_NE( - HDF_SUCCESS, data->GetLinkCapabilityResponse(0, responseInfo, &capability, sizeof(HRilDataLinkCapability))); + HDF_SUCCESS, data->DataLinkCapabilityUpdated(data.get(), 0, err, &capability, sizeof(HRilDataLinkCapability))); + EXPECT_NE(HDF_SUCCESS, data->GetLinkCapabilityResponse(data.get(), 0, responseInfo, &capability, 1)); + EXPECT_NE(HDF_SUCCESS, + data->GetLinkCapabilityResponse(data.get(), 0, responseInfo, &capability, sizeof(HRilDataLinkCapability))); HRilLinkBandwidthInfo info; - EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(0, responseInfo, &info, 1)); - EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(0, responseInfo, &info, sizeof(HRilLinkBandwidthInfo))); + EXPECT_NE(HDF_SUCCESS, data->GetLinkBandwidthInfoResponse(data.get(), 0, responseInfo, &info, 1)); + EXPECT_NE(HDF_SUCCESS, + data->GetLinkBandwidthInfoResponse(data.get(), 0, responseInfo, &info, sizeof(HRilLinkBandwidthInfo))); } /** @@ -576,17 +584,18 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Modem_002, Function | MediumTest | Le auto manager = std::make_shared(); auto modem = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, modem->ShutDownResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->SetRadioStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->ShutDownResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->SetRadioStateResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(modem.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE( + HDF_SUCCESS, modem->VoiceRadioTechUpdated(modem.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(modem.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); } /** @@ -599,49 +608,49 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Modem_003, Function | MediumTest | Le auto modem = std::make_unique(0); HRilErrNumber err = HRilErrNumber::HRIL_ERR_NULL_POINT; HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(0, err, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(0, err, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(0, err, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(0, responseInfo, nullptr, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(modem.get(), 0, err, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(modem.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(modem.get(), 0, err, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(modem.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(modem.get(), 0, err, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(modem.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(modem.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(modem.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(modem.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(modem.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(modem.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(modem.get(), 0, responseInfo, nullptr, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(modem.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_GENERIC_FAILURE; - EXPECT_NE(HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(modem.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; - EXPECT_NE(HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(modem.get(), 0, responseInfo, nullptr, 0)); int32_t in = 1; - EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(0, err, &in, 1)); - EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(0, err, &in, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(modem.get(), 0, err, &in, 1)); + EXPECT_NE(HDF_SUCCESS, modem->RadioStateUpdated(modem.get(), 0, err, &in, sizeof(int32_t))); HRilVoiceRadioInfo radioInfo; radioInfo.sysModeName = const_cast(NUMBER); radioInfo.actName = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(0, err, &radioInfo, 1)); - EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(0, err, &radioInfo, sizeof(HRilVoiceRadioInfo))); - EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(0, err, &in, 1)); - EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(0, err, &in, sizeof(int32_t))); - EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(0, responseInfo, &in, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(0, responseInfo, &in, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(modem.get(), 0, err, &radioInfo, 1)); + EXPECT_NE(HDF_SUCCESS, modem->VoiceRadioTechUpdated(modem.get(), 0, err, &radioInfo, sizeof(HRilVoiceRadioInfo))); + EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(modem.get(), 0, err, &in, 1)); + EXPECT_NE(HDF_SUCCESS, modem->DsdsModeUpdated(modem.get(), 0, err, &in, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(modem.get(), 0, responseInfo, &in, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetRadioStateResponse(modem.get(), 0, responseInfo, &in, sizeof(int32_t))); char *str = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(0, responseInfo, str, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(0, responseInfo, str, sizeof(NUMBER))); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(0, responseInfo, str, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(0, responseInfo, str, sizeof(NUMBER))); - EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(0, responseInfo, str, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(0, responseInfo, str, sizeof(NUMBER))); - EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(0, responseInfo, str, 1)); - EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(0, responseInfo, str, sizeof(NUMBER))); - EXPECT_NE( - HDF_SUCCESS, modem->GetVoiceRadioTechnologyResponse(0, responseInfo, &radioInfo, sizeof(HRilVoiceRadioInfo))); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(modem.get(), 0, responseInfo, str, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiResponse(modem.get(), 0, responseInfo, str, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(modem.get(), 0, responseInfo, str, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetImeiSvResponse(modem.get(), 0, responseInfo, str, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(modem.get(), 0, responseInfo, str, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetMeidResponse(modem.get(), 0, responseInfo, str, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(modem.get(), 0, responseInfo, str, 1)); + EXPECT_NE(HDF_SUCCESS, modem->GetBasebandVersionResponse(modem.get(), 0, responseInfo, str, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, + modem->GetVoiceRadioTechnologyResponse(modem.get(), 0, responseInfo, &radioInfo, sizeof(HRilVoiceRadioInfo))); } /** @@ -668,39 +677,39 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Sim_002, Function | MediumTest | Leve auto manager = std::make_shared(); auto sim = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, sim->GetSimIOResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->GetSimCardStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->GetImsiResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->GetSimLockStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SetSimLockResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->ChangeSimPasswordResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->UnlockPinResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->UnlockPukResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->UnlockPin2Response(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->UnlockPuk2Response(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SetActiveSimResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkSendTerminalResponseResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkSendEnvelopeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkSendCallSetupRequestResultResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkIsReadyResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->GetRadioProtocolResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SetRadioProtocolResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimOpenLogicalChannelResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimCloseLogicalChannelResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimTransmitApduLogicalChannelResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimTransmitApduBasicChannelResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimAuthenticationResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->UnlockSimLockResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SendSimMatchedOperatorInfoResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->GetSimIOResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->GetSimCardStatusResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->GetImsiResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->GetSimLockStatusResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SetSimLockResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->ChangeSimPasswordResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->UnlockPinResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->UnlockPukResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->UnlockPin2Response(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->UnlockPuk2Response(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SetActiveSimResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkSendTerminalResponseResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkSendEnvelopeResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkSendCallSetupRequestResultResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkIsReadyResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->GetRadioProtocolResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SetRadioProtocolResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimOpenLogicalChannelResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimCloseLogicalChannelResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimTransmitApduLogicalChannelResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimTransmitApduBasicChannelResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimAuthenticationResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->UnlockSimLockResponse(sim.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SendSimMatchedOperatorInfoResponse(sim.get(), 0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStateUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkSessionEndNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkProactiveNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkAlphaNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkEventNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimStkCallSetupNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimRefreshNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sim->SimRadioProtocolUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStateUpdated(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkSessionEndNotify(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkProactiveNotify(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkAlphaNotify(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkEventNotify(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimStkCallSetupNotify(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimRefreshNotify(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sim->SimRadioProtocolUpdated(sim.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); } /** @@ -725,48 +734,49 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Network_001, Function | MediumTest | HWTEST_F(BranchTest, Telephony_HrilManager_Network_002, Function | MediumTest | Level3) { auto manager = std::make_shared(); - auto network = std::make_unique(0); + auto nw = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SetNetworkSelectionModeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SetPreferredNetworkResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SetLocateUpdatesResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SetNotificationFilterResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SetDeviceStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SetNrOptionModeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetSignalStrengthResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetCsRegStatusResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetPsRegStatusResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetOperatorInfoResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetNetworkSearchInformationResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetNetworkSelectionModeResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SetNetworkSelectionModeResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SetPreferredNetworkResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetPreferredNetworkResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetNeighboringCellInfoListResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetNeighboringCellInfoListResponse_1_2(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetCurrentCellInfoResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetCurrentCellInfoResponse_1_1(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetCurrentCellInfoResponse_1_2(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetPhysicalChannelConfigResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SetLocateUpdatesResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SetNotificationFilterResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SetDeviceStateResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetRrcConnectionStateResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetNrOptionModeResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SetNrOptionModeResponse(nw.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->GetNrSsbIdResponse(nw.get(), 0, responseInfo, nullptr, 0)); HRilRegStatusInfo regStatusInfo; - EXPECT_NE(HDF_SUCCESS, network->NetworkCsRegStatusUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCsRegStatusUpdated( - 0, HRilErrNumber::HRIL_ERR_NULL_POINT, (const uint8_t *)(®StatusInfo), 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCsRegStatusUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, + EXPECT_NE(HDF_SUCCESS, nw->NetworkCsRegStatusUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkCsRegStatusUpdated( + nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, (const uint8_t *)(®StatusInfo), 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkCsRegStatusUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, (const uint8_t *)(®StatusInfo), sizeof(HRilRegStatusInfo))); - EXPECT_NE(HDF_SUCCESS, network->NetworkPsRegStatusUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkPsRegStatusUpdated( - 0, HRilErrNumber::HRIL_ERR_NULL_POINT, (const uint8_t *)(®StatusInfo), 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkPsRegStatusUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, + EXPECT_NE(HDF_SUCCESS, nw->NetworkPsRegStatusUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkPsRegStatusUpdated( + nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, (const uint8_t *)(®StatusInfo), 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkPsRegStatusUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, (const uint8_t *)(®StatusInfo), sizeof(HRilRegStatusInfo))); - EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkTimeUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkTimeZoneUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkPhyChnlCfgUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->ResidentNetworkUpdated(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->SignalStrengthUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkTimeUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkTimeZoneUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkPhyChnlCfgUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->NetworkCurrentCellUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE( + HDF_SUCCESS, nw->NetworkCurrentCellUpdated_1_2(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, nw->ResidentNetworkUpdated(nw.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); } /** @@ -815,35 +825,38 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Network_004, Function | MediumTest | auto network = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_GENERIC_FAILURE; - EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(network.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; - EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(network.get(), 0, responseInfo, nullptr, 0)); NrCellSsbIdsVendor nrSsbIdInfo; - EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(0, responseInfo, &nrSsbIdInfo, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(network.get(), 0, responseInfo, &nrSsbIdInfo, 0)); nrSsbIdInfo.nbCellCount = 5; - EXPECT_NE(HDF_SUCCESS, network->GetNrSsbIdResponse(0, responseInfo, &nrSsbIdInfo, sizeof(NrCellSsbIdsVendor))); + EXPECT_NE(HDF_SUCCESS, + network->GetNrSsbIdResponse(network.get(), 0, responseInfo, &nrSsbIdInfo, sizeof(NrCellSsbIdsVendor))); CurrentCellInfoList info = { 1, nullptr }; - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(0, responseInfo, &info, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(0, responseInfo, &info, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(0, responseInfo, &info, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(0, responseInfo, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE( - HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(0, responseInfo, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE( - HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(0, responseInfo, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(network.get(), 0, responseInfo, &info, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(network.get(), 0, responseInfo, &info, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(network.get(), 0, responseInfo, &info, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetCurrentCellInfoResponse(network.get(), 0, responseInfo, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetCurrentCellInfoResponse_1_1(network.get(), 0, responseInfo, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetCurrentCellInfoResponse_1_2(network.get(), 0, responseInfo, &info, sizeof(CurrentCellInfoList))); CurrentCellInfoVendor infoVendor; info.currentCellInfo = &infoVendor; - EXPECT_NE(HDF_SUCCESS, network->GetCurrentCellInfoResponse(0, responseInfo, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE( - HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_1(0, responseInfo, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE( - HDF_SUCCESS, network->GetCurrentCellInfoResponse_1_2(0, responseInfo, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetCurrentCellInfoResponse(network.get(), 0, responseInfo, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetCurrentCellInfoResponse_1_1(network.get(), 0, responseInfo, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetCurrentCellInfoResponse_1_2(network.get(), 0, responseInfo, &info, sizeof(CurrentCellInfoList))); } /** @@ -922,21 +935,23 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Network_006, Function | MediumTest | network->FillCellNearbyInfo(cellNearbyInfo, &cellInfo); network->FillCellNearbyInfo(cellNearbyInfo_1_2, &cellInfo); responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_GENERIC_FAILURE; - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(network.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(network.get(), 0, responseInfo, nullptr, 0)); CellInfoList list = { 1, nullptr }; - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(0, responseInfo, &list, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(0, responseInfo, &list, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(0, responseInfo, &list, sizeof(CellInfoList))); - EXPECT_NE( - HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(0, responseInfo, &list, sizeof(CellInfoList))); + EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(network.get(), 0, responseInfo, &list, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(network.get(), 0, responseInfo, &list, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetNeighboringCellInfoListResponse(network.get(), 0, responseInfo, &list, sizeof(CellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetNeighboringCellInfoListResponse_1_2(network.get(), 0, responseInfo, &list, sizeof(CellInfoList))); list.cellNearbyInfo = &cellInfo; - EXPECT_NE(HDF_SUCCESS, network->GetNeighboringCellInfoListResponse(0, responseInfo, &list, sizeof(CellInfoList))); - EXPECT_NE( - HDF_SUCCESS, network->GetNeighboringCellInfoListResponse_1_2(0, responseInfo, &list, sizeof(CellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetNeighboringCellInfoListResponse(network.get(), 0, responseInfo, &list, sizeof(CellInfoList))); + EXPECT_NE(HDF_SUCCESS, + network->GetNeighboringCellInfoListResponse_1_2(network.get(), 0, responseInfo, &list, sizeof(CellInfoList))); } /** @@ -949,33 +964,37 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Network_007, Function | MediumTest | auto network = std::make_unique(0); HRilErrNumber err = HRilErrNumber::HRIL_ERR_NULL_POINT; HRilRssi hrilRssi; - EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(0, err, &hrilRssi, 0)); - EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(0, err, &hrilRssi, sizeof(HRilRssi))); - EXPECT_NE(HDF_SUCCESS, network->NetworkTimeUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkTimeUpdated(0, err, NUMBER, sizeof(NUMBER))); - EXPECT_NE(HDF_SUCCESS, network->NetworkTimeZoneUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkTimeZoneUpdated(0, err, NUMBER, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(network.get(), 0, err, &hrilRssi, 0)); + EXPECT_NE(HDF_SUCCESS, network->SignalStrengthUpdated(network.get(), 0, err, &hrilRssi, sizeof(HRilRssi))); + EXPECT_NE(HDF_SUCCESS, network->NetworkTimeUpdated(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->NetworkTimeUpdated(network.get(), 0, err, NUMBER, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, network->NetworkTimeZoneUpdated(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->NetworkTimeZoneUpdated(network.get(), 0, err, NUMBER, sizeof(NUMBER))); int32_t contextIds[] = { 1, 1, 1 }; HRilPhyChannelConfig configInfo = { HRIL_SERVING_CELL_PRIMARY, RADIO_TECHNOLOGY_GSM, 1, 1, 1, 1, 1, 1, 1 }; configInfo.contextIds = contextIds; HRilChannelConfigList configInfoList = { 1, &configInfo }; - EXPECT_NE(HDF_SUCCESS, network->NetworkPhyChnlCfgUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkPhyChnlCfgUpdated(0, err, &configInfoList, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkPhyChnlCfgUpdated(0, err, &configInfoList, sizeof(HRilChannelConfigList))); + EXPECT_NE(HDF_SUCCESS, network->NetworkPhyChnlCfgUpdated(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->NetworkPhyChnlCfgUpdated(network.get(), 0, err, &configInfoList, 0)); + EXPECT_NE(HDF_SUCCESS, + network->NetworkPhyChnlCfgUpdated(network.get(), 0, err, &configInfoList, sizeof(HRilChannelConfigList))); CurrentCellInfoVendor infoVendor; CurrentCellInfoList info = { 1, &infoVendor }; - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated(0, err, &info, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated(0, err, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_1(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_1(0, err, &info, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_1(0, err, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(0, err, &info, 0)); - EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(0, err, &info, sizeof(CurrentCellInfoList))); - EXPECT_NE(HDF_SUCCESS, network->ResidentNetworkUpdated(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->ResidentNetworkUpdated(0, err, NUMBER, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated(network.get(), 0, err, &info, 0)); + EXPECT_NE( + HDF_SUCCESS, network->NetworkCurrentCellUpdated(network.get(), 0, err, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_1(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_1(network.get(), 0, err, &info, 0)); + EXPECT_NE( + HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_1(network.get(), 0, err, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(network.get(), 0, err, &info, 0)); + EXPECT_NE( + HDF_SUCCESS, network->NetworkCurrentCellUpdated_1_2(network.get(), 0, err, &info, sizeof(CurrentCellInfoList))); + EXPECT_NE(HDF_SUCCESS, network->ResidentNetworkUpdated(network.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->ResidentNetworkUpdated(network.get(), 0, err, NUMBER, sizeof(NUMBER))); } /** @@ -988,39 +1007,43 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Network_008, Function | MediumTest | auto network = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_GENERIC_FAILURE; - EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(network.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; - EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(network.get(), 0, responseInfo, nullptr, 0)); HRilRssi hrilRssi; - EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(0, responseInfo, &hrilRssi, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(0, responseInfo, &hrilRssi, sizeof(HRilRssi))); + EXPECT_NE(HDF_SUCCESS, network->GetSignalStrengthResponse(network.get(), 0, responseInfo, &hrilRssi, 0)); + EXPECT_NE( + HDF_SUCCESS, network->GetSignalStrengthResponse(network.get(), 0, responseInfo, &hrilRssi, sizeof(HRilRssi))); HRilRegStatusInfo statusInfo; - EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(0, responseInfo, &statusInfo, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(0, responseInfo, &statusInfo, sizeof(HRilRegStatusInfo))); - EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(0, responseInfo, &statusInfo, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(0, responseInfo, &statusInfo, sizeof(HRilRegStatusInfo))); - EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(0, responseInfo, &NUMBER, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(0, responseInfo, &NUMBER, sizeof(NUMBER))); + EXPECT_NE(HDF_SUCCESS, network->GetCsRegStatusResponse(network.get(), 0, responseInfo, &statusInfo, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetCsRegStatusResponse(network.get(), 0, responseInfo, &statusInfo, sizeof(HRilRegStatusInfo))); + EXPECT_NE(HDF_SUCCESS, network->GetPsRegStatusResponse(network.get(), 0, responseInfo, &statusInfo, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetPsRegStatusResponse(network.get(), 0, responseInfo, &statusInfo, sizeof(HRilRegStatusInfo))); + EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(network.get(), 0, responseInfo, &NUMBER, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetOperatorInfoResponse(network.get(), 0, responseInfo, &NUMBER, sizeof(NUMBER))); AvailableOperInfo *operInfo = (AvailableOperInfo *)malloc(2 * sizeof(AvailableOperInfo)); operInfo->longName = const_cast(NUMBER); operInfo->shortName = const_cast(NUMBER); operInfo->numeric = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(0, responseInfo, &operInfo, 0)); - EXPECT_NE(HDF_SUCCESS, - network->GetNetworkSearchInformationResponse(0, responseInfo, &operInfo, sizeof(AvailableOperInfo *))); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse(network.get(), 0, responseInfo, &operInfo, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSearchInformationResponse( + network.get(), 0, responseInfo, &operInfo, sizeof(AvailableOperInfo *))); int32_t selectMode = 1; - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(0, responseInfo, &selectMode, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(0, responseInfo, &selectMode, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, network->GetNetworkSelectionModeResponse(network.get(), 0, responseInfo, &selectMode, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetNetworkSelectionModeResponse(network.get(), 0, responseInfo, &selectMode, sizeof(int32_t))); } /** @@ -1033,31 +1056,35 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Network_009, Function | MediumTest | auto network = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_GENERIC_FAILURE; - EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(network.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; - EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(network.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(network.get(), 0, responseInfo, nullptr, 0)); int32_t networkType = 1; - EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(0, responseInfo, &networkType, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(0, responseInfo, &networkType, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, network->GetPreferredNetworkResponse(network.get(), 0, responseInfo, &networkType, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetPreferredNetworkResponse(network.get(), 0, responseInfo, &networkType, sizeof(int32_t))); int32_t contextIds[] = { 1, 1, 1 }; HRilPhyChannelConfig configInfo = { HRIL_SERVING_CELL_PRIMARY, RADIO_TECHNOLOGY_GSM, 1, 1, 1, 1, 1, 1, 1 }; configInfo.contextIds = contextIds; HRilChannelConfigList configInfoList = { 1, &configInfo }; - EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(0, responseInfo, &configInfoList, 0)); - EXPECT_NE(HDF_SUCCESS, - network->GetPhysicalChannelConfigResponse(0, responseInfo, &configInfoList, sizeof(HRilChannelConfigList))); + EXPECT_NE( + HDF_SUCCESS, network->GetPhysicalChannelConfigResponse(network.get(), 0, responseInfo, &configInfoList, 0)); + EXPECT_NE(HDF_SUCCESS, network->GetPhysicalChannelConfigResponse( + network.get(), 0, responseInfo, &configInfoList, sizeof(HRilChannelConfigList))); int32_t connState = 1; - EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(0, responseInfo, &connState, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(0, responseInfo, &connState, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, network->GetRrcConnectionStateResponse(network.get(), 0, responseInfo, &connState, 0)); + EXPECT_NE(HDF_SUCCESS, + network->GetRrcConnectionStateResponse(network.get(), 0, responseInfo, &connState, sizeof(int32_t))); int32_t nrOptionMode = 1; - EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(0, responseInfo, &nrOptionMode, 0)); - EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(0, responseInfo, &nrOptionMode, sizeof(int32_t))); + EXPECT_NE(HDF_SUCCESS, network->GetNrOptionModeResponse(network.get(), 0, responseInfo, &nrOptionMode, 0)); + EXPECT_NE( + HDF_SUCCESS, network->GetNrOptionModeResponse(network.get(), 0, responseInfo, &nrOptionMode, sizeof(int32_t))); int32_t mode = 0; EXPECT_NE(HDF_SUCCESS, network->SetLocateUpdates(0, static_cast(mode))); mode = -1; @@ -1092,25 +1119,25 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Sms_002, Function | MediumTest | Leve auto manager = std::make_shared(); auto sms = std::make_unique(0); HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; - EXPECT_NE(HDF_SUCCESS, sms->SendGsmSmsResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SendCdmaSmsResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->AddSimMessageResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->DelSimMessageResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->UpdateSimMessageResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SetSmscAddrResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SetCBConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SetCdmaCBConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SendSmsMoreModeResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SendSmsAckResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->AddCdmaSimMessageResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->DelCdmaSimMessageResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->UpdateCdmaSimMessageResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SendGsmSmsResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SendCdmaSmsResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->AddSimMessageResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->DelSimMessageResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->UpdateSimMessageResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SetSmscAddrResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SetCBConfigResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SetCdmaCBConfigResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SendSmsMoreModeResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SendSmsAckResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->AddCdmaSimMessageResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->DelCdmaSimMessageResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->UpdateCdmaSimMessageResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(sms.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(sms.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(sms.get(), 0, HRilErrNumber::HRIL_ERR_NULL_POINT, nullptr, 0)); } /** @@ -1213,22 +1240,25 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Sms_005, Function | MediumTest | Leve HDI::Ril::V1_1::RilRadioResponseInfo responseInfo; HRilErrNumber err = HRilErrNumber::HRIL_ERR_NULL_POINT; responseInfo.error = HDI::Ril::V1_1::RilErrType::RIL_ERR_GENERIC_FAILURE; - EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(sms.get(), 0, responseInfo, nullptr, 0)); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; - EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(0, responseInfo, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(0, err, nullptr, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(sms.get(), 0, responseInfo, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(sms.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(sms.get(), 0, err, nullptr, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(sms.get(), 0, err, nullptr, 0)); HRilServiceCenterAddress scAddress; - EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(0, responseInfo, &scAddress, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(0, responseInfo, &scAddress, sizeof(HRilServiceCenterAddress))); + EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(sms.get(), 0, responseInfo, &scAddress, 0)); + EXPECT_NE(HDF_SUCCESS, + sms->GetSmscAddrResponse(sms.get(), 0, responseInfo, &scAddress, sizeof(HRilServiceCenterAddress))); scAddress.address = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, sms->GetSmscAddrResponse(0, responseInfo, &scAddress, sizeof(HRilServiceCenterAddress))); + EXPECT_NE(HDF_SUCCESS, + sms->GetSmscAddrResponse(sms.get(), 0, responseInfo, &scAddress, sizeof(HRilServiceCenterAddress))); HRilCBConfigInfo cellBroadcastInfo; - EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(0, responseInfo, &cellBroadcastInfo, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(0, responseInfo, &cellBroadcastInfo, sizeof(HRilCBConfigInfo))); + EXPECT_NE(HDF_SUCCESS, sms->GetCBConfigResponse(sms.get(), 0, responseInfo, &cellBroadcastInfo, 0)); + EXPECT_NE(HDF_SUCCESS, + sms->GetCBConfigResponse(sms.get(), 0, responseInfo, &cellBroadcastInfo, sizeof(HRilCBConfigInfo))); cellBroadcastInfo.endOfCodeScheme = 1; cellBroadcastInfo.endOfServiceId = 1; HDI::Ril::V1_1::CBConfigInfo configInfo; @@ -1238,20 +1268,21 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Sms_005, Function | MediumTest | Leve cellBroadcastInfo.startOfServiceId = 3; ASSERT_FALSE(sms->GetCBConfigInfo(&cellBroadcastInfo, 1, configInfo)); HRilCdmaCBConfigInfo cdmaConfig; - EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(0, responseInfo, &cdmaConfig, 0)); - EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(0, responseInfo, &cdmaConfig, sizeof(HRilCdmaCBConfigInfo))); + EXPECT_NE(HDF_SUCCESS, sms->GetCdmaCBConfigResponse(sms.get(), 0, responseInfo, &cdmaConfig, 0)); + EXPECT_NE(HDF_SUCCESS, + sms->GetCdmaCBConfigResponse(sms.get(), 0, responseInfo, &cdmaConfig, sizeof(HRilCdmaCBConfigInfo))); uint8_t *data = (uint8_t *)malloc(2 * sizeof(uint8_t)); - EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(0, err, data, 0)); - EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(0, err, data, 1)); - EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(0, err, data, NUM_TWO)); + EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(sms.get(), 0, err, data, 0)); + EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(sms.get(), 0, err, data, 1)); + EXPECT_NE(HDF_SUCCESS, sms->SmsStatusReportNotify(sms.get(), 0, err, data, NUM_TWO)); HRilSmsResponse smsResponse; - EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(0, err, &smsResponse, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(0, err, &smsResponse, sizeof(HRilSmsResponse))); - EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(0, err, &smsResponse, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(0, err, &smsResponse, sizeof(HRilSmsResponse))); + EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(sms.get(), 0, err, &smsResponse, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(sms.get(), 0, err, &smsResponse, sizeof(HRilSmsResponse))); + EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(sms.get(), 0, err, &smsResponse, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(sms.get(), 0, err, &smsResponse, sizeof(HRilSmsResponse))); smsResponse.pdu = const_cast(NUMBER); - EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(0, err, &smsResponse, sizeof(HRilSmsResponse))); - EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(0, err, &smsResponse, sizeof(HRilSmsResponse))); + EXPECT_NE(HDF_SUCCESS, sms->NewSmsNotify(sms.get(), 0, err, &smsResponse, sizeof(HRilSmsResponse))); + EXPECT_NE(HDF_SUCCESS, sms->NewCdmaSmsNotify(sms.get(), 0, err, &smsResponse, sizeof(HRilSmsResponse))); } /** @@ -1268,13 +1299,13 @@ HWTEST_F(BranchTest, Telephony_HrilManager_Sms_006, Function | MediumTest | Leve sms->MakeSendSmsResult(responseInfo, 0, nullptr, 0); responseInfo.error = HDI::Ril::V1_1::RilErrType::NONE; sms->MakeSendSmsResult(responseInfo, 0, nullptr, 0); - EXPECT_EQ(HDF_SUCCESS, sms->NewSmsStoredOnSimNotify(1, err, nullptr, 0)); + EXPECT_EQ(HDF_SUCCESS, sms->NewSmsStoredOnSimNotify(sms.get(), 1, err, nullptr, 0)); ASSERT_FALSE(sms->RequestWithInts(nullptr, nullptr, 0, 0)); ASSERT_FALSE(sms->RequestWithInts(nullptr, nullptr, 0, 1)); sms->MakeCBConfigResult(nullptr, 0); int32_t recordNumber = 0; - EXPECT_EQ(HDF_SUCCESS, sms->NewSmsStoredOnSimNotify(1, err, &recordNumber, 0)); - EXPECT_NE(HDF_SUCCESS, sms->NewSmsStoredOnSimNotify(1, err, &recordNumber, sizeof(int32_t))); + EXPECT_EQ(HDF_SUCCESS, sms->NewSmsStoredOnSimNotify(sms.get(), 1, err, &recordNumber, 0)); + EXPECT_NE(HDF_SUCCESS, sms->NewSmsStoredOnSimNotify(sms.get(), 1, err, &recordNumber, sizeof(int32_t))); HRilSmsResponse smsResponse; sms->MakeSendSmsResult(responseInfo, 0, &smsResponse, 0); sms->MakeSendSmsResult(responseInfo, 0, &smsResponse, sizeof(HRilSmsResponse));