Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b060def1 authored by Arthur Hung's avatar Arthur Hung
Browse files

Make InputReader logs available dynamically

This will allow InputReader to turn on logs without having to rebuild
and make it easier to debug.

This CL also moved DEBUG_LIGHT_DETAILS from PeripheralController and DEBUG_FOCUS from FocusResolver.

Bug: 211915757
Test: adb shell setprop log.tag.InputReaderRawEvents DEBUG
Test: check that the logs get enabled
Change-Id: Icf9ea0a797cfc5974ebac51ca71b3c20337536c5
parent 642915b4
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -13,24 +13,20 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define LOG_TAG "FocusResolver"
#define LOG_TAG "InputDispatcher"
#define ATRACE_TAG ATRACE_TAG_INPUT

#define INDENT "  "
#define INDENT2 "    "

// Log debug messages about input focus tracking.
static constexpr bool DEBUG_FOCUS = false;

#include <inttypes.h>

#include <android-base/stringprintf.h>
#include <binder/Binder.h>
#include <ftl/enum.h>
#include <gui/WindowInfo.h>
#include <log/log.h>

#include "DebugConfig.h"
#include "FocusResolver.h"

using android::gui::FocusRequest;
+52 −14
Original line number Diff line number Diff line
@@ -20,27 +20,65 @@
#define LOG_TAG "InputReader"

//#define LOG_NDEBUG 0
#include <log/log.h>
#include <log/log_event_list.h>

// Log debug messages for each raw event received from the EventHub.
static constexpr bool DEBUG_RAW_EVENTS = false;
namespace android {
/**
 * Log debug messages for each raw event received from the EventHub.
 * Enable this via "adb shell setprop log.tag.InputReaderRawEvents DEBUG" (requires restart)
 */
const bool DEBUG_RAW_EVENTS =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "RawEvents", ANDROID_LOG_INFO);

// Log debug messages about virtual key processing.
static constexpr bool DEBUG_VIRTUAL_KEYS = false;
/**
 * Log debug messages about virtual key processing.
 * Enable this via "adb shell setprop log.tag.InputReaderVirtualKeys DEBUG" (requires restart)
 */
const bool DEBUG_VIRTUAL_KEYS =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "VirtualKeys", ANDROID_LOG_INFO);

// Log debug messages about pointers.
static constexpr bool DEBUG_POINTERS = false;
/**
 * Log debug messages about pointers.
 * Enable this via "adb shell setprop log.tag.InputReaderPointers DEBUG" (requires restart)
 */
const bool DEBUG_POINTERS =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Pointers", ANDROID_LOG_INFO);

// Log debug messages about pointer assignment calculations.
static constexpr bool DEBUG_POINTER_ASSIGNMENT = false;
/**
 * Log debug messages about pointer assignment calculations.
 * Enable this via "adb shell setprop log.tag.InputReaderPointerAssignment DEBUG" (requires restart)
 */
const bool DEBUG_POINTER_ASSIGNMENT =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "PointerAssignment", ANDROID_LOG_INFO);
/**
 * Log debug messages about gesture detection.
 * Enable this via "adb shell setprop log.tag.InputReaderGestures DEBUG" (requires restart)
 */
const bool DEBUG_GESTURES =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Gestures", ANDROID_LOG_INFO);

// Log debug messages about gesture detection.
static constexpr bool DEBUG_GESTURES = false;
/**
 * Log debug messages about the vibrator.
 * Enable this via "adb shell setprop log.tag.InputReaderVibrator DEBUG" (requires restart)
 */
const bool DEBUG_VIBRATOR =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "Vibrator", ANDROID_LOG_INFO);

// Log debug messages about the vibrator.
static constexpr bool DEBUG_VIBRATOR = false;
/**
 * Log debug messages about fusing stylus data.
 * Enable this via "adb shell setprop log.tag.InputReaderStylusFusion DEBUG" (requires restart)
 */
const bool DEBUG_STYLUS_FUSION =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "StylusFusion", ANDROID_LOG_INFO);

// Log debug messages about fusing stylus data.
static constexpr bool DEBUG_STYLUS_FUSION = false;
/**
 * Log detailed debug messages about input device lights.
 * Enable this via "adb shell setprop log.tag.InputReaderLightDetails DEBUG" (requires restart)
 */
const bool DEBUG_LIGHT_DETAILS =
        __android_log_is_loggable(ANDROID_LOG_DEBUG, LOG_TAG "LightDetails", ANDROID_LOG_INFO);
} // namespace android

#define INDENT "  "
#define INDENT2 "    "
+0 −3
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@
#include "../Macros.h"
#include "PeripheralController.h"

// Log detailed debug messages about input device lights.
static constexpr bool DEBUG_LIGHT_DETAILS = false;

namespace android {

static inline int32_t getAlpha(int32_t color) {