1 /*
2 * Copyright (c) 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 #include "hisysevent_adapter.h"
17 #include "hisysevent.h"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 constexpr char STR_EVENT_CORE_FUNCTION[] = "CORE_FUNCTION";
24 constexpr char STR_EVENT[] = "EVENT";
25 constexpr char STR_APP_ID[] = "APP_ID";
26 constexpr char STR_BATCH_NUMBER[] = "BATCH_NUMBER";
27 constexpr char STR_RESULT[] = "RESULT";
28 constexpr char STR_OS_ACCOUNT_ID[] = "OS_ACCOUNT_ID";
29
ReportCoreFuncInvokeEvent(const InvokeEvent * event)30 void ReportCoreFuncInvokeEvent(const InvokeEvent *event)
31 {
32 if (event == nullptr) {
33 return;
34 }
35 OHOS::HiviewDFX::HiSysEvent::Write(
36 OHOS::HiviewDFX::HiSysEvent::Domain::DEVICE_AUTH,
37 STR_EVENT_CORE_FUNCTION,
38 OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC,
39 STR_EVENT, event->eventId,
40 STR_APP_ID, event->appId,
41 STR_BATCH_NUMBER, event->batchNumber,
42 STR_RESULT, event->result,
43 STR_OS_ACCOUNT_ID, event->osAccountId);
44 }
45
46 #ifdef __cplusplus
47 }
48 #endif