blob: eb56c250e22405b09486e499fd56ae7484baae20 [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",
Michael Wright400ea882022-02-04 20:45:04 +000022 "-Xep:HashtableContains:ERROR",
Michael Wrightc92adae2022-02-04 20:49:14 +000023 "-Xep:FormatString:ERROR",
Michael Wright16451b02022-02-04 20:59:26 +000024 "-Xep:ArrayHashCode:ERROR",
Michael Wright573d22a2022-02-04 21:02:33 +000025 "-Xep:SelfAssignment:ERROR",
Michael Wright3cc84d02022-02-04 21:05:45 +000026 "-Xep:ArrayEquals:ERROR",
Michael Wright684f5a52022-02-04 21:41:04 +000027 "-Xep:IdentityBinaryExpression:ERROR",
Anton Hanssone3d44e82021-04-12 18:14:30 +010028 // NOTE: only enable to generate local patchfiles
29 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
30 // "-XepPatchLocation:/tmp/refaster/",
31 ],
32 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000033 lint: {
34 extra_check_modules: ["AndroidFrameworkLintChecker"],
35 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010036}
37
Jared Duke4514bdf2021-11-18 13:18:21 -080038// Opt-in config for optimizing and shrinking the services target using R8.
39// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
40// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
41// TODO(b/196084106): Enable optimizations by default after stabilizing and
42// building out retrace infrastructure.
43soong_config_module_type {
44 name: "system_optimized_java_defaults",
45 module_type: "java_defaults",
46 config_namespace: "ANDROID",
47 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
48 properties: ["optimize"],
49}
50
51system_optimized_java_defaults {
52 name: "services_java_defaults",
53 soong_config_variables: {
54 SYSTEM_OPTIMIZE_JAVA: {
55 optimize: {
56 enabled: true,
Jared Dukeea03d102022-02-15 13:57:06 -080057 // TODO(b/210510433): Enable optimizations after improving
58 // retracing infra.
59 optimize: false,
Jared Duke4514bdf2021-11-18 13:18:21 -080060 shrink: true,
Jared Duke06689ad2022-09-07 12:24:36 -070061 ignore_warnings: false,
Jared Duke6cf7fbd2023-05-19 20:21:36 +000062 proguard_flags_files: [
63 "proguard.flags",
64 // Ensure classes referenced in the framework-res manifest
65 // and implemented in system_server are kept.
66 ":framework-res{.aapt.proguardOptionsFile}",
67 ],
Jared Duke4514bdf2021-11-18 13:18:21 -080068 },
69 // Note: Optimizations are disabled by default if unspecified in
70 // the java_library rule.
71 conditions_default: {},
72 },
73 },
74}
75
Jiyong Parkbae2e902019-11-17 13:11:19 +090076filegroup {
77 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070078 srcs: [
79 "java/**/*.java",
80 "java/**/package.html",
81 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090082 path: "java",
83 visibility: ["//visibility:private"],
84}
85
86filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000087 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090088 srcs: [
89 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080090 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070091 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090092 ":services.accessibility-sources",
93 ":services.appprediction-sources",
94 ":services.appwidget-sources",
95 ":services.autofill-sources",
96 ":services.backup-sources",
Jiyong Parkabc72e42019-11-17 15:17:53 +090097 ":backuplib-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090098 ":services.companion-sources",
99 ":services.contentcapture-sources",
100 ":services.contentsuggestions-sources",
101 ":services.coverage-sources",
102 ":services.devicepolicy-sources",
103 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200104 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900105 ":services.net-sources",
106 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +0800107 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900108 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800109 ":services.searchui-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800110 ":services.smartspace-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900111 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800112 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000113 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900114 ":services.usage-sources",
115 ":services.usb-sources",
116 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000117 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800118 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000119 ],
120 visibility: ["//visibility:private"],
121}
122
Felipe Lemefec71a72021-04-01 23:32:53 -0700123java_library {
124 name: "Slogf",
125 srcs: ["core/java/com/android/server/utils/Slogf.java"],
126}
127
Colin Crosseb652a42017-12-05 09:46:29 -0800128// merge all required services into one jar
129// ============================================================
130java_library {
131 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800132 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700133 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800134
135 dex_preopt: {
136 app_image: true,
137 profile: "art-profile",
138 },
139
Jiyong Parkbae2e902019-11-17 13:11:19 +0900140 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800141
142 // The convention is to name each service module 'services.$(module_name)'
143 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800144 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800145 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800146 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800147 "services.appwidget",
148 "services.autofill",
149 "services.backup",
150 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800151 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800152 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800153 "services.coverage",
154 "services.devicepolicy",
155 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200156 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800157 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800158 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800159 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800160 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800161 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800162 "services.searchui",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800163 "services.smartspace",
Robert Berrye14120e2019-03-18 16:33:42 -0400164 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800165 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000166 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800167 "services.usage",
168 "services.usb",
169 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000170 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800171 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700172 "service-blobstore",
173 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800174 "android.hidl.base-V1.0-java",
175 ],
176
177 libs: [
178 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100179 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800180 "service-art.stubs.system_server",
Jared Duke06689ad2022-09-07 12:24:36 -0700181 "service-permission.stubs.system_server",
Seth Moore0277b662022-10-20 14:14:39 -0700182 "service-rkp.stubs.system_server",
Jared Duke06689ad2022-09-07 12:24:36 -0700183 "service-sdksandbox.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800184 ],
185
Brian Julianeba77a82023-02-01 14:13:45 +0000186 vintf_fragments: [
187 "manifest_services.xml",
188 ],
189
Colin Crosseb652a42017-12-05 09:46:29 -0800190 // Uncomment to enable output of certain warnings (deprecated, unchecked)
191 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800192}
193
Colin Cross3a7d8992017-12-05 17:33:58 -0800194// native library
195// =============================================================
196
197cc_library_shared {
198 name: "libandroid_servers",
199 defaults: ["libservices.core-libs"],
200 whole_static_libs: ["libservices.core"],
201}
atrost86895aa2019-08-19 16:51:15 +0100202
203platform_compat_config {
204 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100205 src: ":services",
206}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000207
208filegroup {
209 name: "art-profile",
210 srcs: ["art-profile"],
211}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900212
213// API stub
214// =============================================================
215
Andrei Onea43114702021-02-10 20:53:12 +0000216stubs_defaults {
217 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900218 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800219 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900220 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000221 " --hide InternalClasses" + // com.android.* classes are okay in this interface
222 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900223 " --hide DeprecationMismatch" +
224 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000225 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700226 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000227}
228
229droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000230 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000231 srcs: [":services-non-updatable-sources"],
232 defaults: ["services-stubs-default"],
233 check_api: {
234 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000235 api_file: "api/current.txt",
236 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000237 },
238 api_lint: {
239 enabled: true,
240 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000241 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000242 },
243 },
244 dists: [
245 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000246 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000247 dir: "apistubs/android/system-server/api",
248 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700249 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000250 },
251 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000252 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000253 dir: "apistubs/android/system-server/api",
254 dest: "android-non-updatable-removed.txt",
255 tag: ".removed-api.txt",
256 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700257 ],
258}