blob: 378ad540844f33243fbe6d6895dbc943694f95e6 [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",
Michael Wright2e7197c2022-02-04 19:00:44 +000020 "-Xep:NullTernary:ERROR",
Michael Wright5c975952022-02-04 20:08:57 +000021 "-Xep:TryFailThrowable:ERROR",
Anton Hanssone3d44e82021-04-12 18:14:30 +010022 // NOTE: only enable to generate local patchfiles
23 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
24 // "-XepPatchLocation:/tmp/refaster/",
25 ],
26 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000027 lint: {
28 extra_check_modules: ["AndroidFrameworkLintChecker"],
29 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010030}
31
Jared Duke4514bdf2021-11-18 13:18:21 -080032// Opt-in config for optimizing and shrinking the services target using R8.
33// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
34// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
35// TODO(b/196084106): Enable optimizations by default after stabilizing and
36// building out retrace infrastructure.
37soong_config_module_type {
38 name: "system_optimized_java_defaults",
39 module_type: "java_defaults",
40 config_namespace: "ANDROID",
41 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
42 properties: ["optimize"],
43}
44
45system_optimized_java_defaults {
46 name: "services_java_defaults",
47 soong_config_variables: {
48 SYSTEM_OPTIMIZE_JAVA: {
49 optimize: {
50 enabled: true,
51 optimize: true,
52 shrink: true,
53 proguard_flags_files: ["proguard.flags"],
54 },
55 // Note: Optimizations are disabled by default if unspecified in
56 // the java_library rule.
57 conditions_default: {},
58 },
59 },
60}
61
Jiyong Parkbae2e902019-11-17 13:11:19 +090062filegroup {
63 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070064 srcs: [
65 "java/**/*.java",
66 "java/**/package.html",
67 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090068 path: "java",
69 visibility: ["//visibility:private"],
70}
71
72filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000073 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090074 srcs: [
75 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080076 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070077 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090078 ":services.accessibility-sources",
79 ":services.appprediction-sources",
80 ":services.appwidget-sources",
81 ":services.autofill-sources",
82 ":services.backup-sources",
Roopa Sattiraju1745d752022-01-17 11:13:02 -080083 ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready
Jiyong Parkabc72e42019-11-17 15:17:53 +090084 ":backuplib-sources",
Shashwat Razdanf898abc2022-01-21 16:39:46 -080085 ":services.cloudsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090086 ":services.companion-sources",
87 ":services.contentcapture-sources",
88 ":services.contentsuggestions-sources",
89 ":services.coverage-sources",
90 ":services.devicepolicy-sources",
91 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020092 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090093 ":services.net-sources",
94 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080095 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090096 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -080097 ":services.searchui-sources",
Joanne Chung41c4a0a2021-11-15 23:51:37 +080098 ":services.selectiontoolbar-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -080099 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000100 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900101 ":services.startop.iorap-sources",
102 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800103 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000104 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900105 ":services.usage-sources",
106 ":services.usb-sources",
107 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000108 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800109 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000110 ],
111 visibility: ["//visibility:private"],
112}
113
Felipe Lemefec71a72021-04-01 23:32:53 -0700114java_library {
115 name: "Slogf",
116 srcs: ["core/java/com/android/server/utils/Slogf.java"],
117}
118
Colin Crosseb652a42017-12-05 09:46:29 -0800119// merge all required services into one jar
120// ============================================================
121java_library {
122 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800123 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700124 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800125
126 dex_preopt: {
127 app_image: true,
128 profile: "art-profile",
129 },
130
Jiyong Parkbae2e902019-11-17 13:11:19 +0900131 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800132
133 // The convention is to name each service module 'services.$(module_name)'
134 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800135 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800136 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800137 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800138 "services.appwidget",
139 "services.autofill",
140 "services.backup",
Shashwat Razdanf898abc2022-01-21 16:39:46 -0800141 "services.cloudsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800142 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800143 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800144 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800145 "services.coverage",
146 "services.devicepolicy",
147 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200148 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800149 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800150 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800151 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800152 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800153 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800154 "services.searchui",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800155 "services.selectiontoolbar",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800156 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000157 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800158 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400159 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800160 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000161 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800162 "services.usage",
163 "services.usb",
164 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000165 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800166 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700167 "service-blobstore",
168 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800169 "android.hidl.base-V1.0-java",
170 ],
171
172 libs: [
173 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100174 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800175 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800176 ],
177
178 // Uncomment to enable output of certain warnings (deprecated, unchecked)
179 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800180}
181
Colin Cross3a7d8992017-12-05 17:33:58 -0800182// native library
183// =============================================================
184
185cc_library_shared {
186 name: "libandroid_servers",
187 defaults: ["libservices.core-libs"],
188 whole_static_libs: ["libservices.core"],
markchieneaca9e92022-01-18 18:26:28 +0800189 required: [
190 // TODO: remove after NetworkStatsService is moved to the mainline module.
191 "libcom_android_net_module_util_jni",
192 ],
Colin Cross3a7d8992017-12-05 17:33:58 -0800193}
atrost86895aa2019-08-19 16:51:15 +0100194
195platform_compat_config {
196 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100197 src: ":services",
198}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000199
200filegroup {
201 name: "art-profile",
202 srcs: ["art-profile"],
203}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900204
205// API stub
206// =============================================================
207
Andrei Onea43114702021-02-10 20:53:12 +0000208stubs_defaults {
209 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900210 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800211 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900212 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000213 " --hide InternalClasses" + // com.android.* classes are okay in this interface
214 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900215 " --hide-package com.google.android.startop.iorap" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900216 " --hide DeprecationMismatch" +
217 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000218 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700219 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000220}
221
222droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000223 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000224 srcs: [":services-non-updatable-sources"],
225 defaults: ["services-stubs-default"],
226 check_api: {
227 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000228 api_file: "api/current.txt",
229 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000230 },
231 api_lint: {
232 enabled: true,
233 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000234 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000235 },
236 },
237 dists: [
238 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000239 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000240 dir: "apistubs/android/system-server/api",
241 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700242 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000243 },
244 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000245 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000246 dir: "apistubs/android/system-server/api",
247 dest: "android-non-updatable-removed.txt",
248 tag: ".removed-api.txt",
249 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700250 ],
251}