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", |
Michael Wright | c92adae | 2022-02-04 20:49:14 +0000 | [diff] [blame] | 23 | "-Xep:FormatString:ERROR", |
Michael Wright | 16451b0 | 2022-02-04 20:59:26 +0000 | [diff] [blame] | 24 | "-Xep:ArrayHashCode:ERROR", |
Michael Wright | 573d22a | 2022-02-04 21:02:33 +0000 | [diff] [blame] | 25 | "-Xep:SelfAssignment:ERROR", |
Michael Wright | 3cc84d0 | 2022-02-04 21:05:45 +0000 | [diff] [blame] | 26 | "-Xep:ArrayEquals:ERROR", |
Michael Wright | 684f5a5 | 2022-02-04 21:41:04 +0000 | [diff] [blame] | 27 | "-Xep:IdentityBinaryExpression:ERROR", |
Anton Hansson | e3d44e8 | 2021-04-12 18:14:30 +0100 | [diff] [blame] | 28 | // NOTE: only enable to generate local patchfiles |
| 29 | // "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster", |
| 30 | // "-XepPatchLocation:/tmp/refaster/", |
| 31 | ], |
| 32 | }, |
Azhara Assanova | a131ad9 | 2021-06-11 09:53:48 +0000 | [diff] [blame] | 33 | lint: { |
| 34 | extra_check_modules: ["AndroidFrameworkLintChecker"], |
| 35 | }, |
Anton Hansson | e3d44e8 | 2021-04-12 18:14:30 +0100 | [diff] [blame] | 36 | } |
| 37 | |
Jared Duke | 4514bdf | 2021-11-18 13:18:21 -0800 | [diff] [blame] | 38 | // 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. |
| 43 | soong_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 | |
| 51 | system_optimized_java_defaults { |
| 52 | name: "services_java_defaults", |
| 53 | soong_config_variables: { |
| 54 | SYSTEM_OPTIMIZE_JAVA: { |
| 55 | optimize: { |
| 56 | enabled: true, |
Jared Duke | ea03d10 | 2022-02-15 13:57:06 -0800 | [diff] [blame] | 57 | // TODO(b/210510433): Enable optimizations after improving |
| 58 | // retracing infra. |
| 59 | optimize: false, |
Jared Duke | 4514bdf | 2021-11-18 13:18:21 -0800 | [diff] [blame] | 60 | shrink: true, |
| 61 | proguard_flags_files: ["proguard.flags"], |
| 62 | }, |
| 63 | // Note: Optimizations are disabled by default if unspecified in |
| 64 | // the java_library rule. |
| 65 | conditions_default: {}, |
| 66 | }, |
| 67 | }, |
| 68 | } |
| 69 | |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 70 | filegroup { |
| 71 | name: "services-main-sources", |
Colin Cross | 33b78ef | 2021-03-26 10:31:25 -0700 | [diff] [blame] | 72 | srcs: [ |
| 73 | "java/**/*.java", |
| 74 | "java/**/package.html", |
| 75 | ], |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 76 | path: "java", |
| 77 | visibility: ["//visibility:private"], |
| 78 | } |
| 79 | |
| 80 | filegroup { |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 81 | name: "services-non-updatable-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 82 | srcs: [ |
| 83 | ":services.core-sources", |
Hongwei Wang | cdcb68d | 2020-11-23 12:48:05 -0800 | [diff] [blame] | 84 | ":services.core-sources-am-wm", |
Colin Cross | 33b78ef | 2021-03-26 10:31:25 -0700 | [diff] [blame] | 85 | "core/java/com/android/server/am/package.html", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 86 | ":services.accessibility-sources", |
| 87 | ":services.appprediction-sources", |
| 88 | ":services.appwidget-sources", |
| 89 | ":services.autofill-sources", |
| 90 | ":services.backup-sources", |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 91 | ":backuplib-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 92 | ":services.companion-sources", |
| 93 | ":services.contentcapture-sources", |
| 94 | ":services.contentsuggestions-sources", |
| 95 | ":services.coverage-sources", |
| 96 | ":services.devicepolicy-sources", |
| 97 | ":services.midi-sources", |
Nick Moukhine | cf47bdd | 2020-08-19 16:29:18 +0200 | [diff] [blame] | 98 | ":services.musicsearch-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 99 | ":services.net-sources", |
| 100 | ":services.print-sources", |
Yi Kong | 86f8593 | 2020-06-29 20:03:55 +0800 | [diff] [blame] | 101 | ":services.profcollect-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 102 | ":services.restrictions-sources", |
Hyunyoung Song | 21e60a9 | 2020-11-20 20:27:54 -0800 | [diff] [blame] | 103 | ":services.searchui-sources", |
Shashwat Razdan | d33e8c3 | 2021-01-29 13:02:19 -0800 | [diff] [blame] | 104 | ":services.smartspace-sources", |
Eugenio Marchiori | c3c0a1e | 2020-12-23 10:44:55 +0000 | [diff] [blame] | 105 | ":services.speech-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 106 | ":services.systemcaptions-sources", |
Adam He | 2653f23 | 2020-11-30 18:23:20 -0800 | [diff] [blame] | 107 | ":services.translation-sources", |
Alex Agranovich | 50c987f | 2021-02-18 09:19:33 +0000 | [diff] [blame] | 108 | ":services.texttospeech-sources", |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 109 | ":services.usage-sources", |
| 110 | ":services.usb-sources", |
| 111 | ":services.voiceinteraction-sources", |
Sharon Su | a5afd37 | 2022-02-01 22:09:36 +0000 | [diff] [blame] | 112 | ":services.wallpapereffectsgeneration-sources", |
Roshan Pius | ea33fb9 | 2020-02-20 12:49:45 -0800 | [diff] [blame] | 113 | ":services.wifi-sources", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 114 | ], |
| 115 | visibility: ["//visibility:private"], |
| 116 | } |
| 117 | |
Felipe Leme | fec71a7 | 2021-04-01 23:32:53 -0700 | [diff] [blame] | 118 | java_library { |
| 119 | name: "Slogf", |
| 120 | srcs: ["core/java/com/android/server/utils/Slogf.java"], |
| 121 | } |
| 122 | |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 123 | // merge all required services into one jar |
| 124 | // ============================================================ |
| 125 | java_library { |
| 126 | name: "services", |
Jared Duke | 4514bdf | 2021-11-18 13:18:21 -0800 | [diff] [blame] | 127 | defaults: ["services_java_defaults"], |
Colin Cross | a12c0f5 | 2018-06-27 11:00:11 -0700 | [diff] [blame] | 128 | installable: true, |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 129 | |
| 130 | dex_preopt: { |
| 131 | app_image: true, |
| 132 | profile: "art-profile", |
| 133 | }, |
| 134 | |
Jiyong Park | bae2e90 | 2019-11-17 13:11:19 +0900 | [diff] [blame] | 135 | srcs: [":services-main-sources"], |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 136 | |
| 137 | // The convention is to name each service module 'services.$(module_name)' |
| 138 | static_libs: [ |
Colin Cross | 4c0b06b | 2017-12-12 19:43:04 -0800 | [diff] [blame] | 139 | "services.core", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 140 | "services.accessibility", |
Sunny Goyal | 54e9134 | 2018-11-14 11:59:02 -0800 | [diff] [blame] | 141 | "services.appprediction", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 142 | "services.appwidget", |
| 143 | "services.autofill", |
| 144 | "services.backup", |
| 145 | "services.companion", |
Felipe Leme | 749b889 | 2018-12-03 16:30:30 -0800 | [diff] [blame] | 146 | "services.contentcapture", |
Winson Chung | 3fb0f25 | 2019-01-08 17:41:55 -0800 | [diff] [blame] | 147 | "services.contentsuggestions", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 148 | "services.coverage", |
| 149 | "services.devicepolicy", |
| 150 | "services.midi", |
Nick Moukhine | cf47bdd | 2020-08-19 16:29:18 +0200 | [diff] [blame] | 151 | "services.musicsearch", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 152 | "services.net", |
Danning Chen | 20b32ed | 2019-12-18 16:52:03 -0800 | [diff] [blame] | 153 | "services.people", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 154 | "services.print", |
Yi Kong | 86f8593 | 2020-06-29 20:03:55 +0800 | [diff] [blame] | 155 | "services.profcollect", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 156 | "services.restrictions", |
Hyunyoung Song | 21e60a9 | 2020-11-20 20:27:54 -0800 | [diff] [blame] | 157 | "services.searchui", |
Shashwat Razdan | d33e8c3 | 2021-01-29 13:02:19 -0800 | [diff] [blame] | 158 | "services.smartspace", |
Eugenio Marchiori | c3c0a1e | 2020-12-23 10:44:55 +0000 | [diff] [blame] | 159 | "services.speech", |
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", |
Rashed Abdel-Tawab | e9f2aed | 2017-09-26 07:29:25 -0700 | [diff] [blame] | 177 | "org.lineageos.platform.internal", |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 178 | ], |
| 179 | |
| 180 | // Uncomment to enable output of certain warnings (deprecated, unchecked) |
| 181 | //javacflags: ["-Xlint"], |
Colin Cross | eb652a4 | 2017-12-05 09:46:29 -0800 | [diff] [blame] | 182 | } |
| 183 | |
Colin Cross | 3a7d899 | 2017-12-05 17:33:58 -0800 | [diff] [blame] | 184 | // native library |
| 185 | // ============================================================= |
| 186 | |
| 187 | cc_library_shared { |
| 188 | name: "libandroid_servers", |
| 189 | defaults: ["libservices.core-libs"], |
| 190 | whole_static_libs: ["libservices.core"], |
| 191 | } |
atrost | 86895aa | 2019-08-19 16:51:15 +0100 | [diff] [blame] | 192 | |
| 193 | platform_compat_config { |
| 194 | name: "services-platform-compat-config", |
atrost | 86895aa | 2019-08-19 16:51:15 +0100 | [diff] [blame] | 195 | src: ":services", |
| 196 | } |
Ulya Trafimovich | 0d1b063d6 | 2019-12-03 11:59:51 +0000 | [diff] [blame] | 197 | |
| 198 | filegroup { |
| 199 | name: "art-profile", |
| 200 | srcs: ["art-profile"], |
| 201 | } |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 202 | |
| 203 | // API stub |
| 204 | // ============================================================= |
| 205 | |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 206 | stubs_defaults { |
| 207 | name: "services-stubs-default", |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 208 | installable: false, |
Makoto Onuki | af97aef | 2020-02-03 10:32:52 -0800 | [diff] [blame] | 209 | 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] | 210 | " --hide-annotation android.annotation.Hide" + |
Anton Hansson | f74130f | 2020-02-19 18:29:12 +0000 | [diff] [blame] | 211 | " --hide InternalClasses" + // com.android.* classes are okay in this interface |
| 212 | // TODO: remove the --hide options below |
Jiyong Park | abc72e4 | 2019-11-17 15:17:53 +0900 | [diff] [blame] | 213 | " --hide DeprecationMismatch" + |
| 214 | " --hide HiddenTypedefConstant", |
Andrei Onea | faa271a | 2021-03-17 13:32:51 +0000 | [diff] [blame] | 215 | visibility: ["//frameworks/base:__subpackages__"], |
Felipe Leme | d3895b6 | 2021-03-24 16:55:27 -0700 | [diff] [blame] | 216 | filter_packages: ["com.android."], |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | droidstubs { |
Andrei Onea | faa271a | 2021-03-17 13:32:51 +0000 | [diff] [blame] | 220 | name: "services-non-updatable-stubs", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 221 | srcs: [":services-non-updatable-sources"], |
| 222 | defaults: ["services-stubs-default"], |
| 223 | check_api: { |
| 224 | current: { |
Andrei Onea | 8168dc2 | 2021-04-30 12:52:36 +0000 | [diff] [blame] | 225 | api_file: "api/current.txt", |
| 226 | removed_api_file: "api/removed.txt", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 227 | }, |
| 228 | api_lint: { |
| 229 | enabled: true, |
| 230 | new_since: ":android-non-updatable.api.system-server.latest", |
Andrei Onea | 8168dc2 | 2021-04-30 12:52:36 +0000 | [diff] [blame] | 231 | baseline_file: "api/lint-baseline.txt", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 232 | }, |
| 233 | }, |
| 234 | dists: [ |
| 235 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 236 | targets: ["sdk"], |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 237 | dir: "apistubs/android/system-server/api", |
| 238 | dest: "android-non-updatable.txt", |
Felipe Leme | d3895b6 | 2021-03-24 16:55:27 -0700 | [diff] [blame] | 239 | tag: ".api.txt", |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 240 | }, |
| 241 | { |
Anton Hansson | dd8ef67 | 2022-01-04 08:53:19 +0000 | [diff] [blame] | 242 | targets: ["sdk"], |
Andrei Onea | 4311470 | 2021-02-10 20:53:12 +0000 | [diff] [blame] | 243 | dir: "apistubs/android/system-server/api", |
| 244 | dest: "android-non-updatable-removed.txt", |
| 245 | tag: ".removed-api.txt", |
| 246 | }, |
Felipe Leme | d3895b6 | 2021-03-24 16:55:27 -0700 | [diff] [blame] | 247 | ], |
| 248 | } |