blob: 0e260a7a03fffd963ce589c3aac86bc49fba1139 [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 {
Prabir Pradhan65613802023-02-22 23:36:58 +000025
26/**
27 * Signals whether this is a debuggable Android build.
28 * This is populated by reading the value of the "ro.debuggable" property.
29 */
30extern const bool IS_DEBUGGABLE_BUILD;
31
Arthur Hung1a1007b2022-05-11 07:15:01 +000032/**
33 * Log detailed debug messages about each inbound event notification to the dispatcher.
Prabir Pradhan65613802023-02-22 23:36:58 +000034 * Enable this via "adb shell setprop log.tag.InputDispatcherInboundEvent DEBUG".
35 * This requires a restart on non-debuggable (e.g. user) builds, but should take effect immediately
36 * on debuggable builds (e.g. userdebug).
Arthur Hung1a1007b2022-05-11 07:15:01 +000037 */
Prabir Pradhan65613802023-02-22 23:36:58 +000038bool debugInboundEventDetails();
Arthur Hung1a1007b2022-05-11 07:15:01 +000039
40/**
41 * Log detailed debug messages about each outbound event processed by the dispatcher.
42 * Enable this via "adb shell setprop log.tag.InputDispatcherOutboundEvent DEBUG" (requires restart)
43 */
44const bool DEBUG_OUTBOUND_EVENT_DETAILS =
45 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "OutboundEvent", ANDROID_LOG_INFO);
46
47/**
48 * Log debug messages about the dispatch cycle.
49 * Enable this via "adb shell setprop log.tag.InputDispatcherDispatchCycle DEBUG" (requires restart)
50 */
51const bool DEBUG_DISPATCH_CYCLE =
52 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "DispatchCycle", ANDROID_LOG_INFO);
53
54/**
55 * Log debug messages about channel creation
56 * Enable this via "adb shell setprop log.tag.InputDispatcherChannelCreation DEBUG" (requires
57 * restart)
58 */
59const bool DEBUG_CHANNEL_CREATION =
60 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "ChannelCreation", ANDROID_LOG_INFO);
61
62/**
63 * Log debug messages about input event injection.
64 * Enable this via "adb shell setprop log.tag.InputDispatcherInjection DEBUG" (requires restart)
65 */
66const bool DEBUG_INJECTION =
67 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Injection", ANDROID_LOG_INFO);
68
69/**
70 * Log debug messages about input focus tracking.
71 * Enable this via "adb shell setprop log.tag.InputDispatcherFocus DEBUG" (requires restart)
72 */
73const bool DEBUG_FOCUS =
74 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Focus", ANDROID_LOG_INFO);
75
76/**
77 * Log debug messages about touch mode event
78 * Enable this via "adb shell setprop log.tag.InputDispatcherTouchMode DEBUG" (requires restart)
79 */
80const bool DEBUG_TOUCH_MODE =
81 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "TouchMode", ANDROID_LOG_INFO);
82
83/**
84 * Log debug messages about touch occlusion
Arthur Hung1a1007b2022-05-11 07:15:01 +000085 */
Siarhei Vishniakou076dc752022-09-12 15:07:16 +000086constexpr bool DEBUG_TOUCH_OCCLUSION = true;
Arthur Hung1a1007b2022-05-11 07:15:01 +000087
88/**
89 * Log debug messages about the app switch latency optimization.
90 * Enable this via "adb shell setprop log.tag.InputDispatcherAppSwitch DEBUG" (requires restart)
91 */
92const bool DEBUG_APP_SWITCH =
93 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "AppSwitch", ANDROID_LOG_INFO);
94
95/**
96 * Log debug messages about hover events.
97 * Enable this via "adb shell setprop log.tag.InputDispatcherHover DEBUG" (requires restart)
98 */
99const bool DEBUG_HOVER =
100 __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Hover", ANDROID_LOG_INFO);
Prabir Pradhan65613802023-02-22 23:36:58 +0000101
Arthur Hung1a1007b2022-05-11 07:15:01 +0000102} // namespace android::inputdispatcher