1// Copyright (C) 2021 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_input_framework",
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "frameworks_native_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["frameworks_native_license"],
23}
24
25cc_defaults {
26    name: "inputflinger_fuzz_defaults",
27    defaults: [
28        "inputflinger_defaults",
29        "libinputflinger_defaults",
30    ],
31    host_supported: true,
32    include_dirs: [
33        "frameworks/native/services/inputflinger",
34    ],
35    shared_libs: [
36        "libinputreader",
37        "libinputflinger_base",
38    ],
39    sanitize: {
40        hwaddress: true,
41        undefined: true,
42        all_undefined: true,
43        diag: {
44            undefined: true,
45        },
46    },
47    target: {
48        host: {
49            sanitize: {
50                address: true,
51            },
52        },
53    },
54    header_libs: [
55        "libbatteryservice_headers",
56        "libinputreader_headers",
57    ],
58    fuzz_config: {
59        cc: ["android-framework-input@google.com"],
60        componentid: 155276,
61        hotlists: [
62            "4593311",
63        ],
64        description: "The fuzzer targets the APIs of libinputflinger library",
65        vector: "local_no_privileges_required",
66        service_privilege: "privileged",
67        users: "multi_user",
68        fuzzed_code_usage: "shipped",
69    },
70}
71
72cc_fuzz {
73    name: "inputflinger_cursor_input_fuzzer",
74    defaults: [
75        "inputflinger_fuzz_defaults",
76    ],
77    srcs: [
78        "CursorInputFuzzer.cpp",
79    ],
80}
81
82cc_fuzz {
83    name: "inputflinger_keyboard_input_fuzzer",
84    defaults: [
85        "inputflinger_fuzz_defaults",
86    ],
87    srcs: [
88        "KeyboardInputFuzzer.cpp",
89    ],
90}
91
92cc_fuzz {
93    name: "inputflinger_multitouch_input_fuzzer",
94    defaults: [
95        "inputflinger_fuzz_defaults",
96    ],
97    srcs: [
98        "MultiTouchInputFuzzer.cpp",
99    ],
100}
101
102cc_fuzz {
103    name: "inputflinger_switch_input_fuzzer",
104    defaults: [
105        "inputflinger_fuzz_defaults",
106    ],
107    srcs: [
108        "SwitchInputFuzzer.cpp",
109    ],
110}
111
112cc_fuzz {
113    name: "inputflinger_touchpad_input_fuzzer",
114    defaults: [
115        "inputflinger_fuzz_defaults",
116    ],
117    srcs: [
118        "TouchpadInputFuzzer.cpp",
119    ],
120    static_libs: [
121        "libchrome-gestures",
122    ],
123    header_libs: [
124        "libchrome-gestures_headers",
125    ],
126}
127
128cc_fuzz {
129    name: "inputflinger_input_reader_fuzzer",
130    defaults: [
131        "inputflinger_fuzz_defaults",
132    ],
133    srcs: [
134        "InputReaderFuzzer.cpp",
135    ],
136}
137
138cc_fuzz {
139    name: "inputflinger_blocking_queue_fuzzer",
140    defaults: [
141        "inputflinger_fuzz_defaults",
142    ],
143    srcs: [
144        "BlockingQueueFuzzer.cpp",
145    ],
146}
147
148cc_fuzz {
149    name: "inputflinger_input_classifier_fuzzer",
150    defaults: [
151        "inputflinger_fuzz_defaults",
152    ],
153    srcs: [
154        "InputClassifierFuzzer.cpp",
155    ],
156}
157
158cc_fuzz {
159    name: "inputflinger_latencytracker_fuzzer",
160    defaults: [
161        "inputflinger_fuzz_defaults",
162        "libinputdispatcher_defaults",
163    ],
164    shared_libs: [
165        "libinputreporter",
166    ],
167    srcs: [
168        "LatencyTrackerFuzzer.cpp",
169    ],
170}
171
172cc_fuzz {
173    name: "inputflinger_input_dispatcher_fuzzer",
174    defaults: [
175        "inputflinger_fuzz_defaults",
176        "libinputdispatcher_defaults",
177    ],
178    shared_libs: [
179        "libinputreporter",
180    ],
181    static_libs: [
182        "libgmock",
183        "libgtest",
184    ],
185    srcs: [
186        ":inputdispatcher_common_test_sources",
187        "InputDispatcherFuzzer.cpp",
188    ],
189}
190