diff --git a/test/fuzztest/callemergencynotice_fuzzer/callemergencynotice_fuzzer.cpp b/test/fuzztest/callemergencynotice_fuzzer/callemergencynotice_fuzzer.cpp index 57d63176..4dc793b3 100644 --- a/test/fuzztest/callemergencynotice_fuzzer/callemergencynotice_fuzzer.cpp +++ b/test/fuzztest/callemergencynotice_fuzzer/callemergencynotice_fuzzer.cpp @@ -44,11 +44,11 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) info.simpresent = static_cast(size); info.mcc = const_cast(NUMBER); info.abnormalService = static_cast(size); - - HRilManager hrilManger; - std::shared_ptr hrilCall = std::make_shared(slotId, hrilManger); - - hrilCall->CallEmergencyNotice(HRIL_RESPONSE_NOTICE, error, &info, sizeof(HRilEmergencyInfo)); + struct ReportInfo report; + report.error = error; + report.notifyId = HNOTI_CALL_EMERGENCY_NUMBER_REPORT; + report.type = HRIL_NOTIFICATION; + HRilManager::manager_->OnCallReport(slotId, &report, (const uint8_t *)&info, sizeof(HRilEmergencyInfo)); return; } } // namespace OHOS diff --git a/test/fuzztest/callussdnotice_fuzzer/callussdnotice_fuzzer.cpp b/test/fuzztest/callussdnotice_fuzzer/callussdnotice_fuzzer.cpp index e3df24a1..1abb4cca 100644 --- a/test/fuzztest/callussdnotice_fuzzer/callussdnotice_fuzzer.cpp +++ b/test/fuzztest/callussdnotice_fuzzer/callussdnotice_fuzzer.cpp @@ -35,14 +35,14 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) } int32_t slotId = static_cast(size % SLOT_NUM); - HRilErrNumber error = static_cast(size); HRilUssdNoticeInfo info; info.m = static_cast(size); info.str = const_cast(NUMBER); - HRilManager hrilManger; - std::shared_ptr hrilCall = std::make_shared(slotId, hrilManger); - - hrilCall->CallUssdNotice(HRIL_RESPONSE_NOTICE, error, &info, sizeof(HRilUssdNoticeInfo)); + struct ReportInfo report; + report.error = static_cast(size); + report.notifyId = HNOTI_CALL_USSD_REPORT; + report.type = HRIL_NOTIFICATION; + HRilManager::manager_->OnCallReport(slotId, &report, (const uint8_t *)&info, sizeof(HRilUssdNoticeInfo)); return; } } // namespace OHOS diff --git a/test/fuzztest/createcdmasms_fuzzer/createcdmasms_fuzzer.cpp b/test/fuzztest/createcdmasms_fuzzer/createcdmasms_fuzzer.cpp index 2ca114bd..7ffee636 100644 --- a/test/fuzztest/createcdmasms_fuzzer/createcdmasms_fuzzer.cpp +++ b/test/fuzztest/createcdmasms_fuzzer/createcdmasms_fuzzer.cpp @@ -35,9 +35,7 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) OHOS::HDI::Ril::V1_1::SmsMessageIOInfo message; std::string pdu(reinterpret_cast(data), size); message.pdu = pdu; - HRilManager hrilManager; - std::shared_ptr hrilSms = std::make_shared(slotId, hrilManager); - hrilSms->AddCdmaSimMessage(size, message); + HRilManager::manager_->AddCdmaSimMessage(slotId, size, message); return; } } // namespace OHOS diff --git a/test/fuzztest/newsmsnotify_fuzzer/newsmsnotify_fuzzer.cpp b/test/fuzztest/newsmsnotify_fuzzer/newsmsnotify_fuzzer.cpp index d2996fac..c9dbb133 100644 --- a/test/fuzztest/newsmsnotify_fuzzer/newsmsnotify_fuzzer.cpp +++ b/test/fuzztest/newsmsnotify_fuzzer/newsmsnotify_fuzzer.cpp @@ -35,17 +35,16 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) } int32_t slotId = static_cast(size % SLOT_NUM); - struct ReportInfo reportInfo; - reportInfo.error = static_cast(size); - reportInfo.notifyId = HNOTI_SMS_NEW_SMS; HRilSmsResponse response; response.msgRef = static_cast(size); response.pdu = const_cast(NUMBER); response.errCode = static_cast(size); - HRilManager hrilManager; - std::shared_ptr hrilSms = std::make_shared(slotId, hrilManager); - hrilSms->ProcessNotify(HRIL_RESPONSE_NOTICE, &reportInfo, &response, size); + struct ReportInfo report; + report.error = static_cast(size); + report.notifyId = HNOTI_SMS_NEW_SMS; + report.type = HRIL_NOTIFICATION; + HRilManager::manager_->OnSmsReport(slotId, &report, (const uint8_t *)&response, sizeof(HRilSmsResponse)); return; } } // namespace OHOS diff --git a/test/fuzztest/pdpcontextlistupdated_fuzzer/pdpcontextlistupdated_fuzzer.cpp b/test/fuzztest/pdpcontextlistupdated_fuzzer/pdpcontextlistupdated_fuzzer.cpp index 43f132a5..ce5225cd 100644 --- a/test/fuzztest/pdpcontextlistupdated_fuzzer/pdpcontextlistupdated_fuzzer.cpp +++ b/test/fuzztest/pdpcontextlistupdated_fuzzer/pdpcontextlistupdated_fuzzer.cpp @@ -39,7 +39,6 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) } int32_t slotId = static_cast(size % SLOT_NUM); - HRilErrNumber error = static_cast(size); HRilDataCallResponse response; response.reason = static_cast(size) % REASON_TYPE; @@ -56,16 +55,21 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) response.pCscfPrimAddr = const_cast(NUMBER); response.pCscfSecAddr = const_cast(NUMBER); response.pduSessionId = static_cast(size); - HRilManager hrilManager; - std::shared_ptr hrilData = std::make_shared(slotId, hrilManager); - hrilData->PdpContextListUpdated(HRIL_RESPONSE_NOTICE, error, &response, sizeof(HRilDataCallResponse)); + + struct ReportInfo report; + report.error = static_cast(size); + report.notifyId = HNOTI_DATA_PDP_CONTEXT_LIST_UPDATED; + report.type = HRIL_NOTIFICATION; + HRilManager::manager_->OnDataReport(slotId, &report, (const uint8_t *)&response, sizeof(HRilDataCallResponse)); HRilDataLinkCapability linkCapability; linkCapability.primaryDownlinkKbps = static_cast(size) * KILO_BIT; linkCapability.primaryUplinkKbps = static_cast(size) * KILO_BIT; linkCapability.secondaryDownlinkKbps = static_cast(size) * KILO_BIT; linkCapability.secondaryUplinkKbps = static_cast(size) * KILO_BIT; - hrilData->DataLinkCapabilityUpdated(HRIL_RESPONSE_NOTICE, error, &linkCapability, sizeof(HRilDataLinkCapability)); + report.notifyId = HNOTI_DATA_LINK_CAPABILITY_UPDATED; + HRilManager::manager_->OnDataReport( + slotId, &report, (const uint8_t *)&linkCapability, sizeof(HRilDataLinkCapability)); return; } } // namespace OHOS diff --git a/test/fuzztest/residentnetworkupdated_fuzzer/residentnetworkupdated_fuzzer.cpp b/test/fuzztest/residentnetworkupdated_fuzzer/residentnetworkupdated_fuzzer.cpp index cb6e2ed8..a5c1ce11 100644 --- a/test/fuzztest/residentnetworkupdated_fuzzer/residentnetworkupdated_fuzzer.cpp +++ b/test/fuzztest/residentnetworkupdated_fuzzer/residentnetworkupdated_fuzzer.cpp @@ -33,12 +33,13 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) return; } int32_t slotId = static_cast(size % SLOT_NUM); - HRilErrNumber error = static_cast(size); const char *plmn = reinterpret_cast(data); - HRilManager hrilManger; - std::shared_ptr hrilNetwork = std::make_shared(slotId, hrilManger); - hrilNetwork->ResidentNetworkUpdated(HRIL_RESPONSE_NOTICE, error, plmn, size); + struct ReportInfo report; + report.error = static_cast(size); + report.notifyId = HNOTI_NETWORK_RESIDENT_NETWORK_UPDATED; + report.type = HRIL_NOTIFICATION; + HRilManager::manager_->OnNetworkReport(slotId, &report, (const uint8_t *)plmn, size); return; } } // namespace OHOS diff --git a/test/fuzztest/simstkproactivenotify_fuzzer/simstkproactivenotify_fuzzer.cpp b/test/fuzztest/simstkproactivenotify_fuzzer/simstkproactivenotify_fuzzer.cpp index c29d8c00..7cbb9f63 100644 --- a/test/fuzztest/simstkproactivenotify_fuzzer/simstkproactivenotify_fuzzer.cpp +++ b/test/fuzztest/simstkproactivenotify_fuzzer/simstkproactivenotify_fuzzer.cpp @@ -35,14 +35,13 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) } int32_t slotId = static_cast(size) % SLOT_NUM; - struct ReportInfo reportInfo; - reportInfo.error = static_cast(size); - reportInfo.notifyId = HNOTI_SIM_STK_PROACTIVE_NOTIFY; - char *response = const_cast(NUMBER); + const uint8_t *response = reinterpret_cast(NUMBER); - HRilManager hrilManager; - std::shared_ptr hrilSim = std::make_shared(slotId, hrilManager); - hrilSim->ProcessNotify(HRIL_RESPONSE_NOTICE, &reportInfo, &response, sizeof(char)); + struct ReportInfo report; + report.error = static_cast(size); + report.notifyId = HNOTI_SIM_STK_PROACTIVE_NOTIFY; + report.type = HRIL_NOTIFICATION; + HRilManager::manager_->OnSimReport(slotId, &report, response, sizeof(char)); return; } } // namespace OHOS