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

Commit 15a919e0 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Remove "no focused window" log

There could be a race where the WM sets the focused display, but the
window infos containing a focusable window haven't been set yet. This
would result in scary-looking logs like "display doesn't have a focused
window".

The "no-focused-window" ANR should be moved to WM anyways. Currently
these logs just result in mis-triaging of bugs to our team.

Remove them.

Bug: 165321216
Test: none
Flag: EXEMPT refactor
Change-Id: I9f860bff352c709ec2e23864e4b24f4601376d5a
parent 93ea7cdb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ public:
    void displayRemoved(ui::LogicalDisplayId displayId);

    // exposed for debugging
    bool hasFocusedWindowTokens() const { return !mFocusedWindowTokenByDisplay.empty(); }
    std::string dumpFocusedWindows() const;
    std::string dump() const;

private:
@@ -123,6 +121,8 @@ private:
            ui::LogicalDisplayId displayId, const std::string& reason, const sp<IBinder>& token,
            const std::string& tokenName = "");
    std::optional<android::gui::FocusRequest> getFocusRequest(ui::LogicalDisplayId displayId);

    std::string dumpFocusedWindows() const;
};

} // namespace android::inputdispatcher
+0 −9
Original line number Diff line number Diff line
@@ -5734,15 +5734,6 @@ void InputDispatcher::setFocusedDisplay(ui::LogicalDisplayId displayId) {
            // Find new focused window and validate
            sp<IBinder> newFocusedWindowToken = mFocusResolver.getFocusedWindowToken(displayId);
            sendFocusChangedCommandLocked(oldFocusedWindowToken, newFocusedWindowToken);

            if (newFocusedWindowToken == nullptr) {
                ALOGW("Focused display #%s does not have a focused window.",
                      displayId.toString().c_str());
                if (mFocusResolver.hasFocusedWindowTokens()) {
                    ALOGE("But another display has a focused window\n%s",
                          mFocusResolver.dumpFocusedWindows().c_str());
                }
            }
        }
    } // release lock