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

Commit 017bcd17 authored by Mady Mellor's avatar Mady Mellor
Browse files

Revert "Clear spam log for INPUT_FEATURE_NO_INPUT_CHANNEL window"

This reverts commit 80d685ae.

Reason for revert: seeing if maybe caused regression (b/159719013)
Bug: 159719013
Bug: 159349058
Change-Id: Iac21f799822bab5c26b9753ed78617e0087810bf
parent 80d685ae
Loading
Loading
Loading
Loading
+14 −19
Original line number Diff line number Diff line
@@ -3569,10 +3569,6 @@ 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,22 +3580,21 @@ sp<InputWindowHandle> InputDispatcher::getWindowHandleLocked(
    return nullptr;
}

bool InputDispatcher::hasWindowHandleLocked(const sp<InputWindowHandle>& windowHandle,
                                            int32_t displayId) const {
    const std::vector<sp<InputWindowHandle>> windowHandles = getWindowHandlesLocked(displayId);
bool InputDispatcher::hasWindowHandleLocked(const sp<InputWindowHandle>& windowHandle) const {
    for (auto& it : mWindowHandlesByDisplay) {
        const std::vector<sp<InputWindowHandle>> windowHandles = it.second;
        for (const sp<InputWindowHandle>& handle : windowHandles) {
        if (handle->getId() == windowHandle->getId() &&
            handle->getToken() == windowHandle->getToken()) {
            if (handle->getInfo()->displayId != displayId) {
            if (handle->getToken() == windowHandle->getToken()) {
                if (windowHandle->getInfo()->displayId != it.first) {
                    ALOGE("Found window %s in display %" PRId32
                          ", but it should belong to display %" PRId32,
                      windowHandle->getName().c_str(), displayId,
                          windowHandle->getName().c_str(), it.first,
                          windowHandle->getInfo()->displayId);
                }
                return true;
            }
        }

    }
    return false;
}

@@ -3759,7 +3754,7 @@ void InputDispatcher::setInputWindowsLocked(
        TouchState& state = stateIt->second;
        for (size_t i = 0; i < state.windows.size();) {
            TouchedWindow& touchedWindow = state.windows[i];
            if (!hasWindowHandleLocked(touchedWindow.windowHandle, displayId)) {
            if (!hasWindowHandleLocked(touchedWindow.windowHandle)) {
                if (DEBUG_FOCUS) {
                    ALOGD("Touched window was removed: %s in display %" PRId32,
                          touchedWindow.windowHandle->getName().c_str(), displayId);
@@ -3783,7 +3778,7 @@ void InputDispatcher::setInputWindowsLocked(
    // Otherwise, they might stick around until the window handle is destroyed
    // which might not happen until the next GC.
    for (const sp<InputWindowHandle>& oldWindowHandle : oldWindowHandles) {
        if (!hasWindowHandleLocked(oldWindowHandle, displayId)) {
        if (!hasWindowHandleLocked(oldWindowHandle)) {
            if (DEBUG_FOCUS) {
                ALOGD("Window went away: %s", oldWindowHandle->getName().c_str());
            }
+1 −2
Original line number Diff line number Diff line
@@ -301,8 +301,7 @@ private:
    sp<InputWindowHandle> getWindowHandleLocked(const sp<IBinder>& windowHandleToken) const
            REQUIRES(mLock);
    sp<InputChannel> getInputChannelLocked(const sp<IBinder>& windowToken) const REQUIRES(mLock);
    bool hasWindowHandleLocked(const sp<InputWindowHandle>& windowHandle, int32_t displayId) const
            REQUIRES(mLock);
    bool hasWindowHandleLocked(const sp<InputWindowHandle>& windowHandle) const REQUIRES(mLock);

    /*
     * Validate and update InputWindowHandles for a given display.