diff --git a/services/ans/src/advanced_notification_publish_service.cpp b/services/ans/src/advanced_notification_publish_service.cpp index 0e7dd539252fb89dd9a0b0b0adaf45c54f38d248..7cad489225c7acbc6da9644ef723d14d39243fb0 100644 --- a/services/ans/src/advanced_notification_publish_service.cpp +++ b/services/ans/src/advanced_notification_publish_service.cpp @@ -1152,7 +1152,9 @@ ErrCode AdvancedNotificationService::CommonRequestEnableNotification(const std:: ANS_LOGI("%{public}s_%{public}d, deviceId: %{public}s, Request enable notification dailog result: %{public}d", bundleOption->GetBundleName().c_str(), bundleOption->GetUid(), deviceId.c_str(), result); message.ErrorCode(result); - NotificationAnalyticsUtil::ReportModifyEvent(message); + if (!innerLake || result == ERR_ANS_DIALOG_POP_SUCCEEDED) { + NotificationAnalyticsUtil::ReportModifyEvent(message); + } return result; } @@ -2704,9 +2706,15 @@ ErrCode AdvancedNotificationService::SetBadgeNumber(int32_t badgeNumber, const s ErrCode AdvancedNotificationService::SetBadgeNumberForDhByBundle( const sptr &bundleOption, int32_t badgeNumber) { - if (bundleOption == nullptr || bundleOption->GetBundleName().empty() || - bundleOption->GetUid() <= DEFAULT_UID) { - ANS_LOGE("SetBadgeNumberForDhByBundle invalid bundleOption"); + if (bundleOption == nullptr) { + ANS_LOGE("SetBadgeNumberForDhByBundle bundleOption is null"); + } + if (bundleOption->GetBundleName().empty()) { + ANS_LOGE("SetBadgeNumberForDhByBundle Invalid bundle name."); + return ERR_ANS_INVALID_PARAM; + } + if (bundleOption->GetUid() <= DEFAULT_UID) { + ANS_LOGE("SetBadgeNumberForDhByBundle invalid uid"); return ERR_ANS_INVALID_PARAM; } if (badgeNumber < BADGE_NUM_LIMIT) { diff --git a/services/ans/src/clone/notification_clone_manager.cpp b/services/ans/src/clone/notification_clone_manager.cpp index 420b60b52eb16c6f07330832ad74464dc77649bd..a9b3a5f78dbf667a618b67fb9854019331073e63 100644 --- a/services/ans/src/clone/notification_clone_manager.cpp +++ b/services/ans/src/clone/notification_clone_manager.cpp @@ -105,6 +105,7 @@ static std::string SetBackUpReply() int32_t NotificationCloneManager::OnBackup(MessageParcel& data, MessageParcel& reply) { + ANS_LOGI("OnBackup start"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_22, EventBranchId::BRANCH_1); if (cloneTemplates.empty()) { ANS_LOGI("Notification no need Backup."); @@ -155,6 +156,7 @@ int32_t NotificationCloneManager::OnBackup(MessageParcel& data, MessageParcel& r int32_t NotificationCloneManager::OnRestore(MessageParcel& data, MessageParcel& reply) { + ANS_LOGI("OnRestore start"); HaMetaMessage message = HaMetaMessage(EventSceneId::SCENE_22, EventBranchId::BRANCH_2); reply.WriteString(SetBackUpReply()); std::string storeMessage; @@ -186,6 +188,7 @@ int32_t NotificationCloneManager::OnRestore(MessageParcel& data, MessageParcel& iter->second->OnRestore(jsonObject.at(iter->first)); } } + ANS_LOGI("OnRestore end"); return ERR_OK; } diff --git a/services/ans/src/notification_dialog.cpp b/services/ans/src/notification_dialog.cpp index ac53a95455c63f714aec08c964cb18b8356c0532..5698fabc4360b04640ba29eda4d774847a570ae5 100644 --- a/services/ans/src/notification_dialog.cpp +++ b/services/ans/src/notification_dialog.cpp @@ -51,16 +51,16 @@ ErrCode NotificationDialog::StartEnableNotificationDialogAbility( auto topBundleName = IN_PROCESS_CALL(AAFwk::AbilityManagerClient::GetInstance()->GetTopAbility().GetBundleName()); if (topBundleName != appBundleName) { - ANS_LOGE("Current application isn't in foreground, top is %{public}s.", topBundleName.c_str()); + ANS_LOGW("Current application isn't in foreground, top is %{public}s.", topBundleName.c_str()); if (!innerLake) { return ERR_ANS_INVALID_BUNDLE; } else { - ANS_LOGE("get top ability again"); + ANS_LOGW("get top ability again"); std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); topBundleName = IN_PROCESS_CALL( AAFwk::AbilityManagerClient::GetInstance()->GetTopAbility().GetBundleName()); if (topBundleName != appBundleName) { - ANS_LOGE("get top ability again failed"); + ANS_LOGW("get top ability again failed"); return ERR_ANS_INVALID_BUNDLE; } }