blob: e11b0442377eb6deabc749bb62d02f5eb7b6e5da [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,
45 optimize: true,
46 shrink: true,
47 proguard_flags_files: ["proguard.flags"],
48 },
49 // Note: Optimizations are disabled by default if unspecified in
50 // the java_library rule.
51 conditions_default: {},
52 },
53 },
54}
55
Jiyong Parkbae2e902019-11-17 13:11:19 +090056filegroup {
57 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070058 srcs: [
59 "java/**/*.java",
60 "java/**/package.html",
61 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090062 path: "java",
63 visibility: ["//visibility:private"],
64}
65
66filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000067 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090068 srcs: [
69 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080070 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070071 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090072 ":services.accessibility-sources",
73 ":services.appprediction-sources",
74 ":services.appwidget-sources",
75 ":services.autofill-sources",
76 ":services.backup-sources",
Jiyong Parkabc72e42019-11-17 15:17:53 +090077 ":backuplib-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090078 ":services.companion-sources",
79 ":services.contentcapture-sources",
80 ":services.contentsuggestions-sources",
81 ":services.coverage-sources",
82 ":services.devicepolicy-sources",
83 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020084 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090085 ":services.net-sources",
86 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080087 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090088 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -080089 ":services.searchui-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -080090 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +000091 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090092 ":services.startop.iorap-sources",
93 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -080094 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +000095 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090096 ":services.usage-sources",
97 ":services.usb-sources",
Roshan Pius27e1a872021-03-31 12:07:17 -070098 ":services.uwb-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090099 ":services.voiceinteraction-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800100 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000101 ],
102 visibility: ["//visibility:private"],
103}
104
Felipe Lemefec71a72021-04-01 23:32:53 -0700105java_library {
106 name: "Slogf",
107 srcs: ["core/java/com/android/server/utils/Slogf.java"],
108}
109
Colin Crosseb652a42017-12-05 09:46:29 -0800110// merge all required services into one jar
111// ============================================================
112java_library {
113 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800114 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700115 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800116
117 dex_preopt: {
118 app_image: true,
119 profile: "art-profile",
120 },
121
Jiyong Parkbae2e902019-11-17 13:11:19 +0900122 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800123
124 // The convention is to name each service module 'services.$(module_name)'
125 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800126 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800127 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800128 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800129 "services.appwidget",
130 "services.autofill",
131 "services.backup",
132 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800133 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800134 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800135 "services.coverage",
136 "services.devicepolicy",
137 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200138 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800139 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800140 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800141 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800142 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800143 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800144 "services.searchui",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800145 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000146 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800147 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400148 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800149 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000150 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800151 "services.usage",
152 "services.usb",
Roshan Pius27e1a872021-03-31 12:07:17 -0700153 "services.uwb",
Colin Crosseb652a42017-12-05 09:46:29 -0800154 "services.voiceinteraction",
Roshan Piusea33fb92020-02-20 12:49:45 -0800155 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700156 "service-blobstore",
157 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800158 "android.hidl.base-V1.0-java",
159 ],
160
161 libs: [
162 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100163 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800164 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800165 ],
166
167 // Uncomment to enable output of certain warnings (deprecated, unchecked)
168 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800169}
170
Colin Cross3a7d8992017-12-05 17:33:58 -0800171// native library
172// =============================================================
173
174cc_library_shared {
175 name: "libandroid_servers",
176 defaults: ["libservices.core-libs"],
177 whole_static_libs: ["libservices.core"],
178}
atrost86895aa2019-08-19 16:51:15 +0100179
180platform_compat_config {
181 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100182 src: ":services",
183}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000184
185filegroup {
186 name: "art-profile",
187 srcs: ["art-profile"],
188}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900189
190// API stub
191// =============================================================
192
Andrei Onea43114702021-02-10 20:53:12 +0000193stubs_defaults {
194 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900195 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800196 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900197 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000198 " --hide InternalClasses" + // com.android.* classes are okay in this interface
199 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900200 " --hide-package com.google.android.startop.iorap" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900201 " --hide DeprecationMismatch" +
202 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000203 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700204 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000205}
206
207droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000208 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000209 srcs: [":services-non-updatable-sources"],
210 defaults: ["services-stubs-default"],
211 check_api: {
212 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000213 api_file: "api/current.txt",
214 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000215 },
216 api_lint: {
217 enabled: true,
218 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000219 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000220 },
221 },
222 dists: [
223 {
Felipe Lemed3895b62021-03-24 16:55:27 -0700224 targets: [
225 "sdk",
226 "win_sdk",
227 ],
Andrei Onea43114702021-02-10 20:53:12 +0000228 dir: "apistubs/android/system-server/api",
229 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700230 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000231 },
232 {
Felipe Lemed3895b62021-03-24 16:55:27 -0700233 targets: [
234 "sdk",
235 "win_sdk",
236 ],
Andrei Onea43114702021-02-10 20:53:12 +0000237 dir: "apistubs/android/system-server/api",
238 dest: "android-non-updatable-removed.txt",
239 tag: ".removed-api.txt",
240 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700241 ],
242}