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 |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 64 | ] |
| 65 | |
| 66 | cc_defaults { |
| 67 | name: "mediametrics_flags_defaults", |
| 68 | // https://clang.llvm.org/docs/UsersManual.html#command-line-options |
| 69 | // https://clang.llvm.org/docs/DiagnosticsReference.html |
| 70 | cflags: [ |
| 71 | "-Wall", |
| 72 | "-Wdeprecated", |
| 73 | "-Werror", |
| 74 | "-Werror=implicit-fallthrough", |
| 75 | "-Werror=sometimes-uninitialized", |
| 76 | "-Werror=conditional-uninitialized", |
| 77 | "-Wextra", |
| 78 | "-Wredundant-decls", |
Hangyu Kuang | 6606267 | 2020-12-03 19:30:25 +0000 | [diff] [blame] | 79 | "-Wshadow", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 80 | "-Wstrict-aliasing", |
| 81 | "-fstrict-aliasing", |
| 82 | "-Wthread-safety", |
| 83 | //"-Wthread-safety-negative", // experimental - looks broken in R. |
| 84 | "-Wunreachable-code", |
| 85 | "-Wunreachable-code-break", |
| 86 | "-Wunreachable-code-return", |
| 87 | "-Wunused", |
| 88 | "-Wused-but-marked-unused", |
| 89 | ], |
| 90 | // https://clang.llvm.org/extra/clang-tidy/ |
| 91 | tidy: true, |
| 92 | tidy_checks: tidy_errors, |
| 93 | tidy_checks_as_errors: tidy_errors, |
| 94 | tidy_flags: [ |
Chih-Hung Hsieh | 492141a | 2021-02-21 18:17:49 -0800 | [diff] [blame] | 95 | "-format-style=file", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 96 | ], |
| 97 | } |
| 98 | |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 99 | cc_binary { |
| 100 | name: "mediametrics", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 101 | defaults: [ |
| 102 | "mediametrics_flags_defaults", |
| 103 | ], |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 104 | |
| 105 | srcs: [ |
| 106 | "main_mediametrics.cpp", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 107 | ], |
| 108 | |
| 109 | shared_libs: [ |
| 110 | "libbinder", |
| 111 | "liblog", |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 112 | "libmediametricsservice", |
Andy Hung | a85efab | 2019-12-23 11:41:29 -0800 | [diff] [blame] | 113 | "libmediautils", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 114 | "libutils", |
Jeongik Cha | a01ed78 | 2021-02-11 09:50:00 +0900 | [diff] [blame] | 115 | "mediametricsservice-aidl-cpp", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 116 | ], |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 117 | header_libs: [ |
Andy Hung | a629bd1 | 2020-06-05 16:03:53 -0700 | [diff] [blame] | 118 | "libaudioutils_headers", |
Marco Nelissen | 7c96ea7 | 2020-01-10 15:46:22 -0800 | [diff] [blame] | 119 | "libmediametrics_headers", |
| 120 | ], |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 121 | |
| 122 | init_rc: [ |
| 123 | "mediametrics.rc", |
| 124 | ], |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Mufaddal Chakera | 1d5f7ed | 2020-10-13 14:09:26 +0530 | [diff] [blame] | 127 | cc_library { |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 128 | name: "libmediametricsservice", |
Andy Hung | 3ab1b32 | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 129 | defaults: [ |
| 130 | "mediametrics_flags_defaults", |
| 131 | ], |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 132 | |
| 133 | srcs: [ |
Andy Hung | 06f3aba | 2019-12-03 16:36:42 -0800 | [diff] [blame] | 134 | "AudioAnalytics.cpp", |
Joey Poomarin | 5298998 | 2020-03-05 17:40:49 +0800 | [diff] [blame] | 135 | "AudioPowerUsage.cpp", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 136 | "AudioTypes.cpp", |
Ray Essick | 5a55729 | 2020-06-10 21:31:33 -0700 | [diff] [blame] | 137 | "cleaner.cpp", |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 138 | "iface_statsd.cpp", |
Ray Essick | 40e8e5e | 2019-12-05 20:19:40 -0800 | [diff] [blame] | 139 | "MediaMetricsService.cpp", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 140 | "statsd_audiopolicy.cpp", |
| 141 | "statsd_audiorecord.cpp", |
| 142 | "statsd_audiothread.cpp", |
| 143 | "statsd_audiotrack.cpp", |
| 144 | "statsd_codec.cpp", |
| 145 | "statsd_drm.cpp", |
| 146 | "statsd_extractor.cpp", |
Santiago Seifert | 149f058 | 2020-08-11 17:58:41 +0100 | [diff] [blame] | 147 | "statsd_mediaparser.cpp", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 148 | "statsd_nuplayer.cpp", |
| 149 | "statsd_recorder.cpp", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 150 | "StringUtils.cpp" |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 151 | ], |
| 152 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 153 | proto: { |
| 154 | type: "lite", |
| 155 | }, |
| 156 | |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 157 | shared_libs: [ |
Jeongik Cha | a01ed78 | 2021-02-11 09:50:00 +0900 | [diff] [blame] | 158 | "mediametricsservice-aidl-cpp", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 159 | "libbase", // android logging |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 160 | "libbinder", |
Joey Poomarin | 5298998 | 2020-03-05 17:40:49 +0800 | [diff] [blame] | 161 | "libcutils", |
Andy Hung | 17dbaf2 | 2019-10-11 14:06:31 -0700 | [diff] [blame] | 162 | "liblog", |
Andy Hung | 1ea842e | 2020-05-18 10:47:31 -0700 | [diff] [blame] | 163 | "libmedia_helper", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 164 | "libmediametrics", |
Andy Hung | a85efab | 2019-12-23 11:41:29 -0800 | [diff] [blame] | 165 | "libmediautils", |
Andy Hung | 9099a1a | 2020-04-04 14:23:36 -0700 | [diff] [blame] | 166 | "libmemunreachable", |
Andy Hung | 17dbaf2 | 2019-10-11 14:06:31 -0700 | [diff] [blame] | 167 | "libprotobuf-cpp-lite", |
Robert Shih | 2e15aed | 2021-03-16 18:30:35 -0700 | [diff] [blame^] | 168 | "libstagefright_foundation", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 169 | "libstatslog", |
Robert Shih | 2e15aed | 2021-03-16 18:30:35 -0700 | [diff] [blame^] | 170 | "libstatspull", |
| 171 | "libstatssocket", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 172 | "libutils", |
| 173 | ], |
| 174 | |
Robert Shih | 2e15aed | 2021-03-16 18:30:35 -0700 | [diff] [blame^] | 175 | export_shared_lib_headers: [ |
| 176 | "libstatspull", |
| 177 | "libstatssocket", |
| 178 | ], |
| 179 | |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 180 | static_libs: [ |
| 181 | "libplatformprotos", |
Ray Essick | 6ce27e5 | 2019-02-15 10:58:05 -0800 | [diff] [blame] | 182 | ], |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 183 | |
| 184 | include_dirs: [ |
Andy Hung | c89c8dc | 2019-10-16 17:48:21 -0700 | [diff] [blame] | 185 | "system/media/audio_utils/include", |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 186 | ], |
Anton Hansson | 33de46e | 2019-02-01 11:17:57 +0000 | [diff] [blame] | 187 | } |