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

Commit 6bb73f6d authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Add WindowInfosListener to Input" into sc-v2-dev am: a6ccdf9d

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

Change-Id: Ic62c1065978d2a43c67a692523399097224689ec
parents 675625ee a6ccdf9d
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -241,18 +241,6 @@ public:
        return mInfo.token ? std::chrono::nanoseconds(mInfo.dispatchingTimeout) : defaultValue;
    }

    /**
     * Requests that the state of this object be updated to reflect
     * the most current available information about the application.
     * As this class is created as RefBase object, no pure virtual function is allowed.
     *
     * This method should only be called from within the input dispatcher's
     * critical section.
     *
     * Returns true on success, or false if the handle is no longer valid.
     */
    virtual bool updateInfo() { return false; }

    /**
     * Updates from another input window handle.
     */
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ cc_library_shared {
        "libinputflinger_base",
        "libinputreporter",
        "libinputreader",
        "libgui",
    ],
    static_libs: [
        "libinputdispatcher",
+1 −10
Original line number Diff line number Diff line
@@ -114,15 +114,6 @@ sp<InputDispatcherInterface> InputManager::getDispatcher() {
    return mDispatcher;
}

class BinderWindowHandle : public WindowInfoHandle {
public:
    BinderWindowHandle(const WindowInfo& info) { mInfo = info; }

    bool updateInfo() override {
        return true;
    }
};

binder::Status InputManager::setInputWindows(
        const std::vector<WindowInfo>& infos,
        const sp<ISetInputWindowsListener>& setInputWindowsListener) {
@@ -131,7 +122,7 @@ binder::Status InputManager::setInputWindows(
    std::vector<sp<WindowInfoHandle>> handles;
    for (const auto& info : infos) {
        handlesPerDisplay.emplace(info.displayId, std::vector<sp<WindowInfoHandle>>());
        handlesPerDisplay[info.displayId].push_back(new BinderWindowHandle(info));
        handlesPerDisplay[info.displayId].push_back(new WindowInfoHandle(info));
    }
    mDispatcher->setInputWindows(handlesPerDisplay);

+2 −3
Original line number Diff line number Diff line
@@ -185,10 +185,11 @@ public:
                     const sp<InputDispatcher>& dispatcher, const std::string name)
          : FakeInputReceiver(dispatcher, name), mFrame(Rect(0, 0, WIDTH, HEIGHT)) {
        inputApplicationHandle->updateInfo();
        updateInfo();
        mInfo.applicationInfo = *inputApplicationHandle->getInfo();
    }

    virtual bool updateInfo() override {
    void updateInfo() {
        mInfo.token = mClientChannel->getConnectionToken();
        mInfo.name = "FakeWindowHandle";
        mInfo.type = WindowInfo::Type::APPLICATION;
@@ -207,8 +208,6 @@ public:
        mInfo.ownerPid = INJECTOR_PID;
        mInfo.ownerUid = INJECTOR_UID;
        mInfo.displayId = ADISPLAY_ID_DEFAULT;

        return true;
    }

protected:
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ cc_defaults {
        "libstatspull",
        "libstatssocket",
        "libui",
        "libgui",
        "libutils",
        "lib-platform-compat-native-api",
        "server_configurable_flags",
Loading