diff --git a/services/control/include/satellite_control.h b/services/control/include/satellite_control.h index 28208c5a520bd1b75b71695b4c9c39fb922a8681..3fe363bb3e5e6d2a7b70a33f0eeb3b5f46ed38e4 100644 --- a/services/control/include/satellite_control.h +++ b/services/control/include/satellite_control.h @@ -153,14 +153,14 @@ public: int32_t ExecutePostDial(int32_t slotId, int64_t callId); int32_t PostDialProceed(const CellularCallInfo &callInfo, const bool proceed); -private: /** * Report being hung up data * * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. */ - int32_t ReportHungUpInfo(int32_t slotId); + int32_t ReportHangUpInfo(int32_t slotId); +private: /** * Report Incoming info * diff --git a/services/control/src/satellite_control.cpp b/services/control/src/satellite_control.cpp index ff604dfbb8ce739b7c24d821b56c31e0eaecf664..ec5c97a8b21e26080dab8a50a4ea4ba7580a472d 100644 --- a/services/control/src/satellite_control.cpp +++ b/services/control/src/satellite_control.cpp @@ -179,7 +179,7 @@ int32_t SatelliteControl::Reject(const CellularCallInfo &callInfo) int32_t SatelliteControl::ReportSatelliteCallsData(int32_t slotId, const SatelliteCurrentCallList &callInfoList) { if (callInfoList.callSize <= 0 && !connectionMap_.empty()) { - return ReportHungUpInfo(slotId); + return ReportHangUpInfo(slotId); } else if (callInfoList.callSize > 0 && connectionMap_.empty()) { return ReportIncomingInfo(slotId, callInfoList); } else if (callInfoList.callSize > 0 && !connectionMap_.empty()) { @@ -297,9 +297,9 @@ int32_t SatelliteControl::ReportIncomingInfo(int32_t slotId, const SatelliteCurr return TELEPHONY_SUCCESS; } -int32_t SatelliteControl::ReportHungUpInfo(int32_t slotId) +int32_t SatelliteControl::ReportHangUpInfo(int32_t slotId) { - TELEPHONY_LOGD("ReportHungUpInfo entry"); + TELEPHONY_LOGD("ReportHangUpInfo entry"); CallsReportInfo callsReportInfo; for (auto &it : connectionMap_) { CallReportInfo callReportInfo = it.second.GetCallReportInfo(); @@ -309,7 +309,7 @@ int32_t SatelliteControl::ReportHungUpInfo(int32_t slotId) GetCallFailReason(slotId, connectionMap_); } if (DelayedSingleton::GetInstance() == nullptr) { - TELEPHONY_LOGE("ReportHungUpInfo return, GetInstance() is nullptr."); + TELEPHONY_LOGE("ReportHangUpInfo return, GetInstance() is nullptr."); return TELEPHONY_ERR_LOCAL_PTR_NULL; } callsReportInfo.slotId = slotId; diff --git a/services/manager/src/cellular_call_handler.cpp b/services/manager/src/cellular_call_handler.cpp index 31df4e847496b65f9290fbf3eb1d550d9a0c0f0d..8fae6349989e9d34687a54db86a781b29d11f899 100755 --- a/services/manager/src/cellular_call_handler.cpp +++ b/services/manager/src/cellular_call_handler.cpp @@ -1730,6 +1730,14 @@ void CellularCallHandler::OnRilAdapterHostDied(const AppExecFwk::InnerEvent::Poi } else { serviceInstance->SetImsControl(slotId_, nullptr); } + auto satelliteControl = serviceInstance->GetSatelliteControl(slotId_); + if (satelliteControl == nullptr) { + TELEPHONY_LOGE("[slot%{public}d] satelliteControl is null", slotId_); + } else if (satelliteControl->ReportHangUpInfo(slotId_) != TELEPHONY_SUCCESS) { + TELEPHONY_LOGE("[slot%{public}d] fail to disconnect satellite calls", slotId_); + } else { + serviceInstance->SetSatelliteControl(slotId_, nullptr); + } } #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE diff --git a/services/manager/src/cellular_call_service.cpp b/services/manager/src/cellular_call_service.cpp index 269866df5f6cc222420d40d1792c67619dcd38ef..e4454d80aab5dc1f445290ce6676f609f85c2fe3 100755 --- a/services/manager/src/cellular_call_service.cpp +++ b/services/manager/src/cellular_call_service.cpp @@ -753,6 +753,9 @@ int32_t CellularCallService::SetReadyToCall(int32_t slotId, int32_t callType, bo if (GetImsControl(slotId) != nullptr) { GetImsControl(slotId)->SetReadyToCall(slotId, isReadyToCall); } + if (GetSatelliteControl(slotId) != nullptr) { + GetSatelliteControl(slotId)->SetReadyToCall(slotId, isReadyToCall); + } return TELEPHONY_SUCCESS; } @@ -764,6 +767,9 @@ int32_t CellularCallService::HangUpAllConnection(int32_t slotId) if (GetImsControl(slotId)) { GetImsControl(slotId)->HangUpAllConnection(slotId); } + if (GetSatelliteControl(slotId)) { + GetSatelliteControl(slotId)->HangUpAllConnection(slotId); + } return TELEPHONY_SUCCESS; } diff --git a/test/fuzztest/BUILD.gn b/test/fuzztest/BUILD.gn index 056fbae5f172279aeab96157c10be6fe2031908d..e7a2fb1152b28b7ea4bc7d216a84fa0f8dfe9728 100644 --- a/test/fuzztest/BUILD.gn +++ b/test/fuzztest/BUILD.gn @@ -27,7 +27,7 @@ group("fuzztest") { deps += [ "registercallmanagercallback_fuzzer:fuzztest" ] deps += [ "imscallback_fuzzer:fuzztest" ] deps += [ "imsclient_fuzzer:fuzztest" ] - deps += [ "reporthungupinfo_fuzzer:fuzztest" ] + deps += [ "reporthangupinfo_fuzzer:fuzztest" ] deps += [ "separateconference_fuzzer:fuzztest" ] deps += [ "setorupdatecallreportinfo_fuzzer:fuzztest" ] deps += [ "satellitecallrequest_fuzzer:fuzztest" ] diff --git a/test/fuzztest/reporthungupinfo_fuzzer/BUILD.gn b/test/fuzztest/reporthangupinfo_fuzzer/BUILD.gn similarity index 94% rename from test/fuzztest/reporthungupinfo_fuzzer/BUILD.gn rename to test/fuzztest/reporthangupinfo_fuzzer/BUILD.gn index 90fa85e079b02a53379c33ec9300100caa878d15..56e63354e6ab56023f3fd5e71bcbfac66af1281e 100644 --- a/test/fuzztest/reporthungupinfo_fuzzer/BUILD.gn +++ b/test/fuzztest/reporthangupinfo_fuzzer/BUILD.gn @@ -18,11 +18,11 @@ import("//build/test.gni") CELLULAR_CALL_PATH = "../../.." ##############################fuzztest########################################## -ohos_fuzztest("ReportHungUpInfoFuzzTest") { +ohos_fuzztest("ReportHangUpInfoFuzzTest") { module_output_path = "cellular_call/cellular_call" module_out_path = module_output_path fuzz_config_file = - "${CELLULAR_CALL_PATH}/test/fuzztest/reporthungupinfo_fuzzer" + "${CELLULAR_CALL_PATH}/test/fuzztest/reporthangupinfo_fuzzer" include_dirs = [ "${CELLULAR_CALL_PATH}/test/fuzztest/common_fuzzer", @@ -76,7 +76,7 @@ ohos_fuzztest("ReportHungUpInfoFuzzTest") { ] sources = [ "${CELLULAR_CALL_PATH}/test/fuzztest/common_fuzzer/addcellularcalltoken_fuzzer.cpp", - "reporthungupinfo_fuzzer.cpp", + "reporthangupinfo_fuzzer.cpp", ] } @@ -86,7 +86,7 @@ group("fuzztest") { deps = [] deps += [ # deps file - ":ReportHungUpInfoFuzzTest", + ":ReportHangUpInfoFuzzTest", ] } ############################################################################### diff --git a/test/fuzztest/reporthungupinfo_fuzzer/corpus/init b/test/fuzztest/reporthangupinfo_fuzzer/corpus/init similarity index 97% rename from test/fuzztest/reporthungupinfo_fuzzer/corpus/init rename to test/fuzztest/reporthangupinfo_fuzzer/corpus/init index bcc283a9560c670ca25baf12fabbcfd6112947ff..07b0a5e33fed3be58306340f5c0778542acdcb83 100644 --- a/test/fuzztest/reporthungupinfo_fuzzer/corpus/init +++ b/test/fuzztest/reporthangupinfo_fuzzer/corpus/init @@ -1,19 +1,19 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * corpus is necessary - */ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * corpus is necessary + */ FUZZ \ No newline at end of file diff --git a/test/fuzztest/reporthungupinfo_fuzzer/project.xml b/test/fuzztest/reporthangupinfo_fuzzer/project.xml similarity index 100% rename from test/fuzztest/reporthungupinfo_fuzzer/project.xml rename to test/fuzztest/reporthangupinfo_fuzzer/project.xml diff --git a/test/fuzztest/reporthungupinfo_fuzzer/reporthungupinfo_fuzzer.cpp b/test/fuzztest/reporthangupinfo_fuzzer/reporthangupinfo_fuzzer.cpp similarity index 97% rename from test/fuzztest/reporthungupinfo_fuzzer/reporthungupinfo_fuzzer.cpp rename to test/fuzztest/reporthangupinfo_fuzzer/reporthangupinfo_fuzzer.cpp index d56a80bc9980629d70b028ecefef886499414601..7f81bfad57a595c02b3543a72ad473a52cb3a6da 100644 --- a/test/fuzztest/reporthungupinfo_fuzzer/reporthungupinfo_fuzzer.cpp +++ b/test/fuzztest/reporthangupinfo_fuzzer/reporthangupinfo_fuzzer.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "reporthungupinfo_fuzzer.h" +#include "reporthangupinfo_fuzzer.h" #include #include @@ -80,7 +80,7 @@ void DoSomethingInterestingWithMyAPI(const uint8_t *data, size_t size) satelliteControl->HoldCall(slotId); satelliteControl->UnHoldCall(slotId); satelliteControl->SwitchCall(slotId); - satelliteControl->ReportHungUpInfo(slotId); + satelliteControl->ReportHangUpInfo(slotId); return; } } // namespace OHOS diff --git a/test/fuzztest/reporthungupinfo_fuzzer/reporthungupinfo_fuzzer.h b/test/fuzztest/reporthangupinfo_fuzzer/reporthangupinfo_fuzzer.h similarity index 79% rename from test/fuzztest/reporthungupinfo_fuzzer/reporthungupinfo_fuzzer.h rename to test/fuzztest/reporthangupinfo_fuzzer/reporthangupinfo_fuzzer.h index aa2051d6cc03309b9d3525413d98a85272a09b5e..bef4d2e751057294bb3b601cbad6cc2581c43ebf 100644 --- a/test/fuzztest/reporthungupinfo_fuzzer/reporthungupinfo_fuzzer.h +++ b/test/fuzztest/reporthangupinfo_fuzzer/reporthangupinfo_fuzzer.h @@ -13,9 +13,9 @@ * limitations under the License. */ -#ifndef REPORTHUNGUPINFO_FUZZER_H -#define REPORTHUNGUPINFO_FUZZER_H +#ifndef REPORTHANGUPINFO_FUZZER_H +#define REPORTHANGUPINFO_FUZZER_H -#define FUZZ_PROJECT_NAME "reporthungupinfo_fuzzer" +#define FUZZ_PROJECT_NAME "reporthangupinfo_fuzzer" -#endif // REPORTHUNGUPINFO_FUZZER_H +#endif // REPORTHANGUPINFO_FUZZER_H diff --git a/test/unittest/satellitetest/zero_branch_test.cpp b/test/unittest/satellitetest/zero_branch_test.cpp index 5d6b161608b8c39fe3c80de473d878ee3a1f086b..01a474386ed1d1686d76d60b3473fcc05860e329 100644 --- a/test/unittest/satellitetest/zero_branch_test.cpp +++ b/test/unittest/satellitetest/zero_branch_test.cpp @@ -114,7 +114,7 @@ HWTEST_F(BranchTest, Telephony_CellularCallSatelliteControl_001, Function | Medi CallInfoList callInfoList; satelliteControl.ReportCallsData(SIM1_SLOTID, callInfoList); SatelliteCurrentCallList satellitecallInfoList; - satelliteControl.ReportHungUpInfo(SIM1_SLOTID); + satelliteControl.ReportHangUpInfo(SIM1_SLOTID); satelliteControl.ReportIncomingInfo(SIM1_SLOTID, satellitecallInfoList); satelliteControl.ReportUpdateInfo(SIM1_SLOTID, satellitecallInfoList); SatelliteCurrentCall CallInfo; @@ -144,7 +144,7 @@ HWTEST_F(BranchTest, Telephony_CellularCallSatelliteControl_002, Function | Medi CallsReportInfo callsReportInfo; auto connectionMap = satelliteControl.GetConnectionMap(); satelliteControl.connectionMap_.insert(std::make_pair(1, CellularCallConnectionSatellite())); - satelliteControl.ReportHungUpInfo(SIM1_SLOTID); + satelliteControl.ReportHangUpInfo(SIM1_SLOTID); satelliteControl.DeleteConnection(callsReportInfo, satellitecallInfoList); satelliteControl.ExecutePostDial(SIM1_SLOTID, 0); ASSERT_NE(satelliteControl.PostDialProceed(cellularCallInfo, true), TELEPHONY_SUCCESS);