代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/notification_distributed_notification_service 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2bedc77e8900cbcb4ec7f02fbf597e6d80ad4559 Mon Sep 17 00:00:00 2001
From: l30060944 <l30060944@notesmail.huawei.com/>
Date: Sun, 27 Apr 2025 10:35:49 +0800
Subject: [PATCH] pushcheck TicketNo: DTS0000000000000 Description: pushcheck
Team:OTHERS Feature or Bugfix: Bugfix Binary Source: sync from gitee
PrivateCode(Yes/No):No
Change-Id: I3666a7248b03a458e1cbe6825bc24da20f3bfdbf
---
frameworks/ans/src/push_callback_stub.cpp | 30 +++++++++--------------
1 file changed, 12 insertions(+), 18 deletions(-)
diff --git a/frameworks/ans/src/push_callback_stub.cpp b/frameworks/ans/src/push_callback_stub.cpp
index 7b317d7b..350219c1 100644
--- a/frameworks/ans/src/push_callback_stub.cpp
+++ b/frameworks/ans/src/push_callback_stub.cpp
@@ -73,7 +73,7 @@ ErrCode PushCallBackStub::ConvertPushCheckCodeToErrCode(int32_t pushCheckCode)
int PushCallBackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
{
- ANS_LOGD("called.");
+ ANS_LOGE("called.");
if (data.ReadInterfaceToken() != GetDescriptor()) {
ANS_LOGE("local descriptor is not equal to remote");
return ERR_INVALID_STATE;
@@ -82,29 +82,23 @@ int PushCallBackStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messag
case static_cast<uint32_t>(NotificationInterfaceCode::ON_CHECK_NOTIFICATION): {
auto notificationData = data.ReadString();
int32_t checkResult = ERR_ANS_TASK_ERR;
-
- std::shared_ptr<EventHandler> handler = std::make_shared<EventHandler>(EventRunner::GetMainEventRunner());
- wptr<PushCallBackStub> weak = this;
+ ANS_LOGE("called1.");
std::shared_ptr<PushCallBackParam> pushCallBackParam = std::make_shared<PushCallBackParam>();
- std::unique_lock<std::mutex> uniqueLock(pushCallBackParam->callBackMutex);
- if (handler) {
- handler->PostTask([weak, notificationData, pushCallBackParam]() {
- auto pushCallBackStub = weak.promote();
- if (pushCallBackStub == nullptr) {
- ANS_LOGE("pushCallBackStub is nullptr!");
- return;
- }
- pushCallBackStub->OnCheckNotification(notificationData, pushCallBackParam);
- });
- }
+ ANS_LOGE("called2.");
- pushCallBackParam->callBackCondition.wait(uniqueLock, [=]() {return pushCallBackParam->ready; });
- checkResult = ConvertPushCheckCodeToErrCode(pushCallBackParam->result);
- ANS_LOGD("Push check result:%{public}d", checkResult);
+ checkResult = this->OnCheckNotification(notificationData, pushCallBackParam);
+ checkResult = ConvertPushCheckCodeToErrCode(checkResult);
+ ANS_LOGI("Push check result:%{public}d", checkResult);
+ ANS_LOGI("Push check result:%{public}s", pushCallBackParam->eventControl.c_str());
if (!reply.WriteInt32(checkResult)) {
ANS_LOGE("Failed to write reply ");
return ERR_INVALID_REPLY;
}
+
+ if (!reply.WriteString(pushCallBackParam->eventControl)) {
+ ANS_LOGE("Failed to write reply ");
+ return ERR_INVALID_REPLY;
+ }
return NO_ERROR;
}
--
2.34.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。