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

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

Merge changes from topic "sfinput3"

* changes:
  InputFlinger: Receive setInputWindows over IPC
  InputDispatcher: Look up channel by token.
  InputDispatcher: Track InputChannels by IBinder token.
  Add setInputWindowInfo to SurfaceComposerClient::Transaction
parents dec41d6c 1cc78672
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@

#include <binder/IInterface.h>

#include <utils/Vector.h>
#include <input/InputWindow.h>

namespace android {

/*
@@ -31,6 +34,8 @@ namespace android {
class IInputFlinger : public IInterface {
public:
    DECLARE_META_INTERFACE(InputFlinger)

    virtual void setInputWindows(const Vector<InputWindowInfo>& inputHandles) = 0;
};


@@ -40,7 +45,7 @@ public:
class BnInputFlinger : public BnInterface<IInputFlinger> {
public:
    enum {
        DO_SOMETHING_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
        SET_INPUT_WINDOWS_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
    };

    virtual status_t onTransact(uint32_t code, const Parcel& data,
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#ifndef _LIBINPUT_INPUT_H
#define _LIBINPUT_INPUT_H

#pragma GCC system_header

/**
 * Native input event structures.
 */
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#ifndef _LIBINPUT_INPUT_TRANSPORT_H
#define _LIBINPUT_INPUT_TRANSPORT_H

#pragma GCC system_header

/**
 * Native input transport.
 *
@@ -29,6 +31,7 @@

#include <string>

#include <binder/IBinder.h>
#include <input/Input.h>
#include <utils/Errors.h>
#include <utils/Timers.h>
@@ -188,11 +191,16 @@ public:
    status_t write(Parcel& out) const;
    status_t read(const Parcel& from);

    sp<IBinder> getToken() const;
    void setToken(const sp<IBinder>& token);

private:
    void setFd(int fd);

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

    sp<IBinder> mToken = nullptr;
};

/*
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@ class Parcel;
 * Describes the properties of a window that can receive input.
 */
struct InputWindowInfo {
    InputWindowInfo() = default;
    InputWindowInfo(const Parcel& from);

    // Window flags from WindowManager.LayoutParams
    enum {
        FLAG_ALLOW_LOCK_WHILE_SCREEN_ON     = 0x00000001,
+3 −1
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ cc_library_shared {
        "libutils",
        "libnativewindow",
        "liblog",
        "libinput",
        "libhidlbase",
        "libhidltransport",
        "android.hidl.token@1.0-utils",
@@ -146,7 +147,7 @@ cc_library_shared {
    // bufferhub is not used when building libgui for vendors
    target: {
        vendor: {
            cflags: ["-DNO_BUFFERHUB"],
            cflags: ["-DNO_BUFFERHUB", "-DNO_INPUT"],
            exclude_srcs: [
                "BufferHubConsumer.cpp",
                "BufferHubProducer.cpp",
@@ -155,6 +156,7 @@ cc_library_shared {
                "libbufferhub",
                "libbufferhubqueue",
                "libpdx_default_transport",
                "libinput"
            ],
        },
    },
Loading