From 729775a628d714fc372b2c254495744876ae8329 Mon Sep 17 00:00:00 2001 From: baozeyu Date: Mon, 20 Nov 2023 16:12:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ownerBundleName=E8=BF=9B?= =?UTF-8?q?=E5=85=A5notificationKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib0265f820b83280ab862575777b876bb32dcb943 --- frameworks/ans/src/notification.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frameworks/ans/src/notification.cpp b/frameworks/ans/src/notification.cpp index 75b98c85e..23fc1dd14 100644 --- a/frameworks/ans/src/notification.cpp +++ b/frameworks/ans/src/notification.cpp @@ -469,9 +469,12 @@ std::string Notification::GenerateNotificationKey( const std::string &deviceId, int32_t userId, int32_t uid, const std::string &label, int32_t id) { const char *keySpliter = "_"; - + std::string ownerBundleName = request_->GetOwnerBundleName(); + if (ownerBundleName.empty()) { + ANS_LOGI("ownerBundleName is empty"); + } std::stringstream stream; - stream << deviceId << keySpliter << userId << keySpliter << uid << keySpliter << label << keySpliter << id; + stream << deviceId << keySpliter << userId << keySpliter << uid << keySpliter << label << keySpliter << id<< keySpliter << ownerBundleName; return stream.str(); } @@ -508,4 +511,4 @@ std::string Notification::Dump() const " }"; } } // namespace Notification -} // namespace OHOS \ No newline at end of file +} // namespace OHOS -- Gitee