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

Commit 59e96ada authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12860712 from 72b65b83 to 25Q2-release

Change-Id: Id0519174b72dd795ad50d4dffa22ed0ed7e8c5cf
parents aacda2d3 72b65b83
Loading
Loading
Loading
Loading
+156 −118

File changed.

Preview size limit exceeded, changes collapsed.

+42 −14
Original line number Diff line number Diff line
@@ -368,24 +368,52 @@ private:
    };
    sp<gui::WindowInfosListener> mWindowInfoListener;

    class DispatcherWindowInfo {
    public:
        void setWindowHandlesForDisplay(
                ui::LogicalDisplayId displayId,
                std::vector<sp<android::gui::WindowInfoHandle>>&& windowHandles);

        void setDisplayInfos(const std::vector<android::gui::DisplayInfo>& displayInfos);

        void removeDisplay(ui::LogicalDisplayId displayId);

        // Get a reference to window handles by display, return an empty vector if not found.
        const std::vector<sp<android::gui::WindowInfoHandle>>& getWindowHandlesForDisplay(
                ui::LogicalDisplayId displayId) const;

        void forEachWindowHandle(
                std::function<void(const sp<android::gui::WindowInfoHandle>&)> f) const;

        void forEachDisplayId(std::function<void(ui::LogicalDisplayId)> f) const;

        // Get the transform for display, returns Identity-transform if display is missing.
        ui::Transform getDisplayTransform(ui::LogicalDisplayId displayId) const;

        // Lookup for WindowInfoHandle from token and optionally a display-id. In cases where
        // display-id is not provided lookup is done for all displays.
        sp<android::gui::WindowInfoHandle> findWindowHandle(
                const sp<IBinder>& windowHandleToken,
                std::optional<ui::LogicalDisplayId> displayId = {}) const;

        bool isWindowPresent(const sp<android::gui::WindowInfoHandle>& windowHandle) const;

        std::string dumpDisplayAndWindowInfo() const;

    private:
        std::unordered_map<ui::LogicalDisplayId /*displayId*/,
                           std::vector<sp<android::gui::WindowInfoHandle>>>
            mWindowHandlesByDisplay GUARDED_BY(mLock);
    std::unordered_map<ui::LogicalDisplayId /*displayId*/, android::gui::DisplayInfo> mDisplayInfos
            GUARDED_BY(mLock);
                mWindowHandlesByDisplay;
        std::unordered_map<ui::LogicalDisplayId /*displayId*/, android::gui::DisplayInfo>
                mDisplayInfos;
    };

    DispatcherWindowInfo mWindowInfos GUARDED_BY(mLock);

    void setInputWindowsLocked(
            const std::vector<sp<android::gui::WindowInfoHandle>>& inputWindowHandles,
            ui::LogicalDisplayId displayId) REQUIRES(mLock);
    // Get a reference to window handles by display, return an empty vector if not found.
    const std::vector<sp<android::gui::WindowInfoHandle>>& getWindowHandlesLocked(
            ui::LogicalDisplayId displayId) const REQUIRES(mLock);
    ui::Transform getTransformLocked(ui::LogicalDisplayId displayId) const REQUIRES(mLock);

    sp<android::gui::WindowInfoHandle> getWindowHandleLocked(
            const sp<IBinder>& windowHandleToken,
            std::optional<ui::LogicalDisplayId> displayId = {}) const REQUIRES(mLock);
    sp<android::gui::WindowInfoHandle> getWindowHandleLocked(
            const sp<android::gui::WindowInfoHandle>& windowHandle) const REQUIRES(mLock);
    sp<android::gui::WindowInfoHandle> getFocusedWindowHandleLocked(
            ui::LogicalDisplayId displayId) const REQUIRES(mLock);
    bool canWindowReceiveMotionLocked(const sp<android::gui::WindowInfoHandle>& window,