From 4d7cfe1aea5fc579ffcfdc0ece734848b3ff029f Mon Sep 17 00:00:00 2001 From: jiangbinghan Date: Thu, 8 Dec 2022 11:01:02 +0800 Subject: [PATCH] error code Signed-off-by: jiangbinghan --- .../native/src/call_manager_service_proxy.cpp | 14 +++++++------- .../src/cellular_call_proxy.cpp | 13 +++++++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/frameworks/native/src/call_manager_service_proxy.cpp b/frameworks/native/src/call_manager_service_proxy.cpp index 582299fe..f1ab58ed 100644 --- a/frameworks/native/src/call_manager_service_proxy.cpp +++ b/frameworks/native/src/call_manager_service_proxy.cpp @@ -1184,9 +1184,9 @@ int32_t CallManagerServiceProxy::EnableImsSwitch(int32_t slotId) return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } int32_t error = remote->SendRequest(INTERFACE_ENABLE_VOLTE, dataParcel, replyParcel, option); - if (error != TELEPHONY_SUCCESS) { + if (error != ERR_NONE) { TELEPHONY_LOGE("function EnableImsSwitch failed! errCode:%{public}d", error); - return error; + return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } return replyParcel.ReadInt32(); } @@ -1207,9 +1207,9 @@ int32_t CallManagerServiceProxy::DisableImsSwitch(int32_t slotId) return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } int32_t error = remote->SendRequest(INTERFACE_DISABLE_VOLTE, dataParcel, replyParcel, option); - if (error != TELEPHONY_SUCCESS) { + if (error != ERR_NONE) { TELEPHONY_LOGE("function DisableImsSwitch failed! errCode:%{public}d", error); - return error; + return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } return replyParcel.ReadInt32(); } @@ -1230,12 +1230,12 @@ int32_t CallManagerServiceProxy::IsImsSwitchEnabled(int32_t slotId, bool &enable return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } int32_t error = remote->SendRequest(INTERFACE_IS_VOLTE_ENABLED, dataParcel, replyParcel, option); - if (error != TELEPHONY_SUCCESS) { + if (error != ERR_NONE) { TELEPHONY_LOGE("function IsImsSwitchEnabled failed! errCode:%{public}d", error); - return error; + return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } enabled = replyParcel.ReadBool(); - return TELEPHONY_SUCCESS; + return replyParcel.ReadInt32(); } int32_t CallManagerServiceProxy::JoinConference(int32_t callId, std::vector &numberList) diff --git a/services/telephony_interaction/src/cellular_call_proxy.cpp b/services/telephony_interaction/src/cellular_call_proxy.cpp index 107c521f..83e522d0 100644 --- a/services/telephony_interaction/src/cellular_call_proxy.cpp +++ b/services/telephony_interaction/src/cellular_call_proxy.cpp @@ -788,10 +788,11 @@ int32_t CellularCallProxy::SetImsSwitchStatus(int32_t slotId, bool active) return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } int32_t error = remote->SendRequest(static_cast(OperationType::SET_IMS_SWITCH_STATUS), in, out, option); - if (error == ERR_NONE) { - return out.ReadInt32(); + if (error != ERR_NONE) { + TELEPHONY_LOGE("function SetImsSwitchStatus failed! errCode:%{public}d", error); + return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } - return error; + return out.ReadInt32(); } int32_t CellularCallProxy::GetImsSwitchStatus(int32_t slotId, bool &enabled) @@ -810,8 +811,12 @@ int32_t CellularCallProxy::GetImsSwitchStatus(int32_t slotId, bool &enabled) return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; } int32_t error = remote->SendRequest(static_cast(OperationType::GET_IMS_SWITCH_STATUS), in, out, option); + if (error != ERR_NONE) { + TELEPHONY_LOGE("function GetImsSwitchStatus failed! errCode:%{public}d", error); + return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL; + } enabled = out.ReadBool(); - return error; + return out.ReadInt32(); } int32_t CellularCallProxy::SetImsConfig(int32_t slotId, ImsConfigItem item, const std::string &value) -- Gitee