blob: b0a5c66b53dd103d4ea61c58ddd7e15c10df0f40 [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 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000024 lint: {
25 extra_check_modules: ["AndroidFrameworkLintChecker"],
26 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010027}
28
Jared Duke4514bdf2021-11-18 13:18:21 -080029// Opt-in config for optimizing and shrinking the services target using R8.
30// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
31// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
32// TODO(b/196084106): Enable optimizations by default after stabilizing and
33// building out retrace infrastructure.
34soong_config_module_type {
35 name: "system_optimized_java_defaults",
36 module_type: "java_defaults",
37 config_namespace: "ANDROID",
38 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
39 properties: ["optimize"],
40}
41
42system_optimized_java_defaults {
43 name: "services_java_defaults",
44 soong_config_variables: {
45 SYSTEM_OPTIMIZE_JAVA: {
46 optimize: {
47 enabled: true,
48 optimize: true,
49 shrink: true,
50 proguard_flags_files: ["proguard.flags"],
51 },
52 // Note: Optimizations are disabled by default if unspecified in
53 // the java_library rule.
54 conditions_default: {},
55 },
56 },
57}
58
Jiyong Parkbae2e902019-11-17 13:11:19 +090059filegroup {
60 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070061 srcs: [
62 "java/**/*.java",
63 "java/**/package.html",
64 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090065 path: "java",
66 visibility: ["//visibility:private"],
67}
68
69filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000070 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090071 srcs: [
72 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080073 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070074 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090075 ":services.accessibility-sources",
76 ":services.appprediction-sources",
77 ":services.appwidget-sources",
78 ":services.autofill-sources",
79 ":services.backup-sources",
Roopa Sattiraju1745d752022-01-17 11:13:02 -080080 ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready
Jiyong Parkabc72e42019-11-17 15:17:53 +090081 ":backuplib-sources",
Shashwat Razdanf898abc2022-01-21 16:39:46 -080082 ":services.cloudsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090083 ":services.companion-sources",
84 ":services.contentcapture-sources",
85 ":services.contentsuggestions-sources",
86 ":services.coverage-sources",
87 ":services.devicepolicy-sources",
88 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020089 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090090 ":services.net-sources",
91 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080092 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090093 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -080094 ":services.searchui-sources",
Joanne Chung41c4a0a2021-11-15 23:51:37 +080095 ":services.selectiontoolbar-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -080096 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +000097 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090098 ":services.startop.iorap-sources",
99 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800100 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000101 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900102 ":services.usage-sources",
103 ":services.usb-sources",
104 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000105 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800106 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000107 ],
108 visibility: ["//visibility:private"],
109}
110
Felipe Lemefec71a72021-04-01 23:32:53 -0700111java_library {
112 name: "Slogf",
113 srcs: ["core/java/com/android/server/utils/Slogf.java"],
114}
115
Colin Crosseb652a42017-12-05 09:46:29 -0800116// merge all required services into one jar
117// ============================================================
118java_library {
119 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800120 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700121 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800122
123 dex_preopt: {
124 app_image: true,
125 profile: "art-profile",
126 },
127
Jiyong Parkbae2e902019-11-17 13:11:19 +0900128 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800129
130 // The convention is to name each service module 'services.$(module_name)'
131 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800132 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800133 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800134 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800135 "services.appwidget",
136 "services.autofill",
137 "services.backup",
Shashwat Razdanf898abc2022-01-21 16:39:46 -0800138 "services.cloudsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800139 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800140 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800141 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800142 "services.coverage",
143 "services.devicepolicy",
144 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200145 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800146 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800147 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800148 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800149 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800150 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800151 "services.searchui",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800152 "services.selectiontoolbar",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800153 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000154 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800155 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400156 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800157 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000158 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800159 "services.usage",
160 "services.usb",
161 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000162 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800163 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700164 "service-blobstore",
165 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800166 "android.hidl.base-V1.0-java",
167 ],
168
169 libs: [
170 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100171 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800172 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800173 ],
174
175 // Uncomment to enable output of certain warnings (deprecated, unchecked)
176 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800177}
178
Colin Cross3a7d8992017-12-05 17:33:58 -0800179// native library
180// =============================================================
181
182cc_library_shared {
183 name: "libandroid_servers",
184 defaults: ["libservices.core-libs"],
185 whole_static_libs: ["libservices.core"],
markchieneaca9e92022-01-18 18:26:28 +0800186 required: [
187 // TODO: remove after NetworkStatsService is moved to the mainline module.
188 "libcom_android_net_module_util_jni",
189 ],
Colin Cross3a7d8992017-12-05 17:33:58 -0800190}
atrost86895aa2019-08-19 16:51:15 +0100191
192platform_compat_config {
193 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100194 src: ":services",
195}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000196
197filegroup {
198 name: "art-profile",
199 srcs: ["art-profile"],
200}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900201
202// API stub
203// =============================================================
204
Andrei Onea43114702021-02-10 20:53:12 +0000205stubs_defaults {
206 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900207 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800208 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900209 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000210 " --hide InternalClasses" + // com.android.* classes are okay in this interface
211 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900212 " --hide-package com.google.android.startop.iorap" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900213 " --hide DeprecationMismatch" +
214 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000215 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700216 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000217}
218
219droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000220 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000221 srcs: [":services-non-updatable-sources"],
222 defaults: ["services-stubs-default"],
223 check_api: {
224 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000225 api_file: "api/current.txt",
226 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000227 },
228 api_lint: {
229 enabled: true,
230 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000231 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000232 },
233 },
234 dists: [
235 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000236 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000237 dir: "apistubs/android/system-server/api",
238 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700239 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000240 },
241 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000242 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000243 dir: "apistubs/android/system-server/api",
244 dest: "android-non-updatable-removed.txt",
245 tag: ".removed-api.txt",
246 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700247 ],
248}