blob: 672b3450dc1b34549c6c74704a48004fc018318d [file] [log] [blame]
Bob Badour8a6a2bc2021-02-12 17:07:05 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_base_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_base_license"],
8}
9
Anton Hanssone3d44e82021-04-12 18:14:30 +010010// Defaults for platform code that runs inside system_server
11java_defaults {
12 name: "platform_service_defaults",
13 plugins: ["error_prone_android_framework"],
14 errorprone: {
15 javacflags: [
Anton Hanssone3d44e82021-04-12 18:14:30 +010016 "-Xep:AndroidFrameworkCompatChange:ERROR",
17 // "-Xep:AndroidFrameworkUid:ERROR",
Michael Wright010aa302022-02-04 17:12:47 +000018 "-Xep:SelfEquals:ERROR",
Michael Wright2e7197c2022-02-04 19:00:44 +000019 "-Xep:NullTernary:ERROR",
Michael Wright5c975952022-02-04 20:08:57 +000020 "-Xep:TryFailThrowable:ERROR",
Michael Wright400ea882022-02-04 20:45:04 +000021 "-Xep:HashtableContains:ERROR",
Michael Wrightc92adae2022-02-04 20:49:14 +000022 "-Xep:FormatString:ERROR",
Michael Wright16451b02022-02-04 20:59:26 +000023 "-Xep:ArrayHashCode:ERROR",
Michael Wright573d22a2022-02-04 21:02:33 +000024 "-Xep:SelfAssignment:ERROR",
Michael Wright3cc84d02022-02-04 21:05:45 +000025 "-Xep:ArrayEquals:ERROR",
Michael Wright684f5a52022-02-04 21:41:04 +000026 "-Xep:IdentityBinaryExpression:ERROR",
Anton Hanssone3d44e82021-04-12 18:14:30 +010027 // NOTE: only enable to generate local patchfiles
28 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
29 // "-XepPatchLocation:/tmp/refaster/",
30 ],
31 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000032 lint: {
33 extra_check_modules: ["AndroidFrameworkLintChecker"],
34 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010035}
36
Jared Duke4514bdf2021-11-18 13:18:21 -080037// Opt-in config for optimizing and shrinking the services target using R8.
38// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
39// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
40// TODO(b/196084106): Enable optimizations by default after stabilizing and
41// building out retrace infrastructure.
42soong_config_module_type {
43 name: "system_optimized_java_defaults",
44 module_type: "java_defaults",
45 config_namespace: "ANDROID",
46 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
47 properties: ["optimize"],
48}
49
50system_optimized_java_defaults {
51 name: "services_java_defaults",
52 soong_config_variables: {
53 SYSTEM_OPTIMIZE_JAVA: {
54 optimize: {
55 enabled: true,
Jared Dukeea03d102022-02-15 13:57:06 -080056 // TODO(b/210510433): Enable optimizations after improving
57 // retracing infra.
58 optimize: false,
Jared Duke4514bdf2021-11-18 13:18:21 -080059 shrink: true,
Jared Duke06689ad2022-09-07 12:24:36 -070060 ignore_warnings: false,
Jared Duke4514bdf2021-11-18 13:18:21 -080061 proguard_flags_files: ["proguard.flags"],
62 },
63 // Note: Optimizations are disabled by default if unspecified in
64 // the java_library rule.
65 conditions_default: {},
66 },
67 },
68}
69
Jiyong Parkbae2e902019-11-17 13:11:19 +090070filegroup {
71 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070072 srcs: [
73 "java/**/*.java",
74 "java/**/package.html",
75 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090076 path: "java",
77 visibility: ["//visibility:private"],
78}
79
80filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000081 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090082 srcs: [
83 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080084 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070085 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090086 ":services.accessibility-sources",
87 ":services.appprediction-sources",
88 ":services.appwidget-sources",
89 ":services.autofill-sources",
90 ":services.backup-sources",
Jiyong Parkabc72e42019-11-17 15:17:53 +090091 ":backuplib-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090092 ":services.companion-sources",
93 ":services.contentcapture-sources",
94 ":services.contentsuggestions-sources",
95 ":services.coverage-sources",
96 ":services.devicepolicy-sources",
97 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020098 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090099 ":services.net-sources",
100 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +0800101 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900102 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800103 ":services.searchui-sources",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800104 ":services.selectiontoolbar-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800105 ":services.smartspace-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900106 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800107 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000108 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900109 ":services.usage-sources",
110 ":services.usb-sources",
111 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000112 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800113 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000114 ],
115 visibility: ["//visibility:private"],
116}
117
Felipe Lemefec71a72021-04-01 23:32:53 -0700118java_library {
119 name: "Slogf",
120 srcs: ["core/java/com/android/server/utils/Slogf.java"],
121}
122
Colin Crosseb652a42017-12-05 09:46:29 -0800123// merge all required services into one jar
124// ============================================================
125java_library {
126 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800127 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700128 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800129
130 dex_preopt: {
131 app_image: true,
132 profile: "art-profile",
133 },
134
Jiyong Parkbae2e902019-11-17 13:11:19 +0900135 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800136
137 // The convention is to name each service module 'services.$(module_name)'
138 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800139 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800140 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800141 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800142 "services.appwidget",
143 "services.autofill",
144 "services.backup",
145 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800146 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800147 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800148 "services.coverage",
149 "services.devicepolicy",
150 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200151 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800152 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800153 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800154 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800155 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800156 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800157 "services.searchui",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800158 "services.selectiontoolbar",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800159 "services.smartspace",
Robert Berrye14120e2019-03-18 16:33:42 -0400160 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800161 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000162 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800163 "services.usage",
164 "services.usb",
165 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000166 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800167 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700168 "service-blobstore",
169 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800170 "android.hidl.base-V1.0-java",
171 ],
172
173 libs: [
174 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100175 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800176 "service-art.stubs.system_server",
Jared Duke06689ad2022-09-07 12:24:36 -0700177 "service-permission.stubs.system_server",
178 "service-sdksandbox.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800179 ],
180
181 // Uncomment to enable output of certain warnings (deprecated, unchecked)
182 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800183}
184
Colin Cross3a7d8992017-12-05 17:33:58 -0800185// native library
186// =============================================================
187
188cc_library_shared {
189 name: "libandroid_servers",
190 defaults: ["libservices.core-libs"],
191 whole_static_libs: ["libservices.core"],
192}
atrost86895aa2019-08-19 16:51:15 +0100193
194platform_compat_config {
195 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100196 src: ":services",
197}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000198
199filegroup {
200 name: "art-profile",
201 srcs: ["art-profile"],
202}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900203
204// API stub
205// =============================================================
206
Andrei Onea43114702021-02-10 20:53:12 +0000207stubs_defaults {
208 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900209 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800210 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900211 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000212 " --hide InternalClasses" + // com.android.* classes are okay in this interface
213 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900214 " --hide DeprecationMismatch" +
215 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000216 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700217 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000218}
219
220droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000221 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000222 srcs: [":services-non-updatable-sources"],
223 defaults: ["services-stubs-default"],
224 check_api: {
225 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000226 api_file: "api/current.txt",
227 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000228 },
229 api_lint: {
230 enabled: true,
231 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000232 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000233 },
234 },
235 dists: [
236 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000237 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000238 dir: "apistubs/android/system-server/api",
239 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700240 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000241 },
242 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000243 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000244 dir: "apistubs/android/system-server/api",
245 dest: "android-non-updatable-removed.txt",
246 tag: ".removed-api.txt",
247 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700248 ],
249}