From 0180f363106324c8d00cf02bbbf2999708ea5740 Mon Sep 17 00:00:00 2001 From: songbao1 Date: Sat, 12 Apr 2025 11:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=A6=86=E7=9B=96device?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: songbao1 --- frameworks/core/src/ans_notification.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frameworks/core/src/ans_notification.cpp b/frameworks/core/src/ans_notification.cpp index 8de5bc0fe..d59947731 100644 --- a/frameworks/core/src/ans_notification.cpp +++ b/frameworks/core/src/ans_notification.cpp @@ -656,7 +656,9 @@ ErrCode AnsNotification::SubscribeNotification( ANS_LOGE("Failed to subscribe with SubscriberImpl null ptr."); return ERR_ANS_INVALID_PARAM; } - subscriberSptr->subscriber_.SetDeviceType(subscribeInfo.GetDeviceType()); + if (!subscribeInfo.GetDeviceType().empty()) { + subscriberSptr->subscriber_.SetDeviceType(subscribeInfo.GetDeviceType()); + } return proxy->Subscribe(subscriberSptr, sptrInfo); } @@ -752,7 +754,7 @@ ErrCode AnsNotification::SubscribeNotification(const std::shared_ptrGetDeviceType().empty()) { subscriber->SetDeviceType(subscribeInfo->GetDeviceType()); } DelayedSingleton::GetInstance()->SubscribeSAManager(); -- Gitee