From 9e03adc431cdf120d6166978ffb1ad2d092d9670 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Fri, 18 Apr 2025 02:54:27 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8A=A0bell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- bell.svg | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 bell.svg diff --git a/bell.svg b/bell.svg new file mode 100644 index 000000000..31a2c13e2 --- /dev/null +++ b/bell.svg @@ -0,0 +1,8 @@ + + + Created with Pixso. + + + + + -- Gitee From 45875d5c2395ccba54e5fa7ae255a5a1ac3d611e Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Fri, 18 Apr 2025 11:06:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=BB=84=E8=93=9D=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- .../ans/include/notification_analytics_util.h | 2 ++ .../advanced_notification_publish_service.cpp | 3 ++- .../common/notification_analytics_util.cpp | 22 +++++++++++++++++++ .../main/ets/pages/carNotificationDialog.ets | 2 +- .../main/ets/pages/tvNotificationDialog.ets | 2 +- .../main/resources/base/element/string.json | 2 +- .../src/main/resources/base/media/bell.svg | 16 +++++++------- .../main/resources/bo_CN/element/string.json | 6 ++++- .../main/resources/zh_CN/element/string.json | 2 +- .../main/resources/zh_HK/element/string.json | 6 ++++- .../main/resources/zh_TW/element/string.json | 6 ++++- 11 files changed, 53 insertions(+), 16 deletions(-) rename bell.svg => services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg (99%) diff --git a/services/ans/include/notification_analytics_util.h b/services/ans/include/notification_analytics_util.h index 4fcb7c461..681c4c260 100644 --- a/services/ans/include/notification_analytics_util.h +++ b/services/ans/include/notification_analytics_util.h @@ -127,6 +127,8 @@ public: static void ReportPublishSuccessEvent(const sptr& request, const HaMetaMessage& message); + static void ReportSAPublishSuccessEvent(const sptr& request, int32_t callUid); + static void ReportModifyEvent(const HaMetaMessage& message); static void ReportDeleteFailedEvent(const HaMetaMessage& message); diff --git a/services/ans/src/advanced_notification_publish_service.cpp b/services/ans/src/advanced_notification_publish_service.cpp index d7975eaee..8816f9761 100644 --- a/services/ans/src/advanced_notification_publish_service.cpp +++ b/services/ans/src/advanced_notification_publish_service.cpp @@ -2635,6 +2635,7 @@ ErrCode AdvancedNotificationService::PublishNotificationBySa(const sptrrequest, ipcUid); CheckDoNotDisturbProfile(record); ChangeNotificationByControlFlags(record, isAgentController); if (IsSaCreateSystemLiveViewAsBundle(record, ipcUid) && @@ -3177,7 +3178,7 @@ ErrCode AdvancedNotificationService::SetTargetDeviceStatus(const std::string &de } bool isSubsystem = AccessTokenHelper::VerifyNativeToken(IPCSkeleton::GetCallingTokenID()); - if (!isSubsystem) { + if (!isSubsystem && !AccessTokenHelper::IsSystemApp()) { ANS_LOGD("isSubsystem is bogus."); return ERR_ANS_NON_SYSTEM_APP; } diff --git a/services/ans/src/common/notification_analytics_util.cpp b/services/ans/src/common/notification_analytics_util.cpp index 188502978..e7499a4ce 100644 --- a/services/ans/src/common/notification_analytics_util.cpp +++ b/services/ans/src/common/notification_analytics_util.cpp @@ -409,6 +409,28 @@ void NotificationAnalyticsUtil::CommonNotificationEvent(const sptr& request, int32_t callUid) +{ + ANS_LOGD("ReportPublishSuccessEvent enter"); + if (request == nullptr) { + return; + } + + EventFwk::Want want; + nlohmann::json ansData; + ansData["ownerUid"] = std::to_string(request->GetOwnerUid()); + ansData["createUid"] = std::to_string(request->GetCreatorUid()); + ansData["callUid"] = std::to_string(callUid); + ansData["slotType"] = static_cast(request->GetSlotType()); + ansData["contentType"] = static_cast(request->GetNotificationType()); + ansData["isAgent"] = static_cast(request->IsAgentNotification()); + std::string message = ansData.dump(-1, ' ', false, nlohmann::json::error_handler_t::replace); + want.SetParam("ansData", message); + want.SetAction(NOTIFICATION_EVENT_PUSH_AGENT); + + IN_PROCESS_CALL_WITHOUT_RET(AddListCache(want, ANS_CUSTOMIZE_CODE)); +} + void NotificationAnalyticsUtil::ReportNotificationEvent(const sptr& request, EventFwk::Want want, int32_t eventCode, const std::string& reason) { diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets index ea3fcc17e..47408d25c 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/carNotificationDialog.ets @@ -87,7 +87,7 @@ struct PermissionDialog { Scroll() { Column() { Row() { - Image($r('app.media.ic_public_ring')) + Image($r('app.media.bell')) .width(32) .height(32) .margin({ top: 24, bottom: 8 }) diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/tvNotificationDialog.ets b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/tvNotificationDialog.ets index 870526597..f5c625409 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/tvNotificationDialog.ets +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/pages/tvNotificationDialog.ets @@ -84,7 +84,7 @@ struct PermissionDialog { Scroll() { Column() { Row() { - Image($r('app.media.ic_public_ring')) + Image($r('app.media.bell')) .width(Constants.TV_DIALOG_ICON_WIDTH) .height(Constants.TV_DIALOG_ICON_WIDTH) .margin({ top: Constants.TV_ICON_MARGIN_TOP }) diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json index 06771b8be..e9e3f71a6 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/element/string.json @@ -26,7 +26,7 @@ }, { "name":"reason_tv", - "value":"Notification reminder methods include banner. You can change your preferences in Settings." + "value":"Notifications will be delivered as banners. You can change your notification preferences at any time in Settings." }, { "name":"ALLOW", diff --git a/bell.svg b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg similarity index 99% rename from bell.svg rename to services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg index 31a2c13e2..b4682e726 100644 --- a/bell.svg +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg @@ -1,8 +1,8 @@ - - - Created with Pixso. - - - - - + + + Created with Pixso. + + + + + diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json index e0b1491f5..7f65f13d5 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/bo_CN/element/string.json @@ -24,6 +24,10 @@ "name":"reason_zyt", "value":"བརྡ་ཐོའི་དྲན་སྐུལ་གྱི་ཐབས་ལམ་ལ་སྒོ་ལྕགས་བརྙན་ཡོལ་དང་། འཕྲེད་བྱང་། ཟུར་རྟགས། དྲིལ་སྒྲ། སྦིར་བརྡ་བཅས་ཚུད་སྲིད། ༼DroiTong༽>༼ ཉེར་སྤྱོད་དོ་དམ་༽ལ་བསྐྱོད་ནས་བཅོས་ཆོག" }, + { + "name":"reason_tv", + "value":"الداق ئۇقتۇرۇش شۇنىڭ ئىچىدە. بۇ تاللانمىنى تەڭشەكتىن ئۆزگەرتەلەيسىز." + }, { "name":"ALLOW", "value":"ཆོག་པ།", @@ -46,4 +50,4 @@ } } ] -} \ No newline at end of file +} diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json index 4990d706f..e41747916 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_CN/element/string.json @@ -26,7 +26,7 @@ }, { "name":"reason_tv", - "value":"通知提醒方式包括横幅。可前往“设置” 更改。" + "value":"通知提醒方式包括横幅。可前往“设置”更改。" }, { "name":"ALLOW", diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json index 555dbc880..0b7ee0c7a 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_HK/element/string.json @@ -24,6 +24,10 @@ "name":"reason_zyt", "value":"通知提醒方式可能包括鎖屏、橫幅、徽章圖標、響鬧、震動。可前往「DroiTong」>「應用程式管理」更改。" }, + { + "name":"reason_tv", + "value":"通知提醒方式包括橫幅。可前往「設定」更改。" + }, { "name":"ALLOW", "value":"允許", @@ -46,4 +50,4 @@ } } ] -} \ No newline at end of file +} diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json index 181a80b1c..1a57e8f54 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/zh_TW/element/string.json @@ -24,6 +24,10 @@ "name":"reason_zyt", "value":"通知提醒方式可能包括鎖定螢幕、橫幅、徽章圖示、響鈴和振動。您可以前往「DroiTong」>「應用程式管理」變更。" }, + { + "name":"reason_tv", + "value":"通知提醒方式包括橫幅。可前往「設定」變更。" + }, { "name":"ALLOW", "value":"允許", @@ -46,4 +50,4 @@ } } ] -} \ No newline at end of file +} -- Gitee