1 /*
2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 
16 #include "notification_analytics_util.h"
17 
18 namespace OHOS {
19 namespace Notification {
20 
HaMetaMessage(uint32_t sceneId,uint32_t branchId)21 HaMetaMessage::HaMetaMessage(uint32_t sceneId, uint32_t branchId)
22     : sceneId_(sceneId), branchId_(branchId)
23 {
24 }
25 
NeedReport() const26 bool HaMetaMessage::NeedReport() const
27 {
28     return true;
29 }
30 
SceneId(uint32_t sceneId)31 HaMetaMessage& HaMetaMessage::SceneId(uint32_t sceneId)
32 {
33     sceneId_ = sceneId;
34     return *this;
35 }
36 
BranchId(uint32_t branchId)37 HaMetaMessage& HaMetaMessage::BranchId(uint32_t branchId)
38 {
39     branchId_ = branchId;
40     return *this;
41 }
42 
ErrorCode(uint32_t errorCode)43 HaMetaMessage& HaMetaMessage::ErrorCode(uint32_t errorCode)
44 {
45     errorCode_ = errorCode;
46     return *this;
47 }
48 
Message(const std::string & message,bool print)49 HaMetaMessage& HaMetaMessage::Message(const std::string& message, bool print)
50 {
51     message_ = message;
52     return *this;
53 }
54 
Checkfailed(bool checkfailed)55 HaMetaMessage& HaMetaMessage::Checkfailed(bool checkfailed)
56 {
57     checkfailed_ = checkfailed;
58     return *this;
59 }
60 
BundleName(const std::string & bundleName)61 HaMetaMessage& HaMetaMessage::BundleName(const std::string& bundleName)
62 {
63     bundleName_ = bundleName;
64     return *this;
65 }
66 
AgentBundleName(const std::string & agentBundleName)67 HaMetaMessage& HaMetaMessage::AgentBundleName(const std::string& agentBundleName)
68 {
69     agentBundleName_ = agentBundleName;
70     return *this;
71 }
72 
TypeCode(int32_t typeCode)73 HaMetaMessage& HaMetaMessage::TypeCode(int32_t typeCode)
74 {
75     typeCode_ = typeCode;
76     return *this;
77 }
78 
NotificationId(int32_t notificationId)79 HaMetaMessage& HaMetaMessage::NotificationId(int32_t notificationId)
80 {
81     notificationId_ = notificationId;
82     return *this;
83 }
84 
GetMessage() const85 std::string HaMetaMessage::GetMessage() const
86 {
87     return message_;
88 }
89 
SlotType(int32_t slotType)90 HaMetaMessage& HaMetaMessage::SlotType(int32_t slotType)
91 {
92     slotType_ = slotType;
93     return *this;
94 }
95 
Build() const96 std::string HaMetaMessage::Build() const
97 {
98     return std::string("");
99 }
100 
ReportPublishFailedEvent(const sptr<NotificationRequest> & request,const HaMetaMessage & message)101 void NotificationAnalyticsUtil::ReportPublishFailedEvent(const sptr<NotificationRequest>& request,
102     const HaMetaMessage& message)
103 {
104     return;
105 }
106 
ReportDeleteFailedEvent(const sptr<NotificationRequest> & request,HaMetaMessage & message)107 void NotificationAnalyticsUtil::ReportDeleteFailedEvent(const sptr<NotificationRequest>& request,
108     HaMetaMessage& message)
109 {
110     return;
111 }
112 
CommonNotificationEvent(const sptr<NotificationRequest> & request,int32_t eventCode,const HaMetaMessage & message)113 void NotificationAnalyticsUtil::CommonNotificationEvent(const sptr<NotificationRequest>& request,
114     int32_t eventCode, const HaMetaMessage& message)
115 {
116     return;
117 }
118 
ReportNotificationEvent(const sptr<NotificationRequest> & request,EventFwk::Want want,int32_t eventCode,const std::string & reason)119 void NotificationAnalyticsUtil::ReportNotificationEvent(const sptr<NotificationRequest>& request,
120     EventFwk::Want want, int32_t eventCode, const std::string& reason)
121 {
122     return;
123 }
124 
ReportModifyEvent(const HaMetaMessage & message)125 void NotificationAnalyticsUtil::ReportModifyEvent(const HaMetaMessage& message)
126 {
127     return;
128 }
129 
ReportDeleteFailedEvent(const HaMetaMessage & message)130 void NotificationAnalyticsUtil::ReportDeleteFailedEvent(const HaMetaMessage& message)
131 {
132     return;
133 }
134 
ReportNotificationEvent(EventFwk::Want want,int32_t eventCode,const std::string & reason)135 void NotificationAnalyticsUtil::ReportNotificationEvent(EventFwk::Want want,
136     int32_t eventCode, const std::string& reason)
137 {
138     return;
139 }
140 } // namespace Notification
141 } // namespace OHOS
142