From 149e7d3e8380b3ea8d950e0627828543d01ca28c Mon Sep 17 00:00:00 2001 From: xdongs Date: Wed, 2 Jul 2025 17:19:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AE=E9=80=9A=E6=B6=88=E6=81=AFVOIP?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEPC/Pad=E6=8F=90=E9=86=92=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xdongs --- interfaces/inner_api/notification_constant.h | 1 + .../smart_reminder_center.cpp | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/interfaces/inner_api/notification_constant.h b/interfaces/inner_api/notification_constant.h index bf3f6e3eb..5b45966be 100644 --- a/interfaces/inner_api/notification_constant.h +++ b/interfaces/inner_api/notification_constant.h @@ -429,6 +429,7 @@ public: constexpr static const char* PC_DEVICE_TYPE = "pc"; constexpr static const char* DEVICESTYPES[] = {"headset", "liteWearable", "wearable", "pc", "pad"}; constexpr static const char* ANS_VOIP = "ANS_VOIP"; + constexpr static const char* PC_PAD_VOIP_FLAG = "110101"; }; } // namespace Notification } // namespace OHOS diff --git a/services/ans/src/notification_smart_reminder/smart_reminder_center.cpp b/services/ans/src/notification_smart_reminder/smart_reminder_center.cpp index 7ac232e51..524896607 100644 --- a/services/ans/src/notification_smart_reminder/smart_reminder_center.cpp +++ b/services/ans/src/notification_smart_reminder/smart_reminder_center.cpp @@ -496,14 +496,23 @@ void SmartReminderCenter::HandleReminderMethods( shared_ptr>> notificationFlagsOfDevices) const { std::string classfication = request->GetClassification(); - if (deviceType.compare(NotificationConstant::CURRENT_DEVICE_TYPE) == 0 && - classfication == NotificationConstant::ANS_VOIP) { - ANS_LOGI("VOIP or CALL is not affected with SmartReminder"); + + if (syncDevices.find(deviceType) == syncDevices.end()) { return; } - if (syncDevices.find(deviceType) == syncDevices.end()) { - return; + if (request->GetClassification() == NotificationConstant::ANS_VOIP) { + ANS_LOGI("VOIP CALL"); + if (deviceType.compare(NotificationConstant::CURRENT_DEVICE_TYPE) == 0) { + return; + } + if (deviceType.compare(NotificationConstant::PAD_DEVICE_TYPE) == 0 || + deviceType.compare(NotificationConstant::PC_DEVICE_TYPE) == 0) { + std::shared_ptr reminderFlags; + NotificationFlags::GetReminderFlagsByString(NotificationConstant::PC_PAD_VOIP_FLAG, reminderFlags); + (*notificationFlagsOfDevices)[deviceType] = reminderFlags; + return; + } } if (smartDevices.find(deviceType) == smartDevices.end()) { -- Gitee