diff --git a/frameworks/ans/src/notification.cpp b/frameworks/ans/src/notification.cpp index 75b98c85ec87ac6a44affb877c5c39dace24feff..23fc1dd14950323a3c0813b1cdec1c1cb3ea0842 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