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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
package {
default_applicable_licenses: [
"frameworks_base_media_jni_soundpool_license",
],
}
// Added automatically by a large-scale-change
// See: http://go/android-license-faq
license {
name: "frameworks_base_media_jni_soundpool_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
],
license_text: [
"NOTICE",
],
}
tidy_errors = [
// https://clang.llvm.org/extra/clang-tidy/checks/list.html
// For many categories, the checks are too many to specify individually.
// Feel free to disable as needed - as warnings are generally ignored,
// we treat warnings as errors.
"android-*",
"bugprone-*",
"cert-*",
"clang-analyzer-security*",
"google-*",
"misc-*",
//"modernize-*", // explicitly list the modernize as they can be subjective.
"modernize-avoid-bind",
//"modernize-avoid-c-arrays", // std::array<> can be verbose
"modernize-concat-nested-namespaces",
//"modernize-deprecated-headers", // C headers still ok even if there is C++ equivalent.
"modernize-deprecated-ios-base-aliases",
"modernize-loop-convert",
"modernize-make-shared",
"modernize-make-unique",
"modernize-pass-by-value",
"modernize-raw-string-literal",
"modernize-redundant-void-arg",
"modernize-replace-auto-ptr",
"modernize-replace-random-shuffle",
"modernize-return-braced-init-list",
"modernize-shrink-to-fit",
"modernize-unary-static-assert",
"modernize-use-auto", // debatable - auto can obscure type
"modernize-use-bool-literals",
"modernize-use-default-member-init",
"modernize-use-emplace",
"modernize-use-equals-default",
"modernize-use-equals-delete",
"modernize-use-nodiscard",
"modernize-use-noexcept",
"modernize-use-nullptr",
"modernize-use-override",
//"modernize-use-trailing-return-type", // not necessarily more readable
"modernize-use-transparent-functors",
"modernize-use-uncaught-exceptions",
"modernize-use-using",
"performance-*",
// Remove some pedantic stylistic requirements.
"-google-readability-casting", // C++ casts not always necessary and may be verbose
"-google-readability-todo", // do not require TODO(info)
"-google-build-using-namespace", // Reenable and fix later.
]
cc_defaults {
name: "soundpool_flags_defaults",
// https://clang.llvm.org/docs/UsersManual.html#command-line-options
// https://clang.llvm.org/docs/DiagnosticsReference.html
cflags: [
"-Wall",
"-Wdeprecated",
"-Werror",
"-Werror=implicit-fallthrough",
"-Werror=sometimes-uninitialized",
//"-Werror=conditional-uninitialized",
"-Wextra",
"-Wredundant-decls",
"-Wshadow",
"-Wstrict-aliasing",
"-fstrict-aliasing",
"-Wthread-safety",
//"-Wthread-safety-negative", // experimental - looks broken in R.
"-Wunreachable-code",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
"-Wunused",
"-Wused-but-marked-unused",
],
// https://clang.llvm.org/extra/clang-tidy/
tidy: true,
tidy_checks: tidy_errors,
tidy_checks_as_errors: tidy_errors,
tidy_flags: [
"-format-style='file'",
"--header-filter='frameworks/base/media/jni/soundpool'",
],
}
cc_library_shared {
name: "libsoundpool",
defaults: [
"soundpool_flags_defaults",
],
srcs: [
"android_media_SoundPool.cpp",
"Sound.cpp",
"SoundDecoder.cpp",
"SoundManager.cpp",
"SoundPool.cpp",
"Stream.cpp",
"StreamManager.cpp",
],
header_libs: [
"libmedia_headers",
"libmediametrics_headers",
],
shared_libs: [
"libaudioutils",
"liblog",
"libcutils",
"libutils",
"libandroid_runtime",
"libnativehelper",
"libaudioclient",
"libmediandk",
"libbinder",
],
cflags: [
"-Wall",
"-Werror",
"-Wno-error=deprecated-declarations",
"-Wunused",
"-Wunreachable-code",
],
}
|