Bob Badour | 8a6a2bc | 2021-02-12 17:07:05 -0800 | [diff] [blame] | 1 | package { |
| 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 Hansson | e3d44e8 | 2021-04-12 18:14:30 +0100 | [diff] [blame] | 10 | // Defaults for platform code that runs inside system_server |
| 11 | java_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 Wright | 010aa30 | 2022-02-04 17:12:47 +0000 | [diff] [blame] | 19 | "-Xep:SelfEquals:ERROR", |
Michael Wright | 2e7197c | 2022-02-04 19:00:44 +0000 | [diff] [blame] | 20 | "-Xep:NullTernary:ERROR", |
Michael Wright | 5c97595 | 2022-02-04 20:08:57 +0000 | [diff] [blame] | 21 | "-Xep:TryFailThrowable:ERROR", |
Michael Wright | 400ea88 | 2022-02-04 20:45:04 +0000 | [diff] [blame^] | 22 | "-Xep:HashtableContains:ERROR", |
Anton Hansson | e3d44e8 | 2021-04-12 18:14:30 +0100 | [diff] [blame] | 23 | // NOTE: only enable to generate local patchfiles |
| 24 | // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster", |
| 25 | // "-XepPatchLocation:/tmp/refaster/", |
| 26 | ], |
| 27 | }, |
Azhara Assanova | a131ad9 | 2021-06-11 09:53:48 +0000 | [diff] [blame] | 28 | lint: { |
| 29 | extra_check_modules: ["AndroidFrameworkLintChecker"], |
| 30 | }, |
Anton Hansson | e3d44e8 | 2021-04-12 18:14:30 +0100 | [diff] [blame] | 31 | } |
| 32 | |
Jared Duke | 4514bdf | 2021-11-18 13:18:21 -0800 | [diff] [blame] | 33 | // Opt-in config for optimizing and shrinking the services target using R8. |
| 34 | // Enabled via `export SYSTEM_OPTIMIZE_JAVA=true`, or explicitly in Make via the |
| 35 | // `SOONG_CONFIG_ANDROID_SYSTEM_OPTIMIZE_JAVA` variable. |
| 36 | // TODO(b/196084106): Enable optimizations by default after stabilizing and |
| 37 | // building out retrace infrastructure. |
| 38 | soong_config_module_type { |
| 39 | name: "system_optimized_java_defaults", |
| 40 | module_type: "java_defaults", |
| 41 | config_namespace: "ANDROID", |
| 42 | bool_variables: ["SYSTEM_OPTIMIZE_JAVA"], |
| 43 | properties: ["optimize"], |
| 44 | } |
| 45 | |
| 46 | system_optimized_java_defaults { |
| 47 | name: "services_java_defaults", |
| 48 | soong_config_variables: { |
| 49 | SYSTEM_OPTIMIZE_JAVA: { |
| 50 | optimize: { |
| 51 | enabled: true, |
| 52 | optimize: true, |
| 53 | shrink: true, |
| 54 | proguard_flags_files: ["proguard.flags"], |
| 55 | }, |
| 56 | // Note: Optimizations are disabled by default if unspecified in |
| 57 | // the java_library rule. |
| 58 | conditions_default: {}, |
| 59 | }, |
| 60 | }, |
| 61 | } |
| 62 | |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 63 | filegroup { |
| 64 | name: "services-main-sources", |
Colin Cross | 33b78ef | 2021-03-26 10:31:25 -0700 | [diff] [blame] | 65 | srcs: [ |
| 66 | "java/**/*.java", |
| 67 | "java/**/package.html", |
| 68 | ], |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 69 | path: "java", |
| 70 | visibility: ["//visibility:private"], |
| 71 | } |
| 72 | |
| 73 | filegroup { |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 74 | name: "services-non-updatable-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 75 | srcs: [ |
| 76 | ":services.core-sources", |
Hongwei Wang | cdcb68d | 2020-11-23 12:48:05 -0800 | [diff] [blame] | 77 | ":services.core-sources-am-wm", |
Colin Cross | 33b78ef | 2021-03-26 10:31:25 -0700 | [diff] [blame] | 78 | "core/java/com/android/server/am/package.html", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 79 | ":services.accessibility-sources", |
| 80 | ":services.appprediction-sources", |
| 81 | ":services.appwidget-sources", |
| 82 | ":services.autofill-sources", |
| 83 | ":services.backup-sources", |
Roopa Sattiraju | 1745d75 | 2022-01-17 11:13:02 -0800 | [diff] [blame] | 84 | ":services.bluetooth-sources", // TODO(b/214988855) : Remove once apex/service-bluetooth jar is ready |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 85 | ":backuplib-sources", |
Shashwat Razdan | f898abc | 2022-01-21 16:39:46 -0800 | [diff] [blame] | 86 | ":services.cloudsearch-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 87 | ":services.companion-sources", |
| 88 | ":services.contentcapture-sources", |
| 89 | ":services.contentsuggestions-sources", |
| 90 | ":services.coverage-sources", |
| 91 | ":services.devicepolicy-sources", |
| 92 | ":services.midi-sources", |
Nick Moukhine | cf47bdd | 2020-08-19 16:29:18 +0200 | [diff] [blame] | 93 | ":services.musicsearch-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 94 | ":services.net-sources", |
| 95 | ":services.print-sources", |
Yi Kong | 86f8593 | 2020-06-29 20:03:55 +0800 | [diff] [blame] | 96 | ":services.profcollect-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 97 | ":services.restrictions-sources", |
Hyunyoung Song | 21e60a9 | 2020-11-20 20:27:54 -0800 | [diff] [blame] | 98 | ":services.searchui-sources", |
Joanne Chung | 41c4a0a | 2021-11-15 23:51:37 +0800 | [diff] [blame] | 99 | ":services.selectiontoolbar-sources", |
Shashwat Razdan | d33e8c3 | 2021-01-29 13:02:19 -0800 | [diff] [blame] | 100 | ":services.smartspace-sources", |
Eugenio Marchiori | c3c0a1e | 2020-12-23 10:44:55 +0000 | [diff] [blame] | 101 | ":services.speech-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 102 | ":services.startop.iorap-sources", |
| 103 | ":services.systemcaptions-sources", |
Adam He | 2653f23 | 2020-11-30 18:23:20 -0800 | [diff] [blame] | 104 | ":services.translation-sources", |
Alex Agranovich | 50c987f | 2021-02-18 09:19:33 +0000 | [diff] [blame] | 105 | ":services.texttospeech-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 106 | ":services.usage-sources", |
| 107 | ":services.usb-sources", |
| 108 | ":services.voiceinteraction-sources", |
Sharon Su | a5afd37 | 2022-02-01 22:09:36 +0000 | [diff] [blame] | 109 | ":services.wallpapereffectsgeneration-sources", |
Roshan Pius | ea33fb9 | 2020-02-20 12:49:45 -0800 | [diff] [blame] | 110 | ":services.wifi-sources", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 111 | ], |
| 112 | visibility: ["//visibility:private"], |
| 113 | } |
| 114 | |
Felipe Leme | fec71a7 | 2021-04-01 23:32:53 -0700 | [diff] [blame] | 115 | java_library { |
| 116 | name: "Slogf", |
| 117 | srcs: ["core/java/com/android/server/utils/Slogf.java"], |
| 118 | } |
| 119 | |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 120 | // merge all required services into one jar |
| 121 | // ============================================================ |
| 122 | java_library { |
| 123 | name: "services", |
Jared Duke | 4514bdf | 2021-11-18 13:18:21 -0800 | [diff] [blame] | 124 | defaults: ["services_java_defaults"], |
Colin Cross | a12c0f5 | 2018-06-27 11:00:11 -0700 | [diff] [blame] | 125 | installable: true, |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 126 | |
| 127 | dex_preopt: { |
| 128 | app_image: true, |
| 129 | profile: "art-profile", |
| 130 | }, |
| 131 | |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 132 | srcs: [":services-main-sources"], |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 133 | |
| 134 | // The convention is to name each service module 'services.$(module_name)' |
| 135 | static_libs: [ |
Colin Cross | 4c0b06b | 2017-12-12 19:43:04 -0800 | [diff] [blame] | 136 | "services.core", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 137 | "services.accessibility", |
Sunny Goyal | 54e9134 | 2018-11-14 11:59:02 -0800 | [diff] [blame] | 138 | "services.appprediction", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 139 | "services.appwidget", |
| 140 | "services.autofill", |
| 141 | "services.backup", |
Shashwat Razdan | f898abc | 2022-01-21 16:39:46 -0800 | [diff] [blame] | 142 | "services.cloudsearch", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 143 | "services.companion", |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 144 | "services.contentcapture", |
Winson Chung | 3fb0f25 | 2019-01-08 17:41:55 -0800 | [diff] [blame] | 145 | "services.contentsuggestions", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 146 | "services.coverage", |
| 147 | "services.devicepolicy", |
| 148 | "services.midi", |
Nick Moukhine | cf47bdd | 2020-08-19 16:29:18 +0200 | [diff] [blame] | 149 | "services.musicsearch", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 150 | "services.net", |
Danning Chen | 20b32ed | 2019-12-18 16:52:03 -0800 | [diff] [blame] | 151 | "services.people", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 152 | "services.print", |
Yi Kong | 86f8593 | 2020-06-29 20:03:55 +0800 | [diff] [blame] | 153 | "services.profcollect", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 154 | "services.restrictions", |
Hyunyoung Song | 21e60a9 | 2020-11-20 20:27:54 -0800 | [diff] [blame] | 155 | "services.searchui", |
Joanne Chung | 41c4a0a | 2021-11-15 23:51:37 +0800 | [diff] [blame] | 156 | "services.selectiontoolbar", |
Shashwat Razdan | d33e8c3 | 2021-01-29 13:02:19 -0800 | [diff] [blame] | 157 | "services.smartspace", |
Eugenio Marchiori | c3c0a1e | 2020-12-23 10:44:55 +0000 | [diff] [blame] | 158 | "services.speech", |
Igor Murashkin | 4de1e16 | 2018-11-26 10:33:17 -0800 | [diff] [blame] | 159 | "services.startop", |
Robert Berry | e14120e | 2019-03-18 16:33:42 -0400 | [diff] [blame] | 160 | "services.systemcaptions", |
Adam He | 2653f23 | 2020-11-30 18:23:20 -0800 | [diff] [blame] | 161 | "services.translation", |
Alex Agranovich | 50c987f | 2021-02-18 09:19:33 +0000 | [diff] [blame] | 162 | "services.texttospeech", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 163 | "services.usage", |
| 164 | "services.usb", |
| 165 | "services.voiceinteraction", |
Sharon Su | a5afd37 | 2022-02-01 22:09:36 +0000 | [diff] [blame] | 166 | "services.wallpapereffectsgeneration", |
Roshan Pius | ea33fb9 | 2020-02-20 12:49:45 -0800 | [diff] [blame] | 167 | "services.wifi", |
Dmitri Plotnikov | 4eaac3a | 2020-05-04 17:00:16 -0700 | [diff] [blame] | 168 | "service-blobstore", |
| 169 | "service-jobscheduler", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 170 | "android.hidl.base-V1.0-java", |
| 171 | ], |
| 172 | |
| 173 | libs: [ |
| 174 | "android.hidl.manager-V1.0-java", |
Paul Duffin | abebc6a | 2020-05-31 11:35:50 +0100 | [diff] [blame] | 175 | "framework-tethering.stubs.module_lib", |
Chris Wailes | 09724a7 | 2021-02-08 10:00:13 -0800 | [diff] [blame] | 176 | "service-art.stubs.system_server", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 177 | ], |
| 178 | |
| 179 | // Uncomment to enable output of certain warnings (deprecated, unchecked) |
| 180 | //javacflags: ["-Xlint"], |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 181 | } |
| 182 | |
Colin Cross | 3a7d899 | 2017-12-05 17:33:58 -0800 | [diff] [blame] | 183 | // native library |
| 184 | // ============================================================= |
| 185 | |
| 186 | cc_library_shared { |
| 187 | name: "libandroid_servers", |
| 188 | defaults: ["libservices.core-libs"], |
| 189 | whole_static_libs: ["libservices.core"], |
markchien | eaca9e9 | 2022-01-18 18:26:28 +0800 | [diff] [blame] | 190 | required: [ |
| 191 | // TODO: remove after NetworkStatsService is moved to the mainline module. |
| 192 | "libcom_android_net_module_util_jni", |
| 193 | ], |
Colin Cross | 3a7d899 | 2017-12-05 17:33:58 -0800 | [diff] [blame] | 194 | } |
atrost | 86895aa | 2019-08-19 16:51:15 +0100 | [diff] [blame] | 195 | |
| 196 | platform_compat_config { |
| 197 | name: "services-platform-compat-config", |
atrost | 86895aa | 2019-08-19 16:51:15 +0100 | [diff] [blame] | 198 | src: ":services", |
| 199 | } |
Ulya Trafimovich | 0d1b063d6 | 2019-12-03 11:59:51 +0000 | [diff] [blame] | 200 | |
| 201 | filegroup { |
| 202 | name: "art-profile", |
| 203 | srcs: ["art-profile"], |
| 204 | } |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 205 | |
| 206 | // API stub |
| 207 | // ============================================================= |
| 208 | |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 209 | stubs_defaults { |
| 210 | name: "services-stubs-default", |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 211 | installable: false, |
Makoto Onuki | af97aef | 2020-02-03 10:32:52 -0800 | [diff] [blame] | 212 | args: " --show-annotation android.annotation.SystemApi\\(client=android.annotation.SystemApi.Client.SYSTEM_SERVER\\)" + |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 213 | " --hide-annotation android.annotation.Hide" + |
Anton Hansson | f74130f | 2020-02-19 18:29:12 +0000 | [diff] [blame] | 214 | " --hide InternalClasses" + // com.android.* classes are okay in this interface |
| 215 | // TODO: remove the --hide options below |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 216 | " --hide-package com.google.android.startop.iorap" + |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 217 | " --hide DeprecationMismatch" + |
| 218 | " --hide HiddenTypedefConstant", |
Andrei Onea | faa271a | 2021-03-17 13:32:51 +0000 | [diff] [blame] | 219 | visibility: ["//frameworks/base:__subpackages__"], |
Felipe Leme | d3895b6 | 2021-03-24 16:55:27 -0700 | [diff] [blame] | 220 | filter_packages: ["com.android."], |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | droidstubs { |
Andrei Onea | faa271a | 2021-03-17 13:32:51 +0000 | [diff] [blame] | 224 | name: "services-non-updatable-stubs", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 225 | srcs: [":services-non-updatable-sources"], |
| 226 | defaults: ["services-stubs-default"], |
| 227 | check_api: { |
| 228 | current: { |
Andrei Onea | 8168dc2 | 2021-04-30 12:52:36 +0000 | [diff] [blame] | 229 | api_file: "api/current.txt", |
| 230 | removed_api_file: "api/removed.txt", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 231 | }, |
| 232 | api_lint: { |
| 233 | enabled: true, |
| 234 | new_since: ":android-non-updatable.api.system-server.latest", |
Andrei Onea | 8168dc2 | 2021-04-30 12:52:36 +0000 | [diff] [blame] | 235 | baseline_file: "api/lint-baseline.txt", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 236 | }, |
| 237 | }, |
| 238 | dists: [ |
| 239 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 240 | targets: ["sdk"], |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 241 | dir: "apistubs/android/system-server/api", |
| 242 | dest: "android-non-updatable.txt", |
Felipe Leme | d3895b6 | 2021-03-24 16:55:27 -0700 | [diff] [blame] | 243 | tag: ".api.txt", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 244 | }, |
| 245 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 246 | targets: ["sdk"], |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 247 | dir: "apistubs/android/system-server/api", |
| 248 | dest: "android-non-updatable-removed.txt", |
| 249 | tag: ".removed-api.txt", |
| 250 | }, |
Felipe Leme | d3895b6 | 2021-03-24 16:55:27 -0700 | [diff] [blame] | 251 | ], |
| 252 | } |