blob: b40034abb1728d5f6370448269909a193a59f6a5 [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",
Anton Hanssone3d44e82021-04-12 18:14:30 +010024 // NOTE: only enable to generate local patchfiles
25 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
26 // "-XepPatchLocation:/tmp/refaster/",
27 ],
28 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000029 lint: {
30 extra_check_modules: ["AndroidFrameworkLintChecker"],
31 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010032}
33
Jared Duke4514bdf2021-11-18 13:18:21 -080034// Opt-in config for optimizing and shrinking the services target using R8.
35// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
36// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
37// TODO(b/196084106): Enable optimizations by default after stabilizing and
38// building out retrace infrastructure.
39soong_config_module_type {
40 name: "system_optimized_java_defaults",
41 module_type: "java_defaults",
42 config_namespace: "ANDROID",
43 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
44 properties: ["optimize"],
45}
46
47system_optimized_java_defaults {
48 name: "services_java_defaults",
49 soong_config_variables: {
50 SYSTEM_OPTIMIZE_JAVA: {
51 optimize: {
52 enabled: true,
53 optimize: true,
54 shrink: true,
55 proguard_flags_files: ["proguard.flags"],
56 },
57 // Note: Optimizations are disabled by default if unspecified in
58 // the java_library rule.
59 conditions_default: {},
60 },
61 },
62}
63
Jiyong Parkbae2e902019-11-17 13:11:19 +090064filegroup {
65 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070066 srcs: [
67 "java/**/*.java",
68 "java/**/package.html",
69 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090070 path: "java",
71 visibility: ["//visibility:private"],
72}
73
74filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000075 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090076 srcs: [
77 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080078 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070079 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090080 ":services.accessibility-sources",
81 ":services.appprediction-sources",
82 ":services.appwidget-sources",
83 ":services.autofill-sources",
84 ":services.backup-sources",
Roopa Sattiraju1745d752022-01-17 11:13:02 -080085 ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready
Jiyong Parkabc72e42019-11-17 15:17:53 +090086 ":backuplib-sources",
Shashwat Razdanf898abc2022-01-21 16:39:46 -080087 ":services.cloudsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090088 ":services.companion-sources",
89 ":services.contentcapture-sources",
90 ":services.contentsuggestions-sources",
91 ":services.coverage-sources",
92 ":services.devicepolicy-sources",
93 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020094 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090095 ":services.net-sources",
96 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080097 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090098 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -080099 ":services.searchui-sources",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800100 ":services.selectiontoolbar-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800101 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000102 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900103 ":services.startop.iorap-sources",
104 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800105 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000106 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900107 ":services.usage-sources",
108 ":services.usb-sources",
109 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000110 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800111 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000112 ],
113 visibility: ["//visibility:private"],
114}
115
Felipe Lemefec71a72021-04-01 23:32:53 -0700116java_library {
117 name: "Slogf",
118 srcs: ["core/java/com/android/server/utils/Slogf.java"],
119}
120
Colin Crosseb652a42017-12-05 09:46:29 -0800121// merge all required services into one jar
122// ============================================================
123java_library {
124 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800125 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700126 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800127
128 dex_preopt: {
129 app_image: true,
130 profile: "art-profile",
131 },
132
Jiyong Parkbae2e902019-11-17 13:11:19 +0900133 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800134
135 // The convention is to name each service module 'services.$(module_name)'
136 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800137 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800138 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800139 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800140 "services.appwidget",
141 "services.autofill",
142 "services.backup",
Shashwat Razdanf898abc2022-01-21 16:39:46 -0800143 "services.cloudsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800144 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800145 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800146 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800147 "services.coverage",
148 "services.devicepolicy",
149 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200150 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800151 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800152 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800153 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800154 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800155 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800156 "services.searchui",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800157 "services.selectiontoolbar",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800158 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000159 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800160 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400161 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800162 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000163 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800164 "services.usage",
165 "services.usb",
166 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000167 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800168 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700169 "service-blobstore",
170 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800171 "android.hidl.base-V1.0-java",
172 ],
173
174 libs: [
175 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100176 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800177 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800178 ],
179
180 // Uncomment to enable output of certain warnings (deprecated, unchecked)
181 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800182}
183
Colin Cross3a7d8992017-12-05 17:33:58 -0800184// native library
185// =============================================================
186
187cc_library_shared {
188 name: "libandroid_servers",
189 defaults: ["libservices.core-libs"],
190 whole_static_libs: ["libservices.core"],
markchieneaca9e92022-01-18 18:26:28 +0800191 required: [
192 // TODO: remove after NetworkStatsService is moved to the mainline module.
193 "libcom_android_net_module_util_jni",
194 ],
Colin Cross3a7d8992017-12-05 17:33:58 -0800195}
atrost86895aa2019-08-19 16:51:15 +0100196
197platform_compat_config {
198 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100199 src: ":services",
200}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000201
202filegroup {
203 name: "art-profile",
204 srcs: ["art-profile"],
205}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900206
207// API stub
208// =============================================================
209
Andrei Onea43114702021-02-10 20:53:12 +0000210stubs_defaults {
211 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900212 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800213 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900214 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000215 " --hide InternalClasses" + // com.android.* classes are okay in this interface
216 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900217 " --hide-package com.google.android.startop.iorap" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900218 " --hide DeprecationMismatch" +
219 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000220 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700221 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000222}
223
224droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000225 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000226 srcs: [":services-non-updatable-sources"],
227 defaults: ["services-stubs-default"],
228 check_api: {
229 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000230 api_file: "api/current.txt",
231 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000232 },
233 api_lint: {
234 enabled: true,
235 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000236 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000237 },
238 },
239 dists: [
240 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000241 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000242 dir: "apistubs/android/system-server/api",
243 dest: "android-non-updatable.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700244 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000245 },
246 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000247 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000248 dir: "apistubs/android/system-server/api",
249 dest: "android-non-updatable-removed.txt",
250 tag: ".removed-api.txt",
251 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700252 ],
253}