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

Commit 5820852c authored by Brett Chabot's avatar Brett Chabot
Browse files

Build all of libinput for linux host.

Including enabling parcel-related code in source already building for
host.

Test: m libandroid_runtime
Change-Id: Ia569e5158ba6ead28486069036f6a3595662bbf8
parent 1ac550d7
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -177,9 +177,7 @@ struct AInputDevice {

namespace android {

#ifdef __ANDROID__
class Parcel;
#endif

const char* inputEventTypeToString(int32_t type);

@@ -346,10 +344,8 @@ struct PointerCoords {
        return getAxisValue(AMOTION_EVENT_AXIS_Y);
    }

#ifdef __ANDROID__
    status_t readFromParcel(Parcel* parcel);
    status_t writeToParcel(Parcel* parcel) const;
#endif

    bool operator==(const PointerCoords& other) const;
    inline bool operator!=(const PointerCoords& other) const {
@@ -708,10 +704,8 @@ public:
    // Matrix is in row-major form and compatible with SkMatrix.
    void transform(const std::array<float, 9>& matrix);

#ifdef __ANDROID__
    status_t readFromParcel(Parcel* parcel);
    status_t writeToParcel(Parcel* parcel) const;
#endif

    static bool isTouchEvent(uint32_t source, int32_t action);
    inline bool isTouchEvent() const {
+0 −4
Original line number Diff line number Diff line
@@ -19,9 +19,7 @@

#include <stdint.h>

#ifdef __ANDROID__
#include <binder/IBinder.h>
#endif

#include <android-base/result.h>
#include <input/Input.h>
@@ -134,13 +132,11 @@ public:
    void tryRemapKey(int32_t scanCode, int32_t metaState,
            int32_t* outKeyCode, int32_t* outMetaState) const;

#ifdef __ANDROID__
    /* Reads a key map from a parcel. */
    static std::shared_ptr<KeyCharacterMap> readFromParcel(Parcel* parcel);

    /* Writes a key map to a parcel. */
    void writeToParcel(Parcel* parcel) const;
#endif

    KeyCharacterMap(const KeyCharacterMap& other);

+25 −4
Original line number Diff line number Diff line
@@ -40,8 +40,11 @@ cc_library {
        "Keyboard.cpp",
        "KeyCharacterMap.cpp",
        "KeyLayoutMap.cpp",
        "LatencyStatistics.cpp",
        "PropertyMap.cpp",
        "TouchVideoFrame.cpp",
        "VelocityControl.cpp",
        "VelocityTracker.cpp",
        "VirtualKeyMap.cpp",
    ],

@@ -69,9 +72,6 @@ cc_library {
            srcs: [
                "InputTransport.cpp",
                "InputWindow.cpp",
                "LatencyStatistics.cpp",
                "VelocityControl.cpp",
                "VelocityTracker.cpp",
                "android/FocusRequest.aidl",
                "android/InputApplicationInfo.aidl",
                "android/os/IInputConstants.aidl",
@@ -99,12 +99,33 @@ cc_library {
            shared: {
                enabled: false,
            },
            include_dirs: [
                "frameworks/native/libs/arect/include",
            ],
        },
        linux_glibc: {
            srcs: [
                "InputTransport.cpp",
                "InputWindow.cpp",
                "android/FocusRequest.aidl",
                "android/InputApplicationInfo.aidl",
                "android/os/IInputConstants.aidl",
                "android/os/IInputFlinger.aidl",
                "android/os/ISetInputWindowsListener.aidl",
                "android/os/TouchOcclusionMode.aidl",
            ],
            static_libs: [
                "libhostgraphics",
            ],
            shared_libs: [
                "libbinder",
            ],
        },
    },

    aidl: {
        local_include_dirs: ["."],
        export_aidl_headers: true
        export_aidl_headers: true,
    },
}

+1 −5
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@
#include <input/InputDevice.h>
#include <input/InputEventLabels.h>

#ifdef __ANDROID__
#include <binder/Parcel.h>
#ifdef __ANDROID__
#include <sys/random.h>
#endif

@@ -250,7 +250,6 @@ void PointerCoords::applyOffset(float xOffset, float yOffset) {
    setAxisValue(AMOTION_EVENT_AXIS_Y, getY() + yOffset);
}

#ifdef __ANDROID__
status_t PointerCoords::readFromParcel(Parcel* parcel) {
    bits = parcel->readInt64();

@@ -274,7 +273,6 @@ status_t PointerCoords::writeToParcel(Parcel* parcel) const {
    }
    return OK;
}
#endif

void PointerCoords::tooManyAxes(int axis) {
    ALOGW("Could not set value for axis %d because the PointerCoords structure is full and "
@@ -536,7 +534,6 @@ void MotionEvent::transform(const std::array<float, 9>& matrix) {
    }
}

#ifdef __ANDROID__
static status_t readFromParcel(ui::Transform& transform, const Parcel& parcel) {
    float dsdx, dtdx, tx, dtdy, dsdy, ty;
    status_t status = parcel.readFloat(&dsdx);
@@ -673,7 +670,6 @@ status_t MotionEvent::writeToParcel(Parcel* parcel) const {
    }
    return OK;
}
#endif

bool MotionEvent::isTouchEvent(uint32_t source, int32_t action) {
    if (source & AINPUT_SOURCE_CLASS_POINTER) {
+0 −5
Original line number Diff line number Diff line
@@ -19,10 +19,7 @@
#include <stdlib.h>
#include <string.h>

#ifdef __ANDROID__
#include <binder/Parcel.h>
#endif

#include <android/keycodes.h>
#include <attestation/HmacKeyManager.h>
#include <input/InputEventLabels.h>
@@ -590,7 +587,6 @@ void KeyCharacterMap::addLockedMetaKey(Vector<KeyEvent>& outEvents,
    }
}

#ifdef __ANDROID__
std::shared_ptr<KeyCharacterMap> KeyCharacterMap::readFromParcel(Parcel* parcel) {
    if (parcel == nullptr) {
        ALOGE("%s: Null parcel", __func__);
@@ -676,7 +672,6 @@ void KeyCharacterMap::writeToParcel(Parcel* parcel) const {
        parcel->writeInt32(0);
    }
}
#endif


// --- KeyCharacterMap::Key ---
Loading