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

Commit b3ee0688 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Implement Parcelling functions for InputWindowInfo"

parents 568d04d2 3720ed06
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include <utils/BitSet.h>

namespace android {
class Parcel;

/*
 * Intermediate representation used to send input events and related signals.
@@ -143,6 +144,7 @@ protected:
    virtual ~InputChannel();

public:
    InputChannel() = default;
    InputChannel(const std::string& name, int fd);

    /* Creates a pair of input channels.
@@ -183,9 +185,14 @@ public:
    /* Returns a new object that has a duplicate of this channel's fd. */
    sp<InputChannel> dup() const;

    status_t write(Parcel& out) const;
    status_t read(const Parcel& from);

private:
    void setFd(int fd);

    std::string mName;
    int mFd;
    int mFd = -1;
};

/*
+5 −4
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#include "InputApplication.h"

namespace android {

class Parcel;

/*
 * Describes the properties of a window that can receive input.
@@ -151,6 +151,9 @@ struct InputWindowInfo {
    bool supportsSplitTouch() const;

    bool overlaps(const InputWindowInfo* other) const;

    status_t write(Parcel& output) const;
    static InputWindowInfo read(const Parcel& from);
};


@@ -168,9 +171,7 @@ public:
        return mInfo;
    }

    inline sp<InputChannel> getInputChannel() const {
        return mInfo ? mInfo->inputChannel : nullptr;
    }
    sp<InputChannel> getInputChannel() const;

    inline std::string getName() const {
        return mInfo ? mInfo->name : "<invalid>";
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ cc_test {
        "libgui",
        "libhidlbase",
        "libhidltransport",
        "libinput",
        "libui",
        "libutils",
        "libnativewindow"
+3 −0
Original line number Diff line number Diff line
@@ -47,11 +47,14 @@ cc_library {
                "InputTransport.cpp",
                "VelocityControl.cpp",
                "VelocityTracker.cpp",
                "InputApplication.cpp",
                "InputWindow.cpp"
            ],

            shared_libs: [
                "libutils",
                "libbinder",
                "libui"
            ],

            sanitize: {
Loading