Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 1 | // Media Statistics service |
| 2 | // |
| 3 | |
Bob Badour | 56786ac | 2021-02-25 15:24:36 -0800 | [diff] [blame] | 4 | package { |
| 5 | // See: http://go/android-license-faq |
| 6 | // A large-scale-change added 'default_applicable_licenses' to import |
| 7 | // all of the 'license_kinds' from "frameworks_av_license" |
| 8 | // to get the below license kinds: |
| 9 | // SPDX-license-identifier-Apache-2.0 |
| 10 | default_applicable_licenses: ["frameworks_av_license"], |
| 11 | } |
| 12 | |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 13 | tidy_errors = [ |
| 14 | // https://clang.llvm.org/extra/clang-tidy/checks/list.html |
| 15 | // For many categories, the checks are too many to specify individually. |
| 16 | // Feel free to disable as needed - as warnings are generally ignored, |
| 17 | // we treat warnings as errors. |
| 18 | "android-*", |
| 19 | "bugprone-*", |
| 20 | "cert-*", |
| 21 | "clang-analyzer-security*", |
| 22 | "google-*", |
| 23 | "misc-*", |
| 24 | //"modernize-*", // explicitly list the modernize as they can be subjective. |
| 25 | "modernize-avoid-bind", |
| 26 | //"modernize-avoid-c-arrays", // std::array<> can be verbose |
| 27 | "modernize-concat-nested-namespaces", |
| 28 | //"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent. |
| 29 | "modernize-deprecated-ios-base-aliases", |
| 30 | "modernize-loop-convert", |
| 31 | "modernize-make-shared", |
| 32 | "modernize-make-unique", |
Chih-Hung Hsieh | 492141a | 2021-02-21 18:17:49 -0800 | [diff] [blame] | 33 | // "modernize-pass-by-value", // found in TimeMachine.h |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 34 | "modernize-raw-string-literal", |
| 35 | "modernize-redundant-void-arg", |
| 36 | "modernize-replace-auto-ptr", |
| 37 | "modernize-replace-random-shuffle", |
| 38 | "modernize-return-braced-init-list", |
| 39 | "modernize-shrink-to-fit", |
| 40 | "modernize-unary-static-assert", |
Chih-Hung Hsieh | 492141a | 2021-02-21 18:17:49 -0800 | [diff] [blame] | 41 | // "modernize-use-auto", // found in MediaMetricsService.h, debatable - auto can obscure type |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 42 | "modernize-use-bool-literals", |
| 43 | "modernize-use-default-member-init", |
| 44 | "modernize-use-emplace", |
| 45 | "modernize-use-equals-default", |
| 46 | "modernize-use-equals-delete", |
Chih-Hung Hsieh | 492141a | 2021-02-21 18:17:49 -0800 | [diff] [blame] | 47 | // "modernize-use-nodiscard", // found in TimeMachine.h |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 48 | "modernize-use-noexcept", |
| 49 | "modernize-use-nullptr", |
| 50 | "modernize-use-override", |
| 51 | //"modernize-use-trailing-return-type", // not necessarily more readable |
| 52 | "modernize-use-transparent-functors", |
| 53 | "modernize-use-uncaught-exceptions", |
| 54 | "modernize-use-using", |
| 55 | "performance-*", |
| 56 | |
| 57 | // Remove some pedantic stylistic requirements. |
| 58 | "-google-readability-casting", // C++ casts not always necessary and may be verbose |
| 59 | "-google-readability-todo", // do not require TODO(info) |
Chih-Hung Hsieh | 492141a | 2021-02-21 18:17:49 -0800 | [diff] [blame] | 60 | |
| 61 | "-bugprone-unhandled-self-assignment", // found in TimeMachine.h |
| 62 | "-bugprone-suspicious-string-compare", // found in TimeMachine.h |
| 63 | "-cert-oop54-cpp", // found in TransactionLog.h |
Pirama Arumuga Nainar | d11dda8 | 2021-03-17 22:10:11 -0700 | [diff] [blame] | 64 | "-bugprone-narrowing-conversions", // b/182410845 |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 65 | ] |
| 66 | |
| 67 | cc_defaults { |
| 68 | name: "mediametrics_flags_defaults", |
| 69 | // https://clang.llvm.org/docs/UsersManual.html#command-line-options |
| 70 | // https://clang.llvm.org/docs/DiagnosticsReference.html |
| 71 | cflags: [ |
| 72 | "-Wall", |
| 73 | "-Wdeprecated", |
| 74 | "-Werror", |
| 75 | "-Werror=implicit-fallthrough", |
| 76 | "-Werror=sometimes-uninitialized", |
| 77 | "-Werror=conditional-uninitialized", |
| 78 | "-Wextra", |
| 79 | "-Wredundant-decls", |
Hangyu Kuang | 6606267 | 2020-12-03 19:30:25 +0000 | [diff] [blame] | 80 | "-Wshadow", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 81 | "-Wstrict-aliasing", |
| 82 | "-fstrict-aliasing", |
| 83 | "-Wthread-safety", |
| 84 | //"-Wthread-safety-negative", // experimental - looks broken in R. |
| 85 | "-Wunreachable-code", |
| 86 | "-Wunreachable-code-break", |
| 87 | "-Wunreachable-code-return", |
| 88 | "-Wunused", |
| 89 | "-Wused-but-marked-unused", |
| 90 | ], |
| 91 | // https://clang.llvm.org/extra/clang-tidy/ |
| 92 | tidy: true, |
| 93 | tidy_checks: tidy_errors, |
| 94 | tidy_checks_as_errors: tidy_errors, |
| 95 | tidy_flags: [ |
Chih-Hung Hsieh | 492141a | 2021-02-21 18:17:49 -0800 | [diff] [blame] | 96 | "-format-style=file", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 97 | ], |
| 98 | } |
| 99 | |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 100 | cc_binary { |
| 101 | name: "mediametrics", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 102 | defaults: [ |
| 103 | "mediametrics_flags_defaults", |
| 104 | ], |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 105 | |
| 106 | srcs: [ |
| 107 | "main_mediametrics.cpp", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 108 | ], |
| 109 | |
| 110 | shared_libs: [ |
| 111 | "libbinder", |
| 112 | "liblog", |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 113 | "libmediametricsservice", |
Andy Hung | a85efab | 2019-12-23 11:41:29 -0800 | [diff] [blame] | 114 | "libmediautils", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 115 | "libutils", |
Jeongik Cha | a01ed78 | 2021-02-11 09:50:00 +0900 | [diff] [blame] | 116 | "mediametricsservice-aidl-cpp", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 117 | ], |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 118 | header_libs: [ |
Andy Hung | a629bd1 | 2020-06-05 16:03:53 -0700 | [diff] [blame] | 119 | "libaudioutils_headers", |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 120 | "libmediametrics_headers", |
| 121 | ], |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 122 | |
| 123 | init_rc: [ |
| 124 | "mediametrics.rc", |
| 125 | ], |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Mufaddal Chakera | 1d5f7ed | 2020-10-13 14:09:26 +0530 | [diff] [blame] | 128 | cc_library { |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 129 | name: "libmediametricsservice", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 130 | defaults: [ |
| 131 | "mediametrics_flags_defaults", |
| 132 | ], |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 133 | |
| 134 | srcs: [ |
Andy Hung | 06f3aba | 2019-12-03 16:36:42 -0800 | [diff] [blame] | 135 | "AudioAnalytics.cpp", |
Joey Poomarin | 5298998 | 2020-03-05 17:40:49 +0800 | [diff] [blame] | 136 | "AudioPowerUsage.cpp", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 137 | "AudioTypes.cpp", |
Ray Essick | 5a55729 | 2020-06-10 21:31:33 -0700 | [diff] [blame] | 138 | "cleaner.cpp", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 139 | "iface_statsd.cpp", |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 140 | "MediaMetricsService.cpp", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 141 | "statsd_audiopolicy.cpp", |
| 142 | "statsd_audiorecord.cpp", |
| 143 | "statsd_audiothread.cpp", |
| 144 | "statsd_audiotrack.cpp", |
| 145 | "statsd_codec.cpp", |
| 146 | "statsd_drm.cpp", |
| 147 | "statsd_extractor.cpp", |
Santiago Seifert | 149f058 | 2020-08-11 17:58:41 +0100 | [diff] [blame] | 148 | "statsd_mediaparser.cpp", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 149 | "statsd_nuplayer.cpp", |
| 150 | "statsd_recorder.cpp", |
Andy Hung | c9b6f8b | 2021-07-08 10:17:55 -0700 | [diff] [blame] | 151 | "StringUtils.cpp", |
| 152 | "ValidateId.cpp", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 153 | ], |
| 154 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 155 | proto: { |
| 156 | type: "lite", |
| 157 | }, |
| 158 | |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 159 | shared_libs: [ |
Jeongik Cha | a01ed78 | 2021-02-11 09:50:00 +0900 | [diff] [blame] | 160 | "mediametricsservice-aidl-cpp", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 161 | "libbase", // android logging |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 162 | "libbinder", |
Joey Poomarin | 5298998 | 2020-03-05 17:40:49 +0800 | [diff] [blame] | 163 | "libcutils", |
Andy Hung | 17dbaf2 | 2019-10-11 14:06:31 -0700 | [diff] [blame] | 164 | "liblog", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 165 | "libmedia_helper", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 166 | "libmediametrics", |
Andy Hung | a85efab | 2019-12-23 11:41:29 -0800 | [diff] [blame] | 167 | "libmediautils", |
Andy Hung | 9099a1a | 2020-04-04 14:23:36 -0700 | [diff] [blame] | 168 | "libmemunreachable", |
Andy Hung | 17dbaf2 | 2019-10-11 14:06:31 -0700 | [diff] [blame] | 169 | "libprotobuf-cpp-lite", |
Robert Shih | 2e15aed | 2021-03-16 18:30:35 -0700 | [diff] [blame] | 170 | "libstagefright_foundation", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 171 | "libstatslog", |
Robert Shih | 2e15aed | 2021-03-16 18:30:35 -0700 | [diff] [blame] | 172 | "libstatspull", |
| 173 | "libstatssocket", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 174 | "libutils", |
| 175 | ], |
| 176 | |
Robert Shih | 2e15aed | 2021-03-16 18:30:35 -0700 | [diff] [blame] | 177 | export_shared_lib_headers: [ |
| 178 | "libstatspull", |
| 179 | "libstatssocket", |
| 180 | ], |
| 181 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 182 | static_libs: [ |
| 183 | "libplatformprotos", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 184 | ], |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 185 | |
| 186 | include_dirs: [ |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 187 | "system/media/audio_utils/include", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 188 | ], |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 189 | } |