blob: 536dc5d8ccd6e017353475b413d8770838b946a1 [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",
19 // NOTE: only enable to generate local patchfiles
20 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
21 // "-XepPatchLocation:/tmp/refaster/",
22 ],
23 },
24}
25
Jared Duke4514bdf2021-11-18 13:18:21 -080026// Opt-in config for optimizing and shrinking the services target using R8.
27// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
28// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
29// TODO(b/196084106): Enable optimizations by default after stabilizing and
30// building out retrace infrastructure.
31soong_config_module_type {
32 name: "system_optimized_java_defaults",
33 module_type: "java_defaults",
34 config_namespace: "ANDROID",
35 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
36 properties: ["optimize"],
37}
38
39system_optimized_java_defaults {
40 name: "services_java_defaults",
41 soong_config_variables: {
42 SYSTEM_OPTIMIZE_JAVA: {
43 optimize: {
44 enabled: true,
Jared Dukeea03d102022-02-15 13:57:06 -080045 // TODO(b/210510433): Enable optimizations after improving
46 // retracing infra.
47 optimize: false,
Jared Duke4514bdf2021-11-18 13:18:21 -080048 shrink: true,
49 proguard_flags_files: ["proguard.flags"],
50 },
51 // Note: Optimizations are disabled by default if unspecified in
52 // the java_library rule.
53 conditions_default: {},
54 },
55 },
56}
57
Jiyong Parkbae2e902019-11-17 13:11:19 +090058filegroup {
59 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070060 srcs: [
61 "java/**/*.java",
62 "java/**/package.html",
63 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090064 path: "java",
65 visibility: ["//visibility:private"],
66}
67
68filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000069 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090070 srcs: [
71 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080072 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070073 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090074 ":services.accessibility-sources",
75 ":services.appprediction-sources",
76 ":services.appwidget-sources",
77 ":services.autofill-sources",
78 ":services.backup-sources",
Roopa Sattiraju33a02ac2022-01-17 20:48:03 -080079 ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready
Jiyong Parkabc72e42019-11-17 15:17:53 +090080 ":backuplib-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090081 ":services.companion-sources",
82 ":services.contentcapture-sources",
83 ":services.contentsuggestions-sources",
84 ":services.coverage-sources",
85 ":services.devicepolicy-sources",
86 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020087 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090088 ":services.net-sources",
89 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080090 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090091 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -080092 ":services.searchui-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -080093 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +000094 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090095 ":services.startop.iorap-sources",
96 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -080097 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +000098 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090099 ":services.usage-sources",
100 ":services.usb-sources",
Roshan Pius27e1a872021-03-31 12:07:17 -0700101 ":services.uwb-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900102 ":services.voiceinteraction-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800103 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000104 ],
105 visibility: ["//visibility:private"],
106}
107
Felipe Lemefec71a72021-04-01 23:32:53 -0700108java_library {
109 name: "Slogf",
110 srcs: ["core/java/com/android/server/utils/Slogf.java"],
111}
112
Colin Crosseb652a42017-12-05 09:46:29 -0800113// merge all required services into one jar
114// ============================================================
115java_library {
116 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800117 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700118 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800119
120 dex_preopt: {
121 app_image: true,
122 profile: "art-profile",
123 },
124
Jiyong Parkbae2e902019-11-17 13:11:19 +0900125 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800126
127 // The convention is to name each service module 'services.$(module_name)'
128 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800129 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800130 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800131 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800132 "services.appwidget",
133 "services.autofill",
134 "services.backup",
135 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800136 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800137 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800138 "services.coverage",
139 "services.devicepolicy",
140 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200141 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800142 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800143 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800144 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800145 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800146 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800147 "services.searchui",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800148 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000149 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800150 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400151 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800152 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000153 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800154 "services.usage",
155 "services.usb",
Roshan Pius27e1a872021-03-31 12:07:17 -0700156 "services.uwb",
Colin Crosseb652a42017-12-05 09:46:29 -0800157 "services.voiceinteraction",
Roshan Piusea33fb92020-02-20 12:49:45 -0800158 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700159 "service-blobstore",
160 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800161 "android.hidl.base-V1.0-java",
162 ],
163
164 libs: [
165 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100166 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800167 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800168 ],
169
170 // Uncomment to enable output of certain warnings (deprecated, unchecked)
171 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800172}
173
Colin Cross3a7d8992017-12-05 17:33:58 -0800174// native library
175// =============================================================
176
177cc_library_shared {
178 name: "libandroid_servers",
179 defaults: ["libservices.core-libs"],
180 whole_static_libs: ["libservices.core"],
markchieneaca9e92022-01-18 18:26:28 +0800181 required: [
182 // TODO: remove after NetworkStatsService is moved to the mainline module.
183 "libcom_android_net_module_util_jni",
184 ],
Colin Cross3a7d8992017-12-05 17:33:58 -0800185}
atrost86895aa2019-08-19 16:51:15 +0100186
187platform_compat_config {
188 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100189 src: ":services",
190}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000191
192filegroup {
193 name: "art-profile",
194 srcs: ["art-profile"],
195}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900196
197// API stub
198// =============================================================
199
Andrei Onea43114702021-02-10 20:53:12 +0000200stubs_defaults {
201 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900202 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800203 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900204 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000205 " --hide InternalClasses" + // com.android.* classes are okay in this interface
206 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900207 " --hide-package com.google.android.startop.iorap" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900208 " --hide DeprecationMismatch" +
209 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000210 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700211 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000212}
213
214droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000215 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000216 srcs: [":services-non-updatable-sources"],
217 defaults: ["services-stubs-default"],
218 check_api: {
219 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000220 api_file: "api/current.txt",
221 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000222 },
223 api_lint: {
224 enabled: true,
225 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000226 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000227 },
228 },
229 dists: [
230 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000231 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000232 dir: "apistubs/android/system-server/api",
233 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700234 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000235 },
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-removed.txt",
240 tag: ".removed-api.txt",
241 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700242 ],
243}