diff --git a/services/ans/include/notification_analytics_util.h b/services/ans/include/notification_analytics_util.h index 4fcb7c4617e130d02487dc2f59a23a59261680ed..681c4c26099c0a77ed442f080d68105ffe12796b 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 d7975eaee28c24bb2b92ab65a4a742b0774c67ea..8816f9761b6e2d781618ed8b945697e5c1095e8f 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 1885029789bbb485e40e0f8b24f0717b1d64f6d4..e7499a4ce8d8bdd2691a2e5b093520e5748b9472 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 ea3fcc17e131674f360b055e9ea8120fda76906e..47408d25c372a355b8b30f070c49cba7b16961ab 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 870526597f323c46b792537cb12340224ca6a724..f5c6254097fa08da21673244abae4281be525989 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 06771b8be2a1415ce892dcac6aa0e21208bb8883..e9e3f71a688b03e8e90059149f1b5f21db6896c2 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/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg new file mode 100644 index 0000000000000000000000000000000000000000..b4682e726a67801067571a254f014491d15eda9f --- /dev/null +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/resources/base/media/bell.svg @@ -0,0 +1,8 @@ + + + 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 e0b1491f5792395a2bdeeb49194caed9fc460dc9..7f65f13d5e6e0a7eaba10b65a27c5d0aaad7deb0 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 4990d706f4f6779cbf210bd2f8ba6d539652d456..e4174791689f03771bf653b3430cd3026fc990fe 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 555dbc880e5ce087a5d29246e679590941a4749b..0b7ee0c7adc4b10af5d3845377f9fbd0224fd0d0 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 181a80b1c11297d52b40a12353232fd3887ed003..1a57e8f543706dd53a1da79630375f5667a36917 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 +}