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

Commit a18e2885 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou Committed by Android (Google) Code Review
Browse files

Merge "Remove setInputWindows API" into main

parents c075a6c1 c41de37b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ static void benchmarkNotifyMotion(benchmark::State& state) {
    sp<FakeWindowHandle> window =
            sp<FakeWindowHandle>::make(application, dispatcher, "Fake Window");

    dispatcher.setInputWindows({{ADISPLAY_ID_DEFAULT, {window}}});
    dispatcher.onWindowInfosChanged({{*window->getInfo()}, {}, 0, 0});

    NotifyMotionArgs motionArgs = generateMotionArgs();

@@ -303,7 +303,7 @@ static void benchmarkInjectMotion(benchmark::State& state) {
    sp<FakeWindowHandle> window =
            sp<FakeWindowHandle>::make(application, dispatcher, "Fake Window");

    dispatcher.setInputWindows({{ADISPLAY_ID_DEFAULT, {window}}});
    dispatcher.onWindowInfosChanged({{*window->getInfo()}, {}, 0, 0});

    for (auto _ : state) {
        MotionEvent event = generateMotionEvent();
+0 −13
Original line number Diff line number Diff line
@@ -5057,19 +5057,6 @@ void InputDispatcher::updateWindowHandlesForDisplayLocked(
    mWindowHandlesByDisplay[displayId] = newHandles;
}

void InputDispatcher::setInputWindows(
        const std::unordered_map<int32_t, std::vector<sp<WindowInfoHandle>>>& handlesPerDisplay) {
    // TODO(b/198444055): Remove setInputWindows from InputDispatcher.
    { // acquire lock
        std::scoped_lock _l(mLock);
        for (const auto& [displayId, handles] : handlesPerDisplay) {
            setInputWindowsLocked(handles, displayId);
        }
    }
    // Wake up poll loop since it may need to make new input dispatching choices.
    mLooper->wake();
}

/**
 * Called from InputManagerService, update window handle list by displayId that can receive input.
 * A window handle contains information about InputChannel, Touch Region, Types, Focused,...
+0 −3
Original line number Diff line number Diff line
@@ -109,9 +109,6 @@ public:

    std::unique_ptr<VerifiedInputEvent> verifyInputEvent(const InputEvent& event) override;

    void setInputWindows(
            const std::unordered_map<int32_t, std::vector<sp<android::gui::WindowInfoHandle>>>&
                    handlesPerDisplay) override;
    void setFocusedApplication(
            int32_t displayId,
            const std::shared_ptr<InputApplicationHandle>& inputApplicationHandle) override;
+0 −8
Original line number Diff line number Diff line
@@ -87,14 +87,6 @@ public:
     */
    virtual std::unique_ptr<VerifiedInputEvent> verifyInputEvent(const InputEvent& event) = 0;

    /* Sets the list of input windows per display.
     *
     * This method may be called on any thread (usually by the input manager).
     */
    virtual void setInputWindows(
            const std::unordered_map<int32_t, std::vector<sp<gui::WindowInfoHandle>>>&
                    handlesPerDisplay) = 0;

    /* Sets the focused application on the given display.
     *
     * This method may be called on any thread (usually by the input manager).
+328 −227

File changed.

Preview size limit exceeded, changes collapsed.