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

Commit 77dd497e authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Remove logspam in InputDispatcher

Currently, we are logging an error when a window does not have a
registered input channel. But that's not really an error.
Convert to a comment instead.

Bug: 122436672
Test: presubmit only
Change-Id: Ic74a467e67b6a2df8bf46a03f7783d0f4805c429
parent 945a7006
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -3114,17 +3114,29 @@ void InputDispatcher::setInputWindows(const std::vector<sp<InputWindowHandle>>&

            std::vector<sp<InputWindowHandle>> newHandles;
            for (const sp<InputWindowHandle>& handle : inputWindowHandles) {
                if (!handle->updateInfo() || (getInputChannelLocked(handle->getToken()) == nullptr
                        && handle->getInfo()->portalToDisplayId == ADISPLAY_ID_NONE)) {
                if (!handle->updateInfo()) {
                    // handle no longer valid
                    continue;
                }
                const InputWindowInfo* info = handle->getInfo();

                if ((getInputChannelLocked(handle->getToken()) == nullptr &&
                     info->portalToDisplayId == ADISPLAY_ID_NONE)) {
                    const bool noInputChannel =
                            info->inputFeatures & InputWindowInfo::INPUT_FEATURE_NO_INPUT_CHANNEL;
                    const bool canReceiveInput =
                            !(info->layoutParamsFlags & InputWindowInfo::FLAG_NOT_TOUCHABLE) ||
                            !(info->layoutParamsFlags & InputWindowInfo::FLAG_NOT_FOCUSABLE);
                    if (canReceiveInput && !noInputChannel) {
                        ALOGE("Window handle %s has no registered input channel",
                              handle->getName().c_str());
                    }
                    continue;
                }

                if (handle->getInfo()->displayId != displayId) {
                if (info->displayId != displayId) {
                    ALOGE("Window %s updated by wrong display %d, should belong to display %d",
                        handle->getName().c_str(), displayId,
                        handle->getInfo()->displayId);
                          handle->getName().c_str(), displayId, info->displayId);
                    continue;
                }