From 62db8f8a9ca15173d88601a1ce43a1b5e1bbc3a9 Mon Sep 17 00:00:00 2001 From: songbao1 Date: Sat, 12 Apr 2025 14:31:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=A4=E6=96=AD=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: songbao1 --- services/ans/src/advanced_notification_service.cpp | 11 +++++------ services/ans/src/notification_subscriber_manager.cpp | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 1d3ee8f5c..335407526 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -2282,16 +2282,15 @@ ErrCode AdvancedNotificationService::PushCheck(const sptr & } ErrCode result = pushCallBack->OnCheckNotification(jsonObject.dump(), pushCallBackParam); - if (AccessTokenHelper::CheckPermission(OHOS_PERMISSION_NOTIFICATION_CONTROLLER) && - AccessTokenHelper::CheckPermission(OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER) && - result != ERR_OK) { - ANS_LOGI("The application with the permission fails to pushcheck."); - result = ERR_OK; - } if (result != ERR_OK) { HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_2, EventBranchId::BRANCH_5) .ErrorCode(result).Message("Push OnCheckNotification failed."); NotificationAnalyticsUtil::ReportPublishFailedEvent(request, message); + if (AccessTokenHelper::CheckPermission(OHOS_PERMISSION_NOTIFICATION_CONTROLLER) && + AccessTokenHelper::CheckPermission(OHOS_PERMISSION_NOTIFICATION_AGENT_CONTROLLER)) { + ANS_LOGI("The application with the permission fails to pushcheck."); + result = ERR_OK; + } } if (pushCallBackParam != nullptr && !pushCallBackParam->eventControl.empty() && extroInfo != nullptr) { extroInfo->SetParam("eventControl", AAFwk::String::Box(pushCallBackParam->eventControl)); diff --git a/services/ans/src/notification_subscriber_manager.cpp b/services/ans/src/notification_subscriber_manager.cpp index 6f12aaa6a..0dcd509b9 100644 --- a/services/ans/src/notification_subscriber_manager.cpp +++ b/services/ans/src/notification_subscriber_manager.cpp @@ -623,7 +623,6 @@ bool NotificationSubscriberManager::IsSubscribedBysubscriber( return false; } auto soltType = notification->GetNotificationRequestPoint()->GetSlotType(); - ANS_LOGI("slotTypecount:%{public}d", (int)record->slotTypes.size()); auto slotIter = std::find(record->slotTypes.begin(), record->slotTypes.end(), soltType); bool isSubscribedSlotType = (record->slotTypes.size() == 0) || (slotIter != record->slotTypes.end()); if (!isSubscribedSlotType) { -- Gitee