• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 #ifndef FOUNDATION_EVENT_CESFWK_SERVICES_INCLUDE_COMMON_EVENT_RECORD_H
17 #define FOUNDATION_EVENT_CESFWK_SERVICES_INCLUDE_COMMON_EVENT_RECORD_H
18 
19 #include "accesstoken_kit.h"
20 #include "common_event_constant.h"
21 #include "common_event_data.h"
22 #include "common_event_publish_info.h"
23 
24 namespace OHOS {
25 namespace EventFwk {
26 struct EventRecordInfo {
27     pid_t pid;
28     uid_t uid;
29     Security::AccessToken::AccessTokenID callerToken;
30     std::string bundleName;
31     bool isSubsystem;
32     bool isSystemApp;
33     bool isProxy;
34 
EventRecordInfoEventRecordInfo35     EventRecordInfo() : pid(0), uid(0), callerToken(0), isSubsystem(false), isSystemApp(false), isProxy(false) {}
36 };
37 
38 struct CommonEventRecord {
39     std::shared_ptr<CommonEventData> commonEventData;
40     std::shared_ptr<CommonEventPublishInfo> publishInfo;
41     struct tm recordTime {};
42     EventRecordInfo eventRecordInfo;
43     int32_t userId;
44     bool isSystemEvent;
45 
CommonEventRecordCommonEventRecord46     CommonEventRecord()
47         : commonEventData(nullptr),
48           publishInfo(nullptr),
49           userId(UNDEFINED_USER),
50           isSystemEvent(false)
51     {}
52 };
53 }  // namespace EventFwk
54 }  // namespace OHOS
55 #endif  // FOUNDATION_EVENT_CESFWK_SERVICES_INCLUDE_COMMON_EVENT_RECORD_H