xref: /aosp_15_r20/external/libpalmrejection/Android.bp (revision 385f2b9352baca56113422de7d5392250974f582)
1package {
2    default_team: "trendy_team_input_framework",
3    default_applicable_licenses: ["external_libpalmrejection_license"],
4}
5
6license {
7    name: "external_libpalmrejection_license",
8    visibility: [":__subpackages__"],
9    license_kinds: [
10        "SPDX-license-identifier-BSD",
11    ],
12    license_text: [
13        "LICENSE",
14    ],
15}
16
17cc_library_static {
18    name: "libpalmrejection",
19    local_include_dirs: ["."],
20    export_include_dirs: ["."],
21    srcs: [
22        "chrome_to_android_compatibility.cc",
23        "ui/events/ozone/features.cc",
24        "ui/events/ozone/evdev/touch_evdev_types.cc",
25        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc",
26        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_model.cc",
27        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util.cc",
28        "ui/events/ozone/evdev/touch_filter/palm_detection_filter.cc",
29        "ui/events/ozone/evdev/touch_filter/shared_palm_detection_filter_state.cc",
30        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.cc",
31        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_inference.cc",
32        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_inference_beta.cc",
33        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_inference_v2.cc",
34    ],
35    visibility: [
36        "//frameworks/native/services/inputflinger:__subpackages__",
37    ],
38    shared_libs: [
39        "libchrome",
40    ],
41    cpp_std: "c++20",
42    cflags: [
43        "-Wall",
44        "-Wextra",
45        "-Werror",
46        "-Wthread-safety",
47        "-Wshadow",
48        "-Wshadow-field-in-constructor-modified",
49        "-Wshadow-uncaptured-local",
50        "-Wno-unused-parameter",
51        "-Wno-unneeded-internal-declaration",
52    ],
53    sanitize: {
54        misc_undefined: ["bounds"],
55    },
56    host_supported: true,
57    target: {
58        host: {
59            cflags: [
60                "-D__ANDROID_HOST__",
61            ],
62        },
63    },
64}
65
66cc_test {
67    name: "libpalmrejection_test",
68    srcs: [
69        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_unittest.cc",
70        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util_unittest.cc",
71        "chrome_to_android_compatibility_test_support.cc",
72    ],
73    shared_libs: [
74        "libbase",
75        "libchrome",
76    ],
77    static_libs: [
78        "libgmock",
79        "liblog",
80        "libpalmrejection",
81    ],
82    cpp_std: "c++20",
83    cflags: [
84        "-Wall",
85        "-Wextra",
86        "-Werror",
87        "-Wthread-safety",
88        "-Wshadow",
89        "-Wshadow-field-in-constructor-modified",
90        "-Wshadow-uncaptured-local",
91    ],
92    sanitize: {
93        misc_undefined: ["bounds"],
94    },
95    host_supported: true,
96    target: {
97        host: {
98            cflags: [
99                "-D__ANDROID_HOST__",
100            ],
101        },
102    },
103    test_options: {
104        unit_test: true,
105    },
106    test_suites: ["device-tests"],
107}
108