1 /*
2 * Copyright (c) 2023 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
18 #include "hisysevent.h"
19
20 #define STR_CALL_EVENT "CALL_EVENT"
21 #define STR_OS_ACCOUNT_ID "OS_ACCOUNT_ID"
22 #define STR_FUNC_NAME "FUNC_NAME"
23 #define STR_APP_ID "APP_ID"
24 #define STR_REQ_ID "REQ_ID"
25 #define STR_UNKNOWN "unknown"
26
DevAuthReportCallEvent(const char * funcName,int32_t osAccountId,int64_t reqId,const char * appId)27 void DevAuthReportCallEvent(const char *funcName, int32_t osAccountId, int64_t reqId, const char *appId)
28 {
29 HiSysEventWrite(
30 OHOS::HiviewDFX::HiSysEvent::Domain::DEVICE_AUTH,
31 STR_CALL_EVENT,
32 OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC,
33 STR_OS_ACCOUNT_ID, osAccountId,
34 STR_FUNC_NAME, ((funcName != NULL) ? funcName : STR_UNKNOWN),
35 STR_REQ_ID, reqId,
36 STR_APP_ID, ((appId != NULL) ? appId : STR_UNKNOWN));
37 }
38