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

Commit 192841f0 authored by arthurhung's avatar arthurhung Committed by Automerger Merge Worker
Browse files

Clear spam log for INPUT_FEATURE_NO_INPUT_CHANNEL window am: 80d685ae

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/11931262

Change-Id: Iec89556b3a5a98157cba0ab91377dcda10de830d
parents 260e3e79 80d685ae
Loading
Loading
Loading
Loading
+19 −14
Original line number Original line Diff line number Diff line
@@ -3569,6 +3569,10 @@ std::vector<sp<InputWindowHandle>> InputDispatcher::getWindowHandlesLocked(


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

    for (auto& it : mWindowHandlesByDisplay) {
    for (auto& it : mWindowHandlesByDisplay) {
        const std::vector<sp<InputWindowHandle>> windowHandles = it.second;
        const std::vector<sp<InputWindowHandle>> windowHandles = it.second;
        for (const sp<InputWindowHandle>& windowHandle : windowHandles) {
        for (const sp<InputWindowHandle>& windowHandle : windowHandles) {
@@ -3580,21 +3584,22 @@ sp<InputWindowHandle> InputDispatcher::getWindowHandleLocked(
    return nullptr;
    return nullptr;
}
}


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

    return false;
    return false;
}
}


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


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