blob: d2ad40754aadd59a994d919b7a7111d36b99276b [file] [log] [blame]
Arthur Hung1a1007b2022-05-11 07:15:01 +00001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Prabir Pradhan48108662022-09-09 21:22:04 +000017#pragma once
Arthur Hung1a1007b2022-05-11 07:15:01 +000018
19#define LOG_TAG "InputDispatcher"
20
21#include <log/log.h>
22#include <log/log_event_list.h>
23
24namespace android::inputdispatcher {
25/**
26 * Log detailed debug messages about each inbound event notification to the dispatcher.
27 * Enable this via "adb shell setprop log.tag.InputDispatcherInboundEvent DEBUG" (requires restart)
28 */
29const bool DEBUG_INBOUND_EVENT_DETAILS =
30 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "InboundEvent", ANDROID_LOG_INFO);
31
32/**
33 * Log detailed debug messages about each outbound event processed by the dispatcher.
34 * Enable this via "adb shell setprop log.tag.InputDispatcherOutboundEvent DEBUG" (requires restart)
35 */
36const bool DEBUG_OUTBOUND_EVENT_DETAILS =
37 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "OutboundEvent", ANDROID_LOG_INFO);
38
39/**
40 * Log debug messages about the dispatch cycle.
41 * Enable this via "adb shell setprop log.tag.InputDispatcherDispatchCycle DEBUG" (requires restart)
42 */
43const bool DEBUG_DISPATCH_CYCLE =
44 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "DispatchCycle", ANDROID_LOG_INFO);
45
46/**
47 * Log debug messages about channel creation
48 * Enable this via "adb shell setprop log.tag.InputDispatcherChannelCreation DEBUG" (requires
49 * restart)
50 */
51const bool DEBUG_CHANNEL_CREATION =
52 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "ChannelCreation", ANDROID_LOG_INFO);
53
54/**
55 * Log debug messages about input event injection.
56 * Enable this via "adb shell setprop log.tag.InputDispatcherInjection DEBUG" (requires restart)
57 */
58const bool DEBUG_INJECTION =
59 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Injection", ANDROID_LOG_INFO);
60
61/**
62 * Log debug messages about input focus tracking.
63 * Enable this via "adb shell setprop log.tag.InputDispatcherFocus DEBUG" (requires restart)
64 */
65const bool DEBUG_FOCUS =
66 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Focus", ANDROID_LOG_INFO);
67
68/**
69 * Log debug messages about touch mode event
70 * Enable this via "adb shell setprop log.tag.InputDispatcherTouchMode DEBUG" (requires restart)
71 */
72const bool DEBUG_TOUCH_MODE =
73 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "TouchMode", ANDROID_LOG_INFO);
74
75/**
76 * Log debug messages about touch occlusion
Arthur Hung1a1007b2022-05-11 07:15:01 +000077 */
Siarhei Vishniakou076dc752022-09-12 15:07:16 +000078constexpr bool DEBUG_TOUCH_OCCLUSION = true;
Arthur Hung1a1007b2022-05-11 07:15:01 +000079
80/**
81 * Log debug messages about the app switch latency optimization.
82 * Enable this via "adb shell setprop log.tag.InputDispatcherAppSwitch DEBUG" (requires restart)
83 */
84const bool DEBUG_APP_SWITCH =
85 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "AppSwitch", ANDROID_LOG_INFO);
86
87/**
88 * Log debug messages about hover events.
89 * Enable this via "adb shell setprop log.tag.InputDispatcherHover DEBUG" (requires restart)
90 */
91const bool DEBUG_HOVER =
92 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Hover", ANDROID_LOG_INFO);
93} // namespace android::inputdispatcher