diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index 1d3ee8f5cfb89260d40dbee9bc3bd56eb9d98f01..335407526c57333ce65743941ac851892b00fda3 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 6f12aaa6a6b93256345824fb0243a306e040f1c6..0dcd509b93f0fb5b244805dd18854f74dbcde267 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) {