summaryrefslogtreecommitdiff
path: root/Android.bp
blob: 2adf3e478a93de6da9d5e3c77632ec5a436907da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package {
    default_team: "trendy_team_input_framework",
    default_applicable_licenses: ["external_libpalmrejection_license"],
}

license {
    name: "external_libpalmrejection_license",
    visibility: [":__subpackages__"],
    license_kinds: [
        "SPDX-license-identifier-BSD",
    ],
    license_text: [
        "LICENSE",
    ],
}

cc_library_static {
    name: "libpalmrejection",
    local_include_dirs: ["."],
    export_include_dirs: ["."],
    srcs: [
        "chrome_to_android_compatibility.cc",
        "ui/events/ozone/features.cc",
        "ui/events/ozone/evdev/touch_evdev_types.cc",
        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.cc",
        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_model.cc",
        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util.cc",
        "ui/events/ozone/evdev/touch_filter/palm_detection_filter.cc",
        "ui/events/ozone/evdev/touch_filter/shared_palm_detection_filter_state.cc",
        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.cc",
        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_inference.cc",
        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_inference_beta.cc",
        "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_inference_v2.cc",
    ],
    visibility: [
        "//frameworks/native/services/inputflinger:__subpackages__",
    ],
    shared_libs: [
        "libchrome",
    ],
    cpp_std: "c++20",
    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
        "-Wthread-safety",
        "-Wshadow",
        "-Wshadow-field-in-constructor-modified",
        "-Wshadow-uncaptured-local",
        "-Wno-unused-parameter",
        "-Wno-unneeded-internal-declaration",
    ],
    sanitize: {
        misc_undefined: ["bounds"],
    },
    host_supported: true,
    target: {
        host: {
            include_dirs: [
                "bionic/libc/kernel/uapi",
            ],
            cflags: [
                "-D__ANDROID_HOST__",
            ],
        },
    },
}

cc_test {
    name: "libpalmrejection_test",
    srcs: [
        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_unittest.cc",
        "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util_unittest.cc",
        "chrome_to_android_compatibility_test_support.cc",
    ],
    shared_libs: [
        "libbase",
        "libchrome",
    ],
    static_libs: [
        "libc++fs",
        "libgmock",
        "liblog",
        "libpalmrejection",
    ],
    cpp_std: "c++20",
    cflags: [
        "-Wall",
        "-Wextra",
        "-Werror",
        "-Wthread-safety",
        "-Wshadow",
        "-Wshadow-field-in-constructor-modified",
        "-Wshadow-uncaptured-local",
    ],
    sanitize: {
        misc_undefined: ["bounds"],
    },
    host_supported: true,
    target: {
        host: {
            include_dirs: [
                "bionic/libc/kernel/uapi",
            ],
            cflags: [
                "-D__ANDROID_HOST__",
            ],
        },
    },
    test_options: {
        unit_test: true,
    },
    test_suites: ["device-tests"],
}