Signed-off-by: wangziming <wangziming14@huawei.com>
This commit is contained in:
wangziming 2022-12-08 21:38:19 +08:00
parent 6c3c11e775
commit 3c6782e233
13 changed files with 219 additions and 127 deletions

View File

@ -917,163 +917,98 @@ int32_t CoreManagerInner::CallSupplement(
return telRilManager_->CallSupplement(slotId, type, response);
}
int32_t CoreManagerInner::GetClip(
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
int32_t CoreManagerInner::GetClip(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->GetClip(slotId, response);
}
int32_t CoreManagerInner::SetClip(
int32_t slotId, int32_t eventId, int32_t action, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
int32_t CoreManagerInner::SetClip(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response)
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->SetClip(slotId, action, response);
}
int32_t CoreManagerInner::GetClir(
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
int32_t CoreManagerInner::GetClir(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->GetClir(slotId, response);
}
int32_t CoreManagerInner::SetClir(
int32_t slotId, int32_t eventId, int32_t action, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
int32_t CoreManagerInner::SetClir(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response)
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->SetClir(slotId, action, response);
}
int32_t CoreManagerInner::SetCallWaiting(
int32_t slotId, int32_t eventId, int32_t activate, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
int32_t slotId, int32_t activate, const AppExecFwk::InnerEvent::Pointer &response)
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->SetCallWaiting(slotId, activate, response);
}
int32_t CoreManagerInner::SetCallTransferInfo(int32_t slotId, int32_t eventId, const CallTransferParam &callTransfer,
const std::shared_ptr<AppExecFwk::EventHandler> &handler)
int32_t CoreManagerInner::SetCallTransferInfo(
int32_t slotId, const CallTransferParam &callTransfer, const AppExecFwk::InnerEvent::Pointer &response)
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->SetCallTransferInfo(slotId, callTransfer, response);
}
int32_t CoreManagerInner::GetCallTransferInfo(int32_t slotId, int32_t eventId, const int32_t reason,
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
int32_t CoreManagerInner::GetCallTransferInfo(
int32_t slotId, const int32_t reason, const AppExecFwk::InnerEvent::Pointer &response) const
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->GetCallTransferInfo(slotId, reason, response);
}
int32_t CoreManagerInner::GetCallWaiting(
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
int32_t CoreManagerInner::GetCallWaiting(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->GetCallWaiting(slotId, response);
}
int32_t CoreManagerInner::GetCallRestriction(
int32_t slotId, int32_t eventId, std::string fac, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &response) const
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->GetCallRestriction(slotId, fac, response);
}
int32_t CoreManagerInner::SetCallRestriction(int32_t slotId, int32_t eventId,
const CallRestrictionParam &callRestriction, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
int32_t CoreManagerInner::SetCallRestriction(
int32_t slotId, const CallRestrictionParam &callRestriction, const AppExecFwk::InnerEvent::Pointer &response)
{
if (telRilManager_ == nullptr) {
TELEPHONY_LOGE("telRilManager is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
if (response == nullptr) {
TELEPHONY_LOGE("response is null!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
response->SetOwner(handler);
return telRilManager_->SetCallRestriction(slotId, callRestriction, response);
}

View File

@ -74,24 +74,19 @@ public:
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t CallSupplement(
int32_t slotId, int32_t eventId, int32_t type, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t GetClip(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
int32_t SetClip(
int32_t slotId, int32_t eventId, int32_t action, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t GetClir(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
int32_t SetClir(
int32_t slotId, int32_t eventId, int32_t action, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t SetCallWaiting(
int32_t slotId, int32_t eventId, int32_t activate, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t SetCallTransferInfo(int32_t slotId, int32_t eventId, const CallTransferParam &callTransfer,
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t GetCallTransferInfo(int32_t slotId, int32_t eventId, const int32_t reason,
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
int32_t GetCallWaiting(
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
int32_t GetCallRestriction(int32_t slotId, int32_t eventId, std::string fac,
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
int32_t SetCallRestriction(int32_t slotId, int32_t eventId, const CallRestrictionParam &callRestriction,
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
int32_t GetClip(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const;
int32_t SetClip(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response);
int32_t GetClir(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const;
int32_t SetClir(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response);
int32_t SetCallWaiting(int32_t slotId, int32_t activate, const AppExecFwk::InnerEvent::Pointer &response);
int32_t SetCallTransferInfo(
int32_t slotId, const CallTransferParam &callTransfer, const AppExecFwk::InnerEvent::Pointer &response);
int32_t GetCallTransferInfo(
int32_t slotId, const int32_t reason, const AppExecFwk::InnerEvent::Pointer &response) const;
int32_t GetCallWaiting(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const;
int32_t GetCallRestriction(int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &response) const;
int32_t SetCallRestriction(
int32_t slotId, const CallRestrictionParam &callRestriction, const AppExecFwk::InnerEvent::Pointer &response);
/* PDP start */
int32_t SetDataPermitted(int32_t slotId, int32_t eventId, int32_t dataPermitted,
const std::shared_ptr<AppExecFwk::EventHandler> &handler);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
@ -36,6 +36,7 @@ enum {
TELEPHONY_CORE_SERVICE_NETWORK_SEARCH = 0x08,
TELEPHONY_CORE_SERVICE_CORE = 0x09,
TELEPHONY_DATA_STORAGE = 0x10,
TELEPHONY_IMS = 0x11,
};
// Error code for common
@ -97,6 +98,9 @@ constexpr ErrCode CORE_SERVICE_CORE_ERR_OFFSET = ErrCodeOffset(SUBSYS_TELEPONY,
// Error code for telephony data storage
constexpr ErrCode CORE_DATA_STORAGE_ERR_OFFSET = ErrCodeOffset(SUBSYS_TELEPONY, TELEPHONY_DATA_STORAGE);
// Error code for telephony ims
constexpr ErrCode IMS_ERR_OFFSET = ErrCodeOffset(SUBSYS_TELEPONY, TELEPHONY_IMS);
} // namespace Telephony
} // namespace OHOS
#endif // TELEPHONY_ERRORS_H

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
@ -125,7 +125,7 @@ struct CallTransferParam {
struct CallRestrictionParam {
int32_t mode;
std::string password;
std::string pw;
std::string fac;
};
@ -244,6 +244,71 @@ struct RadioProtocol {
int32_t modemId;
RadioProtocolStatus status;
};
struct SsBaseResult {
int32_t index; /* command index, use for find the ss command to retry */
int32_t result; /* the result of execute command */
int32_t reason; /* This use for remaind message code */
std::string message = ""; /* This use for remaind message */
};
struct GetClipResult {
SsBaseResult result; /* query results */
int32_t action; /* parameter sets/shows the result code presentation status in the TA */
int32_t clipStat; /* parameter shows the subscriber CLIP service status in the network, <0-4> */
};
struct GetClirResult {
SsBaseResult result; /* query results */
int32_t action; /* parameter sets/shows the result code presentation status in the TA */
int32_t clirStat; /* parameter shows the subscriber CLIP service status in the network, <0-4> */
};
struct GetColrResult {
SsBaseResult result; /* query results */
int32_t action; /* parameter sets/shows the result code presentation status in the TA */
int32_t colrStat; /* parameter shows the subscriber COLR service status in the network, <0-4> */
};
struct GetColpResult {
SsBaseResult result; /* query results */
int32_t action; /* parameter sets/shows the result code presentation status in the TA */
int32_t colpStat; /* parameter shows the subscriber COLP service status in the network, <0-4> */
};
struct CallWaitResult {
SsBaseResult result; /* query results */
int32_t status; /* parameter sets/shows the result code presentation status in the TA */
int32_t classCw; /* parameter shows the subscriber CLIP service status in the network, <0-4> */
};
struct CallRestrictionResult {
SsBaseResult result; /* query results */
int32_t status; /* parameter sets/shows the result code presentation status in the TA */
int32_t classCw; /* parameter shows the subscriber CLIP service status in the network, <0-4> */
};
struct CallForwardQueryResult {
int32_t serial;
int32_t result; /* query results */
int32_t status;
int32_t classx;
std::string number;
int32_t type;
int32_t reason;
int32_t time;
int32_t startHour;
int32_t startMinute;
int32_t endHour;
int32_t endMinute;
};
struct CallForwardQueryInfoList {
SsBaseResult result;
int32_t callSize;
int32_t flag;
std::vector<CallForwardQueryResult> calls;
};
} // namespace Telephony
} // namespace OHOS
#endif // TELEPHONY_TELEPHONY_TYPES_H

View File

@ -470,7 +470,7 @@ void TestInitTimeAndTimeZone()
std::string timeZoneSet("America/Santiago");
result = OHOS::MiscServices::TimeServiceClient::GetInstance()->SetTimeZone(timeZoneSet);
ret = result ? "ture" : "false";
TELEPHONY_LOGI("TelephonyTestService::TestInitTimeAndTimeZone SetTimeZone result : %{public}d", ret.c_str());
TELEPHONY_LOGI("TelephonyTestService::TestInitTimeAndTimeZone SetTimeZone result : %{public}s", ret.c_str());
std::string timeZoneRes = OHOS::MiscServices::TimeServiceClient::GetInstance()->GetTimeZone();
std::cout << " timezone:" << timeZoneRes << std::endl;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
@ -31,6 +31,7 @@
#include "tel_ril_handler.h"
#include "telephony_errors.h"
#include "telephony_log_wrapper.h"
#include "telephony_types.h"
#include "v1_0/iril.h"
namespace OHOS {
@ -82,6 +83,8 @@ protected:
inline int32_t Notify(const char *funcName, RadioEvent notifyId);
template<typename T>
inline int32_t Notify(const char *funcName, std::shared_ptr<T> data, RadioEvent notifyId);
inline int32_t ConfirmSupplementOfTelRilRequestInfo(
const char *funcName, std::shared_ptr<TelRilRequest> telRilRequest);
protected:
std::shared_ptr<ObserverHandler> observerHandler_;
@ -234,6 +237,21 @@ inline HRilRadioResponseInfo TelRilBase::BuildHRilRadioResponseInfo(
responseInfo.type = (HRilResponseTypes)iResponseInfo.type;
return responseInfo;
}
inline int32_t TelRilBase::ConfirmSupplementOfTelRilRequestInfo(
const char *funcName, std::shared_ptr<TelRilRequest> telRilRequest)
{
if (telRilRequest == nullptr || telRilRequest->pointer_ == nullptr) {
TELEPHONY_LOGE("func %{public}s telRilReques or telRilRequest->pointer or data is null", funcName);
return TELEPHONY_ERR_ARGUMENT_INVALID;
}
auto handler = telRilRequest->pointer_->GetOwner();
if (handler == nullptr) {
TELEPHONY_LOGE("func %{public}s handler is nullptr !!!", funcName);
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
return TELEPHONY_SUCCESS;
}
} // namespace Telephony
} // namespace OHOS
#endif // TEL_RIL_BASE_H

View File

@ -18,7 +18,6 @@
#include "hril_call_parcel.h"
#include "tel_ril_base.h"
#include "telephony_types.h"
namespace OHOS {
namespace Telephony {
@ -124,6 +123,7 @@ private:
const HDI::Ril::V1_0::CallInfoList &iCallInfoList);
void BuildCFQueryInfoList(std::shared_ptr<CallForwardQueryInfoList> cFQueryInfoList,
const HDI::Ril::V1_0::CallForwardQueryInfoList &cFQueryList);
int32_t ResponseSupplement(const char *funcName, const HDI::Ril::V1_0::RilRadioResponseInfo &iResponseInfo);
};
} // namespace Telephony
} // namespace OHOS

View File

@ -98,20 +98,30 @@ int32_t TelRilCall::GetCallWaitingResponse(
TELEPHONY_LOGE("ERROR : callWaitInfoResult == nullptr !!!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
callWaitInfoResult->result = callWaitResult.result;
callWaitInfoResult->result.result = callWaitResult.result;
callWaitInfoResult->status = callWaitResult.status;
callWaitInfoResult->classCw = callWaitResult.classCw;
return Response<CallWaitResult>(TELEPHONY_LOG_FUNC_NAME, responseInfo, callWaitInfoResult);
const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
if (ret != TELEPHONY_SUCCESS) {
return ret;
} else if (radioResponseInfo.error != HRilErrType::NONE) {
callWaitInfoResult->result.result = TELEPHONY_ERR_FAIL;
}
callWaitInfoResult->result.index = telRilRequest->pointer_->GetParam();
return telRilRequest->pointer_->GetOwner()->SendEvent(
telRilRequest->pointer_->GetInnerEventId(), callWaitInfoResult);
}
int32_t TelRilCall::SetCallWaitingResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo)
{
return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
}
int32_t TelRilCall::SetCallTransferInfoResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo)
{
return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
}
int32_t TelRilCall::GetCallTransferInfoResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo,
@ -122,8 +132,18 @@ int32_t TelRilCall::GetCallTransferInfoResponse(const HDI::Ril::V1_0::RilRadioRe
TELEPHONY_LOGE("ERROR : cFQueryInfoList == nullptr !!!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
BuildCFQueryInfoList(cFQueryInfoList, cFQueryList);
return Response<CallForwardQueryInfoList>(TELEPHONY_LOG_FUNC_NAME, responseInfo, cFQueryInfoList);
cFQueryInfoList->result.result = TELEPHONY_SUCCESS;
std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
if (ret != TELEPHONY_SUCCESS) {
return ret;
} else if (radioResponseInfo.error != HRilErrType::NONE) {
cFQueryInfoList->result.result = TELEPHONY_ERR_FAIL;
}
cFQueryInfoList->result.index = telRilRequest->pointer_->GetParam();
return telRilRequest->pointer_->GetOwner()->SendEvent(telRilRequest->pointer_->GetInnerEventId(), cFQueryInfoList);
}
int32_t TelRilCall::GetClipResponse(
@ -134,15 +154,24 @@ int32_t TelRilCall::GetClipResponse(
TELEPHONY_LOGE("ERROR : clipResult == nullptr !!!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
clipResult->result = getClipResult.result;
clipResult->result.result = getClipResult.result;
clipResult->action = getClipResult.action;
clipResult->clipStat = getClipResult.clipStat;
return Response<GetClipResult>(TELEPHONY_LOG_FUNC_NAME, responseInfo, clipResult);
const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
if (ret != TELEPHONY_SUCCESS) {
return ret;
} else if (radioResponseInfo.error != HRilErrType::NONE) {
clipResult->result.result = TELEPHONY_ERR_FAIL;
}
clipResult->result.index = telRilRequest->pointer_->GetParam();
return telRilRequest->pointer_->GetOwner()->SendEvent(telRilRequest->pointer_->GetInnerEventId(), clipResult);
}
int32_t TelRilCall::SetClipResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo)
{
return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
}
int32_t TelRilCall::GetClirResponse(
@ -153,15 +182,24 @@ int32_t TelRilCall::GetClirResponse(
TELEPHONY_LOGE("ERROR : result == nullptr !!!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
result->result = getClirResult.result;
result->result.result = getClirResult.result;
result->action = getClirResult.action;
result->clirStat = getClirResult.clirStat;
return Response<GetClirResult>(TELEPHONY_LOG_FUNC_NAME, responseInfo, result);
const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
if (ret != TELEPHONY_SUCCESS) {
return ret;
} else if (radioResponseInfo.error != HRilErrType::NONE) {
result->result.result = TELEPHONY_ERR_FAIL;
}
result->result.index = telRilRequest->pointer_->GetParam();
return telRilRequest->pointer_->GetOwner()->SendEvent(telRilRequest->pointer_->GetInnerEventId(), result);
}
int32_t TelRilCall::SetClirResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo)
{
return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
}
int32_t TelRilCall::GetCallRestrictionResponse(
@ -172,15 +210,25 @@ int32_t TelRilCall::GetCallRestrictionResponse(
TELEPHONY_LOGE("ERROR : callRestrictionResult == nullptr !!!");
return TELEPHONY_ERR_LOCAL_PTR_NULL;
}
callRestrictionResult->result = result.result;
callRestrictionResult->result.result = result.result;
callRestrictionResult->status = result.status;
callRestrictionResult->classCw = result.classCw;
return Response<CallRestrictionResult>(TELEPHONY_LOG_FUNC_NAME, responseInfo, callRestrictionResult);
const auto &radioResponseInfo = BuildHRilRadioResponseInfo(responseInfo);
std::shared_ptr<TelRilRequest> telRilRequest = FindTelRilRequest(radioResponseInfo);
int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
if (ret != TELEPHONY_SUCCESS) {
return ret;
} else if (radioResponseInfo.error != HRilErrType::NONE) {
callRestrictionResult->result.result = TELEPHONY_ERR_FAIL;
}
callRestrictionResult->result.index = telRilRequest->pointer_->GetParam();
return telRilRequest->pointer_->GetOwner()->SendEvent(
telRilRequest->pointer_->GetInnerEventId(), callRestrictionResult);
}
int32_t TelRilCall::SetCallRestrictionResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo)
{
return Response(TELEPHONY_LOG_FUNC_NAME, responseInfo);
return ResponseSupplement(TELEPHONY_LOG_FUNC_NAME, responseInfo);
}
int32_t TelRilCall::SendDtmfResponse(const HDI::Ril::V1_0::RilRadioResponseInfo &responseInfo)
@ -640,5 +688,22 @@ void TelRilCall::BuildCFQueryInfoList(std::shared_ptr<CallForwardQueryInfoList>
cFQueryInfoList->calls.push_back(call);
}
}
int32_t TelRilCall::ResponseSupplement(const char *funcName, const HDI::Ril::V1_0::RilRadioResponseInfo &iResponseInfo)
{
const auto &radioResponseInfo = BuildHRilRadioResponseInfo(iResponseInfo);
auto telRilRequest = FindTelRilRequest(radioResponseInfo);
int32_t ret = ConfirmSupplementOfTelRilRequestInfo(TELEPHONY_LOG_FUNC_NAME, telRilRequest);
if (ret != TELEPHONY_SUCCESS) {
return ret;
}
auto resultInfo = std::make_shared<SsBaseResult>();
resultInfo->index = telRilRequest->pointer_->GetParam();
resultInfo->result = TELEPHONY_SUCCESS;
if (radioResponseInfo.error != HRilErrType::NONE) {
resultInfo->result = TELEPHONY_ERR_FAIL;
}
return telRilRequest->pointer_->GetOwner()->SendEvent(telRilRequest->pointer_->GetInnerEventId(), resultInfo);
}
} // namespace Telephony
} // namespace OHOS

View File

@ -355,7 +355,7 @@ int32_t TelRilManager::SetCallRestriction(
int32_t slotId, const CallRestrictionParam &callRestriction, const AppExecFwk::InnerEvent::Pointer &response)
{
return TaskSchedule(response, "TelRilCall", GetTelRilCall(slotId), &TelRilCall::SetCallRestriction,
callRestriction.fac, callRestriction.mode, callRestriction.password);
callRestriction.fac, callRestriction.mode, callRestriction.pw);
}
int32_t TelRilManager::SendDtmf(

View File

@ -2122,7 +2122,7 @@ void TelRilTest::OnRequestSetCallRestrictionTest(
TELEPHONY_LOGI("TelRilTest::%{public}s -->", __func__);
restriction.fac = fac;
restriction.mode = mode;
restriction.password = code;
restriction.pw = code;
event->SetOwner(handler);
TELEPHONY_LOGI("TelRilTest::OnRequestSetCallRestrictionTest -->");
telRilManager_->SetCallRestriction(slotId, restriction, event);

View File

@ -1900,7 +1900,7 @@ void TelRilTest::SetCallRestrictionTest(int32_t slotId, const std::shared_ptr<Ap
CallRestrictionParam callRestriction;
callRestriction.mode = 0;
callRestriction.fac = GTEST_STRING;
callRestriction.password = GTEST_STRING;
callRestriction.pw = GTEST_STRING;
TELEPHONY_LOGI("TelRilTest::SetCallRestrictionTest -->");
telRilManager_->SetCallRestriction(slotId, callRestriction, event);
TELEPHONY_LOGI("TelRilTest::SetCallRestrictionTest --> finished");

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
@ -51,7 +51,7 @@ private:
std::shared_ptr<NativePreferences::Preferences> GetProfiles(const std::string &path, int &errCode);
private:
std::string path_ = "/data/telephony/data_storage/telephonyProperties.xml";
std::string path_ = "/data/service/el1/public/telephony/telephonyProperties.xml";
int errCode_ = NativePreferences::E_OK;
const std::string error_ = "error";
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021-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
@ -37,7 +37,9 @@ int TelProfileUtil::SaveString(const std::string &key, const std::string &value)
if (ptr == nullptr) {
return NativePreferences::E_ERROR;
}
return ptr->PutString(key, value);
int ret = ptr->PutString(key, value);
ptr->Flush();
return ret;
}
std::string TelProfileUtil::ObtainString(const std::string &key, const std::string &defValue)
@ -55,7 +57,9 @@ int TelProfileUtil::SaveInt(const std::string &key, int value)
if (ptr == nullptr) {
return NativePreferences::E_ERROR;
}
return ptr->PutInt(key, value);
int ret = ptr->PutInt(key, value);
ptr->Flush();
return ret;
}
int TelProfileUtil::ObtainInt(const std::string &key, int defValue)
@ -73,7 +77,9 @@ int TelProfileUtil::SaveBool(const std::string &key, bool value)
if (ptr == nullptr) {
return NativePreferences::E_ERROR;
}
return ptr->PutBool(key, value);
int ret = ptr->PutBool(key, value);
ptr->Flush();
return ret;
}
bool TelProfileUtil::ObtainBool(const std::string &key, bool defValue)
@ -91,7 +97,9 @@ int TelProfileUtil::SaveLong(const std::string &key, int64_t value)
if (ptr == nullptr) {
return NativePreferences::E_ERROR;
}
return ptr->PutLong(key, value);
int ret = ptr->PutLong(key, value);
ptr->Flush();
return ret;
}
int64_t TelProfileUtil::ObtainLong(const std::string &key, int64_t defValue)
@ -109,7 +117,9 @@ int TelProfileUtil::SaveFloat(const std::string &key, float value)
if (ptr == nullptr) {
return NativePreferences::E_ERROR;
}
return ptr->PutFloat(key, value);
int ret = ptr->PutFloat(key, value);
ptr->Flush();
return ret;
}
float TelProfileUtil::ObtainFloat(const std::string &key, float defValue)