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

Commit 0f00ad9c authored by Cody Heiner's avatar Cody Heiner
Browse files

Remove build dependency of surfaceflinger on libinput

frameworks/native/libs/input:
 - Extract commonly used input aidl files to a static library
   `iinputflinger_aidl_lib_static`.
 - Update `libinput` to use this library instead of aidl sources.

frameworks/native/services/surfaceflinger:
 - Replace surfaceflinger dependency on `libinput` with
   `iinputflinger_aidl_lib_static`.

vendor/google_arc/libs/libsurfaceflinger_arc:
 - We have to add back the dependency on `libinput` here, since
   surfaceflinger_arc depends on `libinput_serialtracker`, which
   uses libinput definitions.

Note: We may want to try to remove the surfaceflinger_arc
dependency on libinput in a follow-up change.

Test: m checkinput
Test: m surfaceflinger && m libsurfaceflinger_arc_test && m surfaceflinger_service_fuzzer
Test: Flash to device (tangorpro) and device boots normally.
Test: Input functions normally (manual test of stylus prediction shows MotionPredictor working and prediction metrics to be reasonable).

Bug: 325334079

Change-Id: Id549d0f6c4f3cd85d4cba5d6f8f969327f7b6de1
parent 7fcacac5
Loading
Loading
Loading
Loading
+24 −12
Original line number Diff line number Diff line
@@ -135,6 +135,29 @@ rust_bindgen {
    ],
}

cc_library_static {
    name: "iinputflinger_aidl_lib_static",
    host_supported: true,
    srcs: [
        "android/os/IInputFlinger.aidl",
        "android/os/InputChannelCore.aidl",
    ],
    shared_libs: [
        "libbinder",
    ],
    whole_static_libs: [
        "libgui_window_info_static",
    ],
    aidl: {
        export_aidl_headers: true,
        local_include_dirs: ["."],
        include_dirs: [
            "frameworks/native/libs/gui",
            "frameworks/native/libs/input",
        ],
    },
}

// Contains methods to help access C++ code from rust
cc_library_static {
    name: "libinput_from_rust_to_cpp",
@@ -175,8 +198,6 @@ cc_library {
        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
    ],
    srcs: [
        "android/os/IInputFlinger.aidl",
        "android/os/InputChannelCore.aidl",
        "AccelerationCurve.cpp",
        "Input.cpp",
        "InputDevice.cpp",
@@ -239,7 +260,6 @@ cc_library {

    static_libs: [
        "inputconstants-cpp",
        "libgui_window_info_static",
        "libui-types",
        "libtflite_static",
        "libkernelconfigs",
@@ -248,10 +268,10 @@ cc_library {
    whole_static_libs: [
        "com.android.input.flags-aconfig-cc",
        "libinput_rust_ffi",
        "iinputflinger_aidl_lib_static",
    ],

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

@@ -285,14 +305,6 @@ cc_library {
            ],
        },
    },

    aidl: {
        local_include_dirs: ["."],
        export_aidl_headers: true,
        include_dirs: [
            "frameworks/native/libs/gui",
        ],
    },
}

// Use bootstrap version of stats logging library.
+1 −1
Original line number Diff line number Diff line
@@ -83,11 +83,11 @@ cc_defaults {
        "libprotobuf-cpp-lite",
        "libsync",
        "libui",
        "libinput",
        "libutils",
        "libSurfaceFlingerProp",
    ],
    static_libs: [
        "iinputflinger_aidl_lib_static",
        "libaidlcommonsupport",
        "libcompositionengine",
        "libframetimeline",