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

Commit d9773a8b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Improve input devices changed logs"

parents 77265d25 c5ae0dc5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -559,7 +559,8 @@ void InputReader::refreshConfigurationLocked(uint32_t changes) {
    mEventHub->setExcludedDevices(mConfig.excludedDeviceNames);
    mEventHub->setExcludedDevices(mConfig.excludedDeviceNames);


    if (changes) {
    if (changes) {
        ALOGI("Reconfiguring input devices.  changes=0x%08x", changes);
        ALOGI("Reconfiguring input devices, changes=%s",
              InputReaderConfiguration::changesToString(changes).c_str());
        nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
        nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);


        if (changes & InputReaderConfiguration::CHANGE_MUST_REOPEN) {
        if (changes & InputReaderConfiguration::CHANGE_MUST_REOPEN) {
+38 −0
Original line number Original line Diff line number Diff line
@@ -49,6 +49,44 @@ bool InputReaderThread::threadLoop() {


// --- InputReaderConfiguration ---
// --- InputReaderConfiguration ---


std::string InputReaderConfiguration::changesToString(uint32_t changes) {
    if (changes == 0) {
        return "<none>";
    }
    std::string result;
    if (changes & CHANGE_POINTER_SPEED) {
        result += "POINTER_SPEED | ";
    }
    if (changes & CHANGE_POINTER_GESTURE_ENABLEMENT) {
        result += "POINTER_GESTURE_ENABLEMENT | ";
    }
    if (changes & CHANGE_DISPLAY_INFO) {
        result += "DISPLAY_INFO | ";
    }
    if (changes & CHANGE_SHOW_TOUCHES) {
        result += "SHOW_TOUCHES | ";
    }
    if (changes & CHANGE_KEYBOARD_LAYOUTS) {
        result += "KEYBOARD_LAYOUTS | ";
    }
    if (changes & CHANGE_DEVICE_ALIAS) {
        result += "DEVICE_ALIAS | ";
    }
    if (changes & CHANGE_TOUCH_AFFINE_TRANSFORMATION) {
        result += "TOUCH_AFFINE_TRANSFORMATION | ";
    }
    if (changes & CHANGE_EXTERNAL_STYLUS_PRESENCE) {
        result += "EXTERNAL_STYLUS_PRESENCE | ";
    }
    if (changes & CHANGE_ENABLED_STATE) {
        result += "ENABLED_STATE | ";
    }
    if (changes & CHANGE_MUST_REOPEN) {
        result += "MUST_REOPEN | ";
    }
    return result;
}

std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByUniqueId(
std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByUniqueId(
        const std::string& uniqueDisplayId) const {
        const std::string& uniqueDisplayId) const {
    if (uniqueDisplayId.empty()) {
    if (uniqueDisplayId.empty()) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -270,6 +270,8 @@ struct InputReaderConfiguration {
            pointerGestureZoomSpeedRatio(0.3f),
            pointerGestureZoomSpeedRatio(0.3f),
            showTouches(false), pointerCapture(false) { }
            showTouches(false), pointerCapture(false) { }


    static std::string changesToString(uint32_t changes);

    std::optional<DisplayViewport> getDisplayViewportByType(ViewportType type) const;
    std::optional<DisplayViewport> getDisplayViewportByType(ViewportType type) const;
    std::optional<DisplayViewport> getDisplayViewportByUniqueId(const std::string& uniqueDisplayId)
    std::optional<DisplayViewport> getDisplayViewportByUniqueId(const std::string& uniqueDisplayId)
            const;
            const;