blob: c8b4969d285f220c62de5b26662335d312d196b6 [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: [
16 // "-Xep:AndroidFrameworkBinderIdentity:ERROR",
17 "-Xep:AndroidFrameworkCompatChange:ERROR",
18 // "-Xep:AndroidFrameworkUid:ERROR",
Michael Wright010aa302022-02-04 17:12:47 +000019 "-Xep:SelfEquals:ERROR",
Anton Hanssone3d44e82021-04-12 18:14:30 +010020 // NOTE: only enable to generate local patchfiles
21 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
22 // "-XepPatchLocation:/tmp/refaster/",
23 ],
24 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000025 lint: {
26 extra_check_modules: ["AndroidFrameworkLintChecker"],
27 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010028}
29
Jared Duke4514bdf2021-11-18 13:18:21 -080030// Opt-in config for optimizing and shrinking the services target using R8.
31// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
32// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
33// TODO(b/196084106): Enable optimizations by default after stabilizing and
34// building out retrace infrastructure.
35soong_config_module_type {
36 name: "system_optimized_java_defaults",
37 module_type: "java_defaults",
38 config_namespace: "ANDROID",
39 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
40 properties: ["optimize"],
41}
42
43system_optimized_java_defaults {
44 name: "services_java_defaults",
45 soong_config_variables: {
46 SYSTEM_OPTIMIZE_JAVA: {
47 optimize: {
48 enabled: true,
49 optimize: true,
50 shrink: true,
51 proguard_flags_files: ["proguard.flags"],
52 },
53 // Note: Optimizations are disabled by default if unspecified in
54 // the java_library rule.
55 conditions_default: {},
56 },
57 },
58}
59
Jiyong Parkbae2e902019-11-17 13:11:19 +090060filegroup {
61 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070062 srcs: [
63 "java/**/*.java",
64 "java/**/package.html",
65 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090066 path: "java",
67 visibility: ["//visibility:private"],
68}
69
70filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000071 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090072 srcs: [
73 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080074 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070075 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090076 ":services.accessibility-sources",
77 ":services.appprediction-sources",
78 ":services.appwidget-sources",
79 ":services.autofill-sources",
80 ":services.backup-sources",
Roopa Sattiraju1745d752022-01-17 11:13:02 -080081 ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready
Jiyong Parkabc72e42019-11-17 15:17:53 +090082 ":backuplib-sources",
Shashwat Razdanf898abc2022-01-21 16:39:46 -080083 ":services.cloudsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090084 ":services.companion-sources",
85 ":services.contentcapture-sources",
86 ":services.contentsuggestions-sources",
87 ":services.coverage-sources",
88 ":services.devicepolicy-sources",
89 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020090 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090091 ":services.net-sources",
92 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080093 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090094 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -080095 ":services.searchui-sources",
Joanne Chung41c4a0a2021-11-15 23:51:37 +080096 ":services.selectiontoolbar-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -080097 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +000098 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090099 ":services.startop.iorap-sources",
100 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800101 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000102 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900103 ":services.usage-sources",
104 ":services.usb-sources",
105 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000106 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800107 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000108 ],
109 visibility: ["//visibility:private"],
110}
111
Felipe Lemefec71a72021-04-01 23:32:53 -0700112java_library {
113 name: "Slogf",
114 srcs: ["core/java/com/android/server/utils/Slogf.java"],
115}
116
Colin Crosseb652a42017-12-05 09:46:29 -0800117// merge all required services into one jar
118// ============================================================
119java_library {
120 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800121 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700122 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800123
124 dex_preopt: {
125 app_image: true,
126 profile: "art-profile",
127 },
128
Jiyong Parkbae2e902019-11-17 13:11:19 +0900129 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800130
131 // The convention is to name each service module 'services.$(module_name)'
132 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800133 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800134 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800135 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800136 "services.appwidget",
137 "services.autofill",
138 "services.backup",
Shashwat Razdanf898abc2022-01-21 16:39:46 -0800139 "services.cloudsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800140 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800141 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800142 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800143 "services.coverage",
144 "services.devicepolicy",
145 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200146 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800147 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800148 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800149 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800150 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800151 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800152 "services.searchui",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800153 "services.selectiontoolbar",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800154 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000155 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800156 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400157 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800158 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000159 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800160 "services.usage",
161 "services.usb",
162 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000163 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800164 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700165 "service-blobstore",
166 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800167 "android.hidl.base-V1.0-java",
168 ],
169
170 libs: [
171 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100172 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800173 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800174 ],
175
176 // Uncomment to enable output of certain warnings (deprecated, unchecked)
177 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800178}
179
Colin Cross3a7d8992017-12-05 17:33:58 -0800180// native library
181// =============================================================
182
183cc_library_shared {
184 name: "libandroid_servers",
185 defaults: ["libservices.core-libs"],
186 whole_static_libs: ["libservices.core"],
markchieneaca9e92022-01-18 18:26:28 +0800187 required: [
188 // TODO: remove after NetworkStatsService is moved to the mainline module.
189 "libcom_android_net_module_util_jni",
190 ],
Colin Cross3a7d8992017-12-05 17:33:58 -0800191}
atrost86895aa2019-08-19 16:51:15 +0100192
193platform_compat_config {
194 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100195 src: ":services",
196}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000197
198filegroup {
199 name: "art-profile",
200 srcs: ["art-profile"],
201}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900202
203// API stub
204// =============================================================
205
Andrei Onea43114702021-02-10 20:53:12 +0000206stubs_defaults {
207 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900208 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800209 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900210 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000211 " --hide InternalClasses" + // com.android.* classes are okay in this interface
212 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900213 " --hide-package com.google.android.startop.iorap" +
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}