From e51c678d01a8a1d1653c040988610de40454996a Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Wed, 22 Mar 2023 12:05:19 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!412=20:?= =?UTF-8?q?=20feat:add=20CloseUnFinishedUssd=20interfaces'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/supplement_request_cs.h | 8 ------ .../connection/src/supplement_request_cs.cpp | 7 ------ .../include/cellular_call_supplement.h | 17 ------------- .../control/src/cellular_call_supplement.cpp | 25 ------------------- .../manager/include/cellular_call_handler.h | 1 - .../manager/include/cellular_call_register.h | 2 -- .../manager/include/cellular_call_service.h | 8 ------ services/manager/include/cellular_call_stub.h | 14 ++--------- .../manager/src/cellular_call_handler.cpp | 12 --------- .../manager/src/cellular_call_register.cpp | 9 ------- .../manager/src/cellular_call_service.cpp | 10 -------- services/manager/src/cellular_call_stub.cpp | 16 ------------ 12 files changed, 2 insertions(+), 127 deletions(-) diff --git a/services/connection/include/supplement_request_cs.h b/services/connection/include/supplement_request_cs.h index 12c29574..d75ea2e7 100644 --- a/services/connection/include/supplement_request_cs.h +++ b/services/connection/include/supplement_request_cs.h @@ -174,14 +174,6 @@ public: */ int32_t UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2); - /** - * Close Unfinished ussd - * - * @param slotId The ID of SIM slot - * @return Error Code: Returns TELEPHONY_SUCCESS on success, others on failure. - */ - int32_t CloseUnFinishedUssdRequest(int32_t slotId); - private: /** * GetMMIHandler diff --git a/services/connection/src/supplement_request_cs.cpp b/services/connection/src/supplement_request_cs.cpp index 84e02463..42645554 100644 --- a/services/connection/src/supplement_request_cs.cpp +++ b/services/connection/src/supplement_request_cs.cpp @@ -250,12 +250,5 @@ int32_t SupplementRequestCs::UnlockPuk2(int32_t slotId, std::string newPin2, std } return TELEPHONY_ERROR; } - -int32_t SupplementRequestCs::CloseUnFinishedUssdRequest(int32_t slotId) -{ - TELEPHONY_LOGI("[slot%{public}d] entry", slotId); - return CoreManagerInner::GetInstance().CloseUnFinishedUssd( - slotId, RadioEvent::RADIO_CLOSE_UNFINISHED_USSD, GetMMIHandler(slotId)); -} } // namespace Telephony } // namespace OHOS diff --git a/services/control/include/cellular_call_supplement.h b/services/control/include/cellular_call_supplement.h index 7d88f5e9..01495dd0 100755 --- a/services/control/include/cellular_call_supplement.h +++ b/services/control/include/cellular_call_supplement.h @@ -258,16 +258,6 @@ public: */ void UnlockPuk2(int32_t slotId, const MMIData &mmiData); - /** - * Close Unfinished ussd - * - * Control of close Ussd supplementary service - * - * @param slotId - * @return Returns TELEPHONY_SUCCESS on success, others on failure. - */ - int32_t CloseUnFinishedUssd(int32_t slotId); - /** * Get clip result * @@ -461,13 +451,6 @@ public: */ void EventUssdNotify(UssdNoticeInfo &ussdNoticeInfo); - /** - * Close Unfinished ussd result - * - * @param HRilRadioResponseInfo - */ - void EventCloseUnFinishedUssd(const HRilRadioResponseInfo &responseInfo); - private: /** * Obtain ServiceCode diff --git a/services/control/src/cellular_call_supplement.cpp b/services/control/src/cellular_call_supplement.cpp index 162d382e..f41fe31f 100755 --- a/services/control/src/cellular_call_supplement.cpp +++ b/services/control/src/cellular_call_supplement.cpp @@ -1530,30 +1530,5 @@ void CellularCallSupplement::ReportMmiCodeMessage( } callRegister->ReportMmiCodeResult(mmiCodeInfo); } - -int32_t CellularCallSupplement::CloseUnFinishedUssd(int32_t slotId) -{ - if (!PhoneTypeGsmOrNot(slotId)) { - TELEPHONY_LOGE("[slot%{public}d] network type is not supported!", slotId); - return CALL_ERR_UNSUPPORTED_NETWORK_TYPE; - } - return supplementRequestCs_.CloseUnFinishedUssdRequest(slotId); -} - -void CellularCallSupplement::EventCloseUnFinishedUssd(const HRilRadioResponseInfo &responseInfo) -{ - auto callRegister = DelayedSingleton::GetInstance(); - if (callRegister == nullptr) { - TELEPHONY_LOGE("callRegister is null."); - return; - } - int32_t result = TELEPHONY_ERROR; - if (responseInfo.error == HRilErrType::NONE) { - result = TELEPHONY_SUCCESS; - } else { - result = TELEPHONY_ERR_RIL_CMD_FAIL; - } - callRegister->ReportCloseUnFinishedUssdResult(result); -} } // namespace Telephony } // namespace OHOS diff --git a/services/manager/include/cellular_call_handler.h b/services/manager/include/cellular_call_handler.h index 9e440a21..9e28c4aa 100755 --- a/services/manager/include/cellular_call_handler.h +++ b/services/manager/include/cellular_call_handler.h @@ -176,7 +176,6 @@ private: int32_t ConfirmAndRemoveSsRequestCommand(int32_t index, int32_t &flag); void SendUssdResponse(const AppExecFwk::InnerEvent::Pointer &event); void SendUnlockPinPukResponse(const AppExecFwk::InnerEvent::Pointer &event); - void CloseUnFinishedUssdResponse(const AppExecFwk::InnerEvent::Pointer &event); void InitBasicFuncMap(); void InitConfigFuncMap(); diff --git a/services/manager/include/cellular_call_register.h b/services/manager/include/cellular_call_register.h index f8a377ee..7ec4f444 100755 --- a/services/manager/include/cellular_call_register.h +++ b/services/manager/include/cellular_call_register.h @@ -85,8 +85,6 @@ public: void ReportSendUssdResult(int32_t result); - void ReportCloseUnFinishedUssdResult(int32_t result); - int32_t RegisterCallManagerCallBack(const sptr &callback); int32_t UnRegisterCallManagerCallBack(); diff --git a/services/manager/include/cellular_call_service.h b/services/manager/include/cellular_call_service.h index 7ef5031d..a14dc5e9 100755 --- a/services/manager/include/cellular_call_service.h +++ b/services/manager/include/cellular_call_service.h @@ -501,14 +501,6 @@ public: */ int32_t GetMute(int32_t slotId) override; - /** - * Close Unfinished ussd - * - * @param slotId - * @return Returns TELEPHONY_SUCCESS on success, others on failure. - */ - int32_t CloseUnFinishedUssd(int32_t slotId) override; - /** * Is need choose IMS for execute * diff --git a/services/manager/include/cellular_call_stub.h b/services/manager/include/cellular_call_stub.h index d5d670fb..8e5932a3 100755 --- a/services/manager/include/cellular_call_stub.h +++ b/services/manager/include/cellular_call_stub.h @@ -17,11 +17,10 @@ #define CELLULAR_CALL_STUB_H #include - #include "cellular_call_data_struct.h" #include "cellular_call_interface.h" -#include "iremote_stub.h" #include "telephony_log_wrapper.h" +#include "iremote_stub.h" namespace OHOS { namespace Telephony { @@ -454,16 +453,7 @@ private: * @return Returns TELEPHONY_SUCCESS on success, others on failure. */ int32_t OnGetMuteInner(MessageParcel &data, MessageParcel &reply); - - /** - * Close Unfinished ussd - * - * @brief Close Unfinished ussd function for the current account - * @param slotId[in], The slot id - * @return Returns 0 on success, others on failure. - */ - int32_t OnCloseUnFinishedUssdInner(MessageParcel &data, MessageParcel &reply); - + int32_t OnSetEmergencyCallList(MessageParcel &data, MessageParcel &reply); private: diff --git a/services/manager/src/cellular_call_handler.cpp b/services/manager/src/cellular_call_handler.cpp index b5e01c09..60affc81 100755 --- a/services/manager/src/cellular_call_handler.cpp +++ b/services/manager/src/cellular_call_handler.cpp @@ -104,7 +104,6 @@ void CellularCallHandler::InitSupplementFuncMap() requestFuncMap_[RadioEvent::RADIO_SET_CALL_RESTRICTION] = &CellularCallHandler::SetCallRestrictionResponse; requestFuncMap_[RadioEvent::RADIO_SET_USSD] = &CellularCallHandler::SendUssdResponse; requestFuncMap_[MMIHandlerId::EVENT_SET_UNLOCK_PIN_PUK_ID] = &CellularCallHandler::SendUnlockPinPukResponse; - requestFuncMap_[RadioEvent::RADIO_CLOSE_UNFINISHED_USSD] = &CellularCallHandler::CloseUnFinishedUssdResponse; } void CellularCallHandler::InitActiveReportFuncMap() @@ -1178,17 +1177,6 @@ int32_t CellularCallHandler::GetSsRequestCommand(int32_t index, SsRequestCommand return TELEPHONY_SUCCESS; } -void CellularCallHandler::CloseUnFinishedUssdResponse(const AppExecFwk::InnerEvent::Pointer &event) -{ - auto result = event->GetSharedObject(); - if (result == nullptr) { - TELEPHONY_LOGE("[slot%{public}d] result is null", slotId_); - return; - } - CellularCallSupplement supplement; - supplement.EventCloseUnFinishedUssd(*result); -} - #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE void CellularCallHandler::StartCallManagerService() { diff --git a/services/manager/src/cellular_call_register.cpp b/services/manager/src/cellular_call_register.cpp index ad751eb7..816995bf 100755 --- a/services/manager/src/cellular_call_register.cpp +++ b/services/manager/src/cellular_call_register.cpp @@ -353,14 +353,5 @@ bool CellularCallRegister::IsCallManagerCallBackRegistered() { return callManagerCallBack_ != nullptr; } - -void CellularCallRegister::ReportCloseUnFinishedUssdResult(int32_t result) -{ - if (callManagerCallBack_ == nullptr) { - TELEPHONY_LOGE("ReportCloseUnFinishedUssdResult return, callManagerCallBack_ is nullptr, report fail!"); - return; - } - callManagerCallBack_->CloseUnFinishedUssdResult(result); -} } // namespace Telephony } // namespace OHOS diff --git a/services/manager/src/cellular_call_service.cpp b/services/manager/src/cellular_call_service.cpp index 5edc7831..4ab808e6 100755 --- a/services/manager/src/cellular_call_service.cpp +++ b/services/manager/src/cellular_call_service.cpp @@ -1067,16 +1067,6 @@ int32_t CellularCallService::GetMute(int32_t slotId) return config.GetMute(slotId); } -int32_t CellularCallService::CloseUnFinishedUssd(int32_t slotId) -{ - if (!IsValidSlotId(slotId)) { - TELEPHONY_LOGE("CellularCallService::CloseUnFinishedUssd return, invalid slot id"); - return CALL_ERR_INVALID_SLOT_ID; - } - CellularCallSupplement cellularCallSupplement; - return cellularCallSupplement.CloseUnFinishedUssd(slotId); -} - void CellularCallService::SetSrvccState(int32_t srvccState) { srvccState_ = srvccState; diff --git a/services/manager/src/cellular_call_stub.cpp b/services/manager/src/cellular_call_stub.cpp index 02b6fa38..edf132ac 100755 --- a/services/manager/src/cellular_call_stub.cpp +++ b/services/manager/src/cellular_call_stub.cpp @@ -100,7 +100,6 @@ CellularCallStub::CellularCallStub() requestFuncMap_[OperationType::SET_DEVICE_DIRECTION] = &CellularCallStub::OnSetDeviceDirectionInner; requestFuncMap_[OperationType::SET_MUTE] = &CellularCallStub::OnSetMuteInner; requestFuncMap_[OperationType::GET_MUTE] = &CellularCallStub::OnGetMuteInner; - requestFuncMap_[OperationType::CLOSE_UNFINISHED_USSD] = &CellularCallStub::OnCloseUnFinishedUssdInner; } CellularCallStub::~CellularCallStub() @@ -946,20 +945,5 @@ int32_t CellularCallStub::OnGetMuteInner(MessageParcel &data, MessageParcel &rep reply.WriteInt32(GetMute(slotId)); return TELEPHONY_SUCCESS; } - -int32_t CellularCallStub::OnCloseUnFinishedUssdInner(MessageParcel &data, MessageParcel &reply) -{ - TELEPHONY_LOGI("CellularCallStub::OnCloseUnFinishedUssdInner entry"); - int32_t size = data.ReadInt32(); - size = ((size > MAX_SIZE) ? 0 : size); - if (size <= 0) { - TELEPHONY_LOGE("CellularCallStub::OnCloseUnFinishedUssdInner data size error"); - return TELEPHONY_ERR_FAIL; - } - int32_t slotId = data.ReadInt32(); - - reply.WriteInt32(CloseUnFinishedUssd(slotId)); - return TELEPHONY_SUCCESS; -} } // namespace Telephony } // namespace OHOS -- Gitee