blob: db233e57c9445f6778753d3ef0c5bea078691781 [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",
Anton Hanssone3d44e82021-04-12 18:14:30 +010025 // NOTE: only enable to generate local patchfiles
26 // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
27 // "-XepPatchLocation:/tmp/refaster/",
28 ],
29 },
Azhara Assanovaa131ad92021-06-11 09:53:48 +000030 lint: {
31 extra_check_modules: ["AndroidFrameworkLintChecker"],
32 },
Anton Hanssone3d44e82021-04-12 18:14:30 +010033}
34
Jared Duke4514bdf2021-11-18 13:18:21 -080035// Opt-in config for optimizing and shrinking the services target using R8.
36// Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the
37// `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable.
38// TODO(b/196084106): Enable optimizations by default after stabilizing and
39// building out retrace infrastructure.
40soong_config_module_type {
41 name: "system_optimized_java_defaults",
42 module_type: "java_defaults",
43 config_namespace: "ANDROID",
44 bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
45 properties: ["optimize"],
46}
47
48system_optimized_java_defaults {
49 name: "services_java_defaults",
50 soong_config_variables: {
51 SYSTEM_OPTIMIZE_JAVA: {
52 optimize: {
53 enabled: true,
54 optimize: true,
55 shrink: true,
56 proguard_flags_files: ["proguard.flags"],
57 },
58 // Note: Optimizations are disabled by default if unspecified in
59 // the java_library rule.
60 conditions_default: {},
61 },
62 },
63}
64
Jiyong Parkbae2e902019-11-17 13:11:19 +090065filegroup {
66 name: "services-main-sources",
Colin Cross33b78ef2021-03-26 10:31:25 -070067 srcs: [
68 "java/**/*.java",
69 "java/**/package.html",
70 ],
Jiyong Parkbae2e902019-11-17 13:11:19 +090071 path: "java",
72 visibility: ["//visibility:private"],
73}
74
75filegroup {
Andrei Onea43114702021-02-10 20:53:12 +000076 name: "services-non-updatable-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090077 srcs: [
78 ":services.core-sources",
Hongwei Wangcdcb68d2020-11-23 12:48:05 -080079 ":services.core-sources-am-wm",
Colin Cross33b78ef2021-03-26 10:31:25 -070080 "core/java/com/android/server/am/package.html",
Jiyong Parkbae2e902019-11-17 13:11:19 +090081 ":services.accessibility-sources",
82 ":services.appprediction-sources",
83 ":services.appwidget-sources",
84 ":services.autofill-sources",
85 ":services.backup-sources",
Roopa Sattiraju1745d752022-01-17 11:13:02 -080086 ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready
Jiyong Parkabc72e42019-11-17 15:17:53 +090087 ":backuplib-sources",
Shashwat Razdanf898abc2022-01-21 16:39:46 -080088 ":services.cloudsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090089 ":services.companion-sources",
90 ":services.contentcapture-sources",
91 ":services.contentsuggestions-sources",
92 ":services.coverage-sources",
93 ":services.devicepolicy-sources",
94 ":services.midi-sources",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +020095 ":services.musicsearch-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090096 ":services.net-sources",
97 ":services.print-sources",
Yi Kong86f85932020-06-29 20:03:55 +080098 ":services.profcollect-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +090099 ":services.restrictions-sources",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800100 ":services.searchui-sources",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800101 ":services.selectiontoolbar-sources",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800102 ":services.smartspace-sources",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000103 ":services.speech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900104 ":services.startop.iorap-sources",
105 ":services.systemcaptions-sources",
Adam He2653f232020-11-30 18:23:20 -0800106 ":services.translation-sources",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000107 ":services.texttospeech-sources",
Jiyong Parkbae2e902019-11-17 13:11:19 +0900108 ":services.usage-sources",
109 ":services.usb-sources",
110 ":services.voiceinteraction-sources",
Sharon Sua5afd372022-02-01 22:09:36 +0000111 ":services.wallpapereffectsgeneration-sources",
Roshan Piusea33fb92020-02-20 12:49:45 -0800112 ":services.wifi-sources",
Andrei Onea43114702021-02-10 20:53:12 +0000113 ],
114 visibility: ["//visibility:private"],
115}
116
Felipe Lemefec71a72021-04-01 23:32:53 -0700117java_library {
118 name: "Slogf",
119 srcs: ["core/java/com/android/server/utils/Slogf.java"],
120}
121
Colin Crosseb652a42017-12-05 09:46:29 -0800122// merge all required services into one jar
123// ============================================================
124java_library {
125 name: "services",
Jared Duke4514bdf2021-11-18 13:18:21 -0800126 defaults: ["services_java_defaults"],
Colin Crossa12c0f52018-06-27 11:00:11 -0700127 installable: true,
Colin Crosseb652a42017-12-05 09:46:29 -0800128
129 dex_preopt: {
130 app_image: true,
131 profile: "art-profile",
132 },
133
Jiyong Parkbae2e902019-11-17 13:11:19 +0900134 srcs: [":services-main-sources"],
Colin Crosseb652a42017-12-05 09:46:29 -0800135
136 // The convention is to name each service module 'services.$(module_name)'
137 static_libs: [
Colin Cross4c0b06b2017-12-12 19:43:04 -0800138 "services.core",
Colin Crosseb652a42017-12-05 09:46:29 -0800139 "services.accessibility",
Sunny Goyal54e91342018-11-14 11:59:02 -0800140 "services.appprediction",
Colin Crosseb652a42017-12-05 09:46:29 -0800141 "services.appwidget",
142 "services.autofill",
143 "services.backup",
Shashwat Razdanf898abc2022-01-21 16:39:46 -0800144 "services.cloudsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800145 "services.companion",
Felipe Leme749b8892018-12-03 16:30:30 -0800146 "services.contentcapture",
Winson Chung3fb0f252019-01-08 17:41:55 -0800147 "services.contentsuggestions",
Colin Crosseb652a42017-12-05 09:46:29 -0800148 "services.coverage",
149 "services.devicepolicy",
150 "services.midi",
Nick Moukhinecf47bdd2020-08-19 16:29:18 +0200151 "services.musicsearch",
Colin Crosseb652a42017-12-05 09:46:29 -0800152 "services.net",
Danning Chen20b32ed2019-12-18 16:52:03 -0800153 "services.people",
Colin Crosseb652a42017-12-05 09:46:29 -0800154 "services.print",
Yi Kong86f85932020-06-29 20:03:55 +0800155 "services.profcollect",
Colin Crosseb652a42017-12-05 09:46:29 -0800156 "services.restrictions",
Hyunyoung Song21e60a92020-11-20 20:27:54 -0800157 "services.searchui",
Joanne Chung41c4a0a2021-11-15 23:51:37 +0800158 "services.selectiontoolbar",
Shashwat Razdand33e8c32021-01-29 13:02:19 -0800159 "services.smartspace",
Eugenio Marchioric3c0a1e2020-12-23 10:44:55 +0000160 "services.speech",
Igor Murashkin4de1e162018-11-26 10:33:17 -0800161 "services.startop",
Robert Berrye14120e2019-03-18 16:33:42 -0400162 "services.systemcaptions",
Adam He2653f232020-11-30 18:23:20 -0800163 "services.translation",
Alex Agranovich50c987f2021-02-18 09:19:33 +0000164 "services.texttospeech",
Colin Crosseb652a42017-12-05 09:46:29 -0800165 "services.usage",
166 "services.usb",
167 "services.voiceinteraction",
Sharon Sua5afd372022-02-01 22:09:36 +0000168 "services.wallpapereffectsgeneration",
Roshan Piusea33fb92020-02-20 12:49:45 -0800169 "services.wifi",
Dmitri Plotnikov4eaac3a2020-05-04 17:00:16 -0700170 "service-blobstore",
171 "service-jobscheduler",
Colin Crosseb652a42017-12-05 09:46:29 -0800172 "android.hidl.base-V1.0-java",
173 ],
174
175 libs: [
176 "android.hidl.manager-V1.0-java",
Paul Duffinabebc6a2020-05-31 11:35:50 +0100177 "framework-tethering.stubs.module_lib",
Chris Wailes09724a72021-02-08 10:00:13 -0800178 "service-art.stubs.system_server",
Colin Crosseb652a42017-12-05 09:46:29 -0800179 ],
180
181 // Uncomment to enable output of certain warnings (deprecated, unchecked)
182 //javacflags: ["-Xlint"],
Colin Crosseb652a42017-12-05 09:46:29 -0800183}
184
Colin Cross3a7d8992017-12-05 17:33:58 -0800185// native library
186// =============================================================
187
188cc_library_shared {
189 name: "libandroid_servers",
190 defaults: ["libservices.core-libs"],
191 whole_static_libs: ["libservices.core"],
markchieneaca9e92022-01-18 18:26:28 +0800192 required: [
193 // TODO: remove after NetworkStatsService is moved to the mainline module.
194 "libcom_android_net_module_util_jni",
195 ],
Colin Cross3a7d8992017-12-05 17:33:58 -0800196}
atrost86895aa2019-08-19 16:51:15 +0100197
198platform_compat_config {
199 name: "services-platform-compat-config",
atrost86895aa2019-08-19 16:51:15 +0100200 src: ":services",
201}
Ulya Trafimovich0d1b063d62019-12-03 11:59:51 +0000202
203filegroup {
204 name: "art-profile",
205 srcs: ["art-profile"],
206}
Jiyong Parkabc72e42019-11-17 15:17:53 +0900207
208// API stub
209// =============================================================
210
Andrei Onea43114702021-02-10 20:53:12 +0000211stubs_defaults {
212 name: "services-stubs-default",
Jiyong Parkabc72e42019-11-17 15:17:53 +0900213 installable: false,
Makoto Onukiaf97aef2020-02-03 10:32:52 -0800214 args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900215 " --hide-annotation android.annotation.Hide" +
Anton Hanssonf74130f2020-02-19 18:29:12 +0000216 " --hide InternalClasses" + // com.android.* classes are okay in this interface
217 // TODO: remove the --hide options below
Jiyong Parkabc72e42019-11-17 15:17:53 +0900218 " --hide-package com.google.android.startop.iorap" +
Jiyong Parkabc72e42019-11-17 15:17:53 +0900219 " --hide DeprecationMismatch" +
220 " --hide HiddenTypedefConstant",
Andrei Oneafaa271a2021-03-17 13:32:51 +0000221 visibility: ["//frameworks/base:__subpackages__"],
Felipe Lemed3895b62021-03-24 16:55:27 -0700222 filter_packages: ["com.android."],
Andrei Onea43114702021-02-10 20:53:12 +0000223}
224
225droidstubs {
Andrei Oneafaa271a2021-03-17 13:32:51 +0000226 name: "services-non-updatable-stubs",
Andrei Onea43114702021-02-10 20:53:12 +0000227 srcs: [":services-non-updatable-sources"],
228 defaults: ["services-stubs-default"],
229 check_api: {
230 current: {
Andrei Onea8168dc22021-04-30 12:52:36 +0000231 api_file: "api/current.txt",
232 removed_api_file: "api/removed.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000233 },
234 api_lint: {
235 enabled: true,
236 new_since: ":android-non-updatable.api.system-server.latest",
Andrei Onea8168dc22021-04-30 12:52:36 +0000237 baseline_file: "api/lint-baseline.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000238 },
239 },
240 dists: [
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.txt",
Felipe Lemed3895b62021-03-24 16:55:27 -0700245 tag: ".api.txt",
Andrei Onea43114702021-02-10 20:53:12 +0000246 },
247 {
Anton Hanssondd8ef672022-01-04 08:53:19 +0000248 targets: ["sdk"],
Andrei Onea43114702021-02-10 20:53:12 +0000249 dir: "apistubs/android/system-server/api",
250 dest: "android-non-updatable-removed.txt",
251 tag: ".removed-api.txt",
252 },
Felipe Lemed3895b62021-03-24 16:55:27 -0700253 ],
254}