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 "dfx_hisysevent.h"
17 #include "entrance_log.h"
18 #include "window_manager_hilog.h"
19
20 namespace OHOS {
21 namespace Rosen {
22 namespace {
23 constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_DOMAIN_WINDOW, "DfxHisysevent" };
24 } // namespace
25
ApplicationBlockInput(int32_t eventId,int32_t pid,const std::string & bundleName,int32_t persistentId)26 void DfxHisysevent::ApplicationBlockInput(int32_t eventId, int32_t pid,
27 const std::string& bundleName, int32_t persistentId)
28 {
29 CALL_DEBUG_ENTER;
30 int32_t ret = HiSysEventWrite(
31 OHOS::HiviewDFX::HiSysEvent::Domain::WINDOW_MANAGER,
32 "APPLICATION_BLOCK_INPUT",
33 OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
34 "EVENT_ID", eventId,
35 "PID", pid,
36 "BUNDLE_NAME", bundleName,
37 "PERSISTENT_ID", persistentId,
38 "MSG", "User input does not respond normally, report by sceneBoard.");
39 if (ret != 0) {
40 WLOGFE("Write HiSysEvent error, ret:%{public}d, eventId:%{public}d, pid:%{public}d, bundleName:%{public}s, "
41 "persistentId:%{public}d", ret, eventId, pid, bundleName.c_str(), persistentId);
42 }
43 }
44 } // namespace Rosen
45 } // namespace OHOS
46
47