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

Commit be737674 authored by arthurhung's avatar arthurhung Committed by Arthur Hung
Browse files

Clear spam log for INPUT_FEATURE_NO_INPUT_CHANNEL window

Currently, in order to detect occlusion input, all buffered layers
would update input info into InputFlinger, so the window may contain
null token, we should check if id is also identical to prevent get the
wrong result

Bug: 159349058
Test: Enable show tap, open bubble and watch logs.
Change-Id: I8412812e9b100988ab380ad64366f2548e50d9e5
parent 017bcd17
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3569,6 +3569,10 @@ std::vector<sp<InputWindowHandle>> InputDispatcher::getWindowHandlesLocked(

sp<InputWindowHandle> InputDispatcher::getWindowHandleLocked(
        const sp<IBinder>& windowHandleToken) const {
    if (windowHandleToken == nullptr) {
        return nullptr;
    }

    for (auto& it : mWindowHandlesByDisplay) {
        const std::vector<sp<InputWindowHandle>> windowHandles = it.second;
        for (const sp<InputWindowHandle>& windowHandle : windowHandles) {
@@ -3584,7 +3588,8 @@ bool InputDispatcher::hasWindowHandleLocked(const sp<InputWindowHandle>& windowH
    for (auto& it : mWindowHandlesByDisplay) {
        const std::vector<sp<InputWindowHandle>> windowHandles = it.second;
        for (const sp<InputWindowHandle>& handle : windowHandles) {
            if (handle->getToken() == windowHandle->getToken()) {
            if (handle->getId() == windowHandle->getId() &&
                handle->getToken() == windowHandle->getToken()) {
                if (windowHandle->getInfo()->displayId != it.first) {
                    ALOGE("Found window %s in display %" PRId32
                          ", but it should belong to display %" PRId32,