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

Commit cac84276 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Build libinputflinger for host

We don't have a usecase for it today, but the main motivation here is to
unify the target and host build parameters.

Also, this exposed an issue where ::write wasn't wrapped.

The host build produced an error:
frameworks/native/services/inputflinger/InputManager.cpp:189:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
    ::write(fd, dump.c_str(), dump.size());

Bug: 271455682
Test: m libinputflinger
Change-Id: If1abc85b230f8e928422dab4c6bb33834b6393ee
parent de1bf9ef
Loading
Loading
Loading
Loading
+5 −29
Original line number Diff line number Diff line
@@ -120,9 +120,11 @@ cc_library {
        "-Wno-unused-parameter",
    ],
    srcs: [
        "android/os/IInputFlinger.aidl",
        "Input.cpp",
        "InputDevice.cpp",
        "InputEventLabels.cpp",
        "InputTransport.cpp",
        "InputVerifier.cpp",
        "Keyboard.cpp",
        "KeyCharacterMap.cpp",
@@ -153,6 +155,7 @@ cc_library {

    shared_libs: [
        "libbase",
        "libbinder",
        "libcutils",
        "liblog",
        "libPlatformProperties",
@@ -172,6 +175,7 @@ cc_library {

    static_libs: [
        "inputconstants-cpp",
        "libgui_window_info_static",
        "libui-types",
        "libtflite_static",
    ],
@@ -181,6 +185,7 @@ cc_library {
    ],

    export_static_lib_headers: [
        "libgui_window_info_static",
        "libui-types",
    ],

@@ -191,24 +196,10 @@ cc_library {

    target: {
        android: {
            srcs: [
                "InputTransport.cpp",
                "android/os/IInputFlinger.aidl",
            ],

            export_shared_lib_headers: ["libbinder"],

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

            static_libs: [
                "libgui_window_info_static",
            ],

            export_static_lib_headers: [
                "libgui_window_info_static",
            ],

            required: [
@@ -223,21 +214,6 @@ cc_library {
                "frameworks/native/libs/arect/include",
            ],
        },
        host_linux: {
            srcs: [
                "InputTransport.cpp",
            ],
            static_libs: [
                "libgui_window_info_static",
            ],
            shared_libs: [
                "libbinder",
            ],

            export_static_lib_headers: [
                "libgui_window_info_static",
            ],
        },
    },

    aidl: {
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ cc_defaults {

cc_library_shared {
    name: "libinputflinger",
    host_supported: true,
    defaults: [
        "inputflinger_defaults",
        "libinputflinger_defaults",
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ status_t InputManager::dump(int fd, const Vector<String16>& args) {

    dump += " InputFlinger dump\n";

    ::write(fd, dump.c_str(), dump.size());
    TEMP_FAILURE_RETRY(::write(fd, dump.c_str(), dump.size()));
    return NO_ERROR;
}