• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
17 #ifndef _UI_INPUT_DISPATCHER_DEBUG_CONFIG_H
18 #define _UI_INPUT_DISPATCHER_DEBUG_CONFIG_H
19 
20 #define LOG_TAG "InputDispatcher"
21 
22 #include <log/log.h>
23 #include <log/log_event_list.h>
24 
25 namespace android::inputdispatcher {
26 /**
27  * Log detailed debug messages about each inbound event notification to the dispatcher.
28  * Enable this via "adb shell setprop log.tag.InputDispatcherInboundEvent DEBUG" (requires restart)
29  */
30 const bool DEBUG_INBOUND_EVENT_DETAILS =
31         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "InboundEvent", ANDROID_LOG_INFO);
32 
33 /**
34  * Log detailed debug messages about each outbound event processed by the dispatcher.
35  * Enable this via "adb shell setprop log.tag.InputDispatcherOutboundEvent DEBUG" (requires restart)
36  */
37 const bool DEBUG_OUTBOUND_EVENT_DETAILS =
38         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "OutboundEvent", ANDROID_LOG_INFO);
39 
40 /**
41  * Log debug messages about the dispatch cycle.
42  * Enable this via "adb shell setprop log.tag.InputDispatcherDispatchCycle DEBUG" (requires restart)
43  */
44 const bool DEBUG_DISPATCH_CYCLE =
45         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "DispatchCycle", ANDROID_LOG_INFO);
46 
47 /**
48  * Log debug messages about channel creation
49  * Enable this via "adb shell setprop log.tag.InputDispatcherChannelCreation DEBUG" (requires
50  * restart)
51  */
52 const bool DEBUG_CHANNEL_CREATION =
53         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "ChannelCreation", ANDROID_LOG_INFO);
54 
55 /**
56  * Log debug messages about input event injection.
57  * Enable this via "adb shell setprop log.tag.InputDispatcherInjection DEBUG" (requires restart)
58  */
59 const bool DEBUG_INJECTION =
60         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Injection", ANDROID_LOG_INFO);
61 
62 /**
63  * Log debug messages about input focus tracking.
64  * Enable this via "adb shell setprop log.tag.InputDispatcherFocus DEBUG" (requires restart)
65  */
66 const bool DEBUG_FOCUS =
67         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Focus", ANDROID_LOG_INFO);
68 
69 /**
70  * Log debug messages about touch mode event
71  * Enable this via "adb shell setprop log.tag.InputDispatcherTouchMode DEBUG" (requires restart)
72  */
73 const bool DEBUG_TOUCH_MODE =
74         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "TouchMode", ANDROID_LOG_INFO);
75 
76 /**
77  * Log debug messages about touch occlusion
78  */
79 constexpr bool DEBUG_TOUCH_OCCLUSION = true;
80 
81 /**
82  * Log debug messages about the app switch latency optimization.
83  * Enable this via "adb shell setprop log.tag.InputDispatcherAppSwitch DEBUG" (requires restart)
84  */
85 const bool DEBUG_APP_SWITCH =
86         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "AppSwitch", ANDROID_LOG_INFO);
87 
88 /**
89  * Log debug messages about hover events.
90  * Enable this via "adb shell setprop log.tag.InputDispatcherHover DEBUG" (requires restart)
91  */
92 const bool DEBUG_HOVER =
93         __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Hover", ANDROID_LOG_INFO);
94 } // namespace android::inputdispatcher
95 
96 #endif // _UI_INPUT_DISPATCHER_DEBUG_CONFIG_H