Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 1 | // Copyright (C) 2016 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 | |
| 15 | // ========= |
| 16 | // incidentd |
| 17 | // ========= |
| 18 | |
Bob Badour | 051ef78 | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 19 | package { |
| 20 | // See: http://go/android-license-faq |
| 21 | // A large-scale-change added 'default_applicable_licenses' to import |
| 22 | // all of the 'license_kinds' from "frameworks_base_license" |
| 23 | // to get the below license kinds: |
| 24 | // SPDX-license-identifier-Apache-2.0 |
| 25 | default_applicable_licenses: ["frameworks_base_license"], |
| 26 | } |
| 27 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 28 | cc_binary { |
| 29 | name: "incidentd", |
| 30 | |
| 31 | srcs: [ |
| 32 | "src/**/*.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 33 | "src/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 34 | ":incidentd_section_list", |
| 35 | ], |
| 36 | |
| 37 | cflags: [ |
| 38 | "-Wall", |
| 39 | "-Werror", |
| 40 | "-Wno-missing-field-initializers", |
| 41 | "-Wno-unused-variable", |
| 42 | "-Wunused-parameter", |
Joe Onorato | e547205 | 2019-04-24 16:27:33 -0700 | [diff] [blame] | 43 | "-Wno-tautological-undefined-compare", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 44 | |
| 45 | // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed. |
| 46 | "-Wno-error=implicit-fallthrough", |
| 47 | |
| 48 | // optimize for size (protobuf glop can get big) |
| 49 | "-Os", |
| 50 | //"-g", |
| 51 | //"-O0", |
| 52 | ], |
| 53 | |
| 54 | local_include_dirs: ["src"], |
Mike Ma | a47ad72 | 2020-01-28 22:04:20 -0800 | [diff] [blame] | 55 | generated_headers: ["framework-cppstream-protos"], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 56 | |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 57 | proto: { |
| 58 | type: "lite", |
| 59 | }, |
| 60 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 61 | shared_libs: [ |
| 62 | "libbase", |
| 63 | "libbinder", |
| 64 | "libdebuggerd_client", |
| 65 | "libdumputils", |
Joe Onorato | 255ffff | 2020-01-17 01:30:02 -0800 | [diff] [blame] | 66 | "libincidentpriv", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 67 | "liblog", |
| 68 | "libprotoutil", |
| 69 | "libservices", |
| 70 | "libutils", |
Mike Ma | 2838169 | 2018-12-04 15:46:29 -0800 | [diff] [blame] | 71 | "libprotobuf-cpp-lite", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 72 | ], |
| 73 | |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 74 | static_libs: [ |
| 75 | "libincidentcompanion", |
| 76 | "libplatformprotos", |
| 77 | ], |
| 78 | |
Joe Onorato | fe7bbf4 | 2019-03-24 20:57:16 -0700 | [diff] [blame] | 79 | product_variables: { |
| 80 | debuggable: { |
| 81 | cflags: ["-DALLOW_RESTRICTED_SECTIONS=1"], |
| 82 | }, |
| 83 | }, |
| 84 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 85 | init_rc: ["incidentd.rc"], |
| 86 | } |
| 87 | |
Pawan Wagh | 2bf6dd9 | 2023-05-16 00:43:05 +0000 | [diff] [blame] | 88 | cc_defaults { |
| 89 | name: "incidentd_test_defaults", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 90 | |
| 91 | cflags: [ |
| 92 | "-Werror", |
| 93 | "-Wall", |
| 94 | "-Wno-unused-variable", |
| 95 | "-Wunused-parameter", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 96 | "-g", |
Joe Onorato | e547205 | 2019-04-24 16:27:33 -0700 | [diff] [blame] | 97 | "-Wno-tautological-undefined-compare", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 98 | |
| 99 | // Allow implicit fallthrough in IncidentService.cpp:85 until it is fixed. |
| 100 | "-Wno-error=implicit-fallthrough", |
| 101 | ], |
| 102 | |
| 103 | local_include_dirs: ["src"], |
Mike Ma | a47ad72 | 2020-01-28 22:04:20 -0800 | [diff] [blame] | 104 | generated_headers: ["framework-cppstream-protos"], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 105 | |
| 106 | srcs: [ |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 107 | "src/FdBuffer.cpp", |
| 108 | "src/Privacy.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 109 | "src/PrivacyFilter.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 110 | "src/Reporter.cpp", |
| 111 | "src/Section.cpp", |
| 112 | "src/Throttler.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 113 | "src/WorkDirectory.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 114 | "src/incidentd_util.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 115 | "src/proto_util.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 116 | "src/report_directory.cpp", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 117 | "src/**/*.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 118 | ], |
| 119 | |
Yao Chen | ec21648 | 2019-02-06 16:45:40 -0800 | [diff] [blame] | 120 | static_libs: [ |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 121 | "libincidentcompanion", |
| 122 | "libplatformprotos-test", |
Yao Chen | ec21648 | 2019-02-06 16:45:40 -0800 | [diff] [blame] | 123 | ], |
Pawan Wagh | 2bf6dd9 | 2023-05-16 00:43:05 +0000 | [diff] [blame] | 124 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 125 | shared_libs: [ |
| 126 | "libbase", |
| 127 | "libbinder", |
| 128 | "libdebuggerd_client", |
| 129 | "libdumputils", |
Joe Onorato | 255ffff | 2020-01-17 01:30:02 -0800 | [diff] [blame] | 130 | "libincidentpriv", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 131 | "liblog", |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 132 | "libprotobuf-cpp-full", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 133 | "libprotoutil", |
| 134 | "libservices", |
| 135 | "libutils", |
| 136 | ], |
Pawan Wagh | 2bf6dd9 | 2023-05-16 00:43:05 +0000 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | // ============== |
| 140 | // incidentd_test |
| 141 | // ============== |
| 142 | cc_test { |
| 143 | name: "incidentd_test", |
| 144 | |
| 145 | defaults: [ |
| 146 | "incidentd_test_defaults", |
| 147 | ], |
| 148 | |
| 149 | test_suites: ["device-tests"], |
| 150 | |
| 151 | srcs: [ |
| 152 | "tests/**/*.cpp", |
| 153 | "tests/**/*.proto", |
| 154 | ], |
| 155 | |
| 156 | data: ["testdata/**/*"], |
| 157 | |
| 158 | static_libs: [ |
| 159 | "libgmock", |
| 160 | ], |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 161 | |
| 162 | target: { |
| 163 | android: { |
| 164 | proto: { |
| 165 | type: "full", |
| 166 | }, |
| 167 | }, |
| 168 | }, |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | genrule { |
| 172 | name: "incidentd_section_list", |
| 173 | tools: ["incident-section-gen"], |
| 174 | out: ["section_list.cpp"], |
| 175 | cmd: "$(location incident-section-gen) incidentd > $(out)", |
| 176 | } |
Pawan Wagh | 2bf6dd9 | 2023-05-16 00:43:05 +0000 | [diff] [blame] | 177 | |
| 178 | cc_fuzz { |
| 179 | name: "incidentd_service_fuzzer", |
| 180 | defaults: [ |
| 181 | "service_fuzzer_defaults", |
| 182 | "fuzzer_disable_leaks", |
| 183 | "incidentd_test_defaults", |
| 184 | ], |
| 185 | |
| 186 | fuzz_config: { |
| 187 | cc: [ |
| 188 | "yaochen@google.com", |
| 189 | "yanmin@google.com", |
| 190 | ], |
| 191 | triage_assignee: "waghpawan@google.com", |
| 192 | }, |
| 193 | |
| 194 | srcs: [ |
| 195 | "fuzzers/IncidentServiceFuzzer.cpp", |
| 196 | "src/IncidentService.cpp", |
| 197 | "src/Broadcaster.cpp", |
| 198 | ":incidentd_section_list", |
| 199 | ], |
| 200 | } |