• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Build the master framework library.
16
17// READ ME: ########################################################
18//
19// When updating this list of aidl files, consider if that aidl is
20// part of the SDK API.  If it is, also add it to the list in Android.mk
21// that is preprocessed and distributed with the SDK.  This list should
22// not contain any aidl files for parcelables, but the one below should
23// if you intend for 3rd parties to be able to send those objects
24// across process boundaries.
25//
26// READ ME: ########################################################
27
28package {
29    default_applicable_licenses: ["frameworks_base_license"],
30}
31
32// Added automatically by a large-scale-change that took the approach of
33// 'apply every license found to every target'. While this makes sure we respect
34// every license restriction, it may not be entirely correct.
35//
36// e.g. GPL in an MIT project might only apply to the contrib/ directory.
37//
38// Please consider splitting the single license below into multiple licenses,
39// taking care not to lose any license_kind information, and overriding the
40// default license using the 'licenses: [...]' property on targets as needed.
41//
42// For unused files, consider creating a 'fileGroup' with "//visibility:private"
43// to attach the license to, and including a comment whether the files may be
44// used in the current project.
45// See: http://go/android-license-faq
46license {
47    name: "frameworks_base_license",
48    visibility: [":__subpackages__"],
49    license_kinds: [
50        "SPDX-license-identifier-Apache-2.0",
51        "SPDX-license-identifier-BSD",
52        "SPDX-license-identifier-CC-BY",
53        "SPDX-license-identifier-MIT",
54        "SPDX-license-identifier-Unicode-DFS",
55        "legacy_unencumbered",
56    ],
57    license_text: [
58        "NOTICE",
59    ],
60}
61
62filegroup {
63    name: "framework-non-updatable-sources",
64    srcs: [
65        // Java/AIDL sources under frameworks/base
66        ":framework-annotations",
67        ":framework-blobstore-sources",
68        ":framework-core-sources",
69        ":framework-drm-sources",
70        ":framework-graphics-nonupdatable-sources",
71        ":framework-jobscheduler-sources", // jobscheduler is not a module for R
72        ":framework-keystore-sources",
73        ":framework-identity-sources",
74        ":framework-location-sources",
75        ":framework-lowpan-sources",
76        ":framework-mca-effect-sources",
77        ":framework-mca-filterfw-sources",
78        ":framework-mca-filterpacks-sources",
79        ":framework-media-non-updatable-sources",
80        ":framework-mms-sources",
81        ":framework-omapi-sources",
82        ":framework-opengl-sources",
83        ":framework-rs-sources",
84        ":framework-sax-sources",
85        ":framework-telecomm-sources",
86        ":framework-telephony-common-sources",
87        ":framework-telephony-sources",
88        ":framework-vcn-util-sources",
89        ":framework-wifi-annotations",
90        ":framework-wifi-non-updatable-sources",
91        ":PacProcessor-aidl-sources",
92        ":ProxyHandler-aidl-sources",
93        ":net-utils-framework-common-srcs",
94
95        // AIDL from frameworks/base/native/
96        ":platform-compat-native-aidl",
97
98        // AIDL sources from external directories
99        ":android.hardware.gnss-V2-java-source",
100        ":android.hardware.graphics.common-V3-java-source",
101        ":android.hardware.security.keymint-V2-java-source",
102        ":android.hardware.security.secureclock-V1-java-source",
103        ":android.hardware.tv.tuner-V1-java-source",
104        ":android.security.apc-java-source",
105        ":android.security.authorization-java-source",
106        ":android.security.legacykeystore-java-source",
107        ":android.security.maintenance-java-source",
108        ":android.security.metrics-java-source",
109        ":android.system.keystore2-V1-java-source",
110        ":credstore_aidl",
111        ":dumpstate_aidl",
112        ":framework_native_aidl",
113        ":gatekeeper_aidl",
114        ":gsiservice_aidl",
115        ":guiconstants_aidl",
116        ":idmap2_aidl",
117        ":idmap2_core_aidl",
118        ":incidentcompanion_aidl",
119        ":inputconstants_aidl",
120        ":installd_aidl",
121        ":libaudioclient_aidl",
122        ":libbinder_aidl",
123        ":libcamera_client_aidl",
124        ":libcamera_client_framework_aidl",
125        ":libupdate_engine_aidl",
126        ":logd_aidl",
127        ":resourcemanager_aidl",
128        ":storaged_aidl",
129        ":vold_aidl",
130        ":deviceproductinfoconstants_aidl",
131
132        // For the generated R.java and Manifest.java
133        ":framework-res{.aapt.srcjar}",
134
135        // etc.
136        ":framework-javastream-protos",
137        ":statslog-framework-java-gen", // FrameworkStatsLog.java
138        ":audio_policy_configuration_V7_0",
139    ],
140}
141
142java_library {
143    name: "framework-all",
144    installable: false,
145    static_libs: [
146        "all-framework-module-impl",
147        "framework-minus-apex",
148    ],
149    apex_available: ["//apex_available:platform"],
150    sdk_version: "core_platform",
151    visibility: [
152        // DO NOT ADD ANY MORE ENTRIES TO THIS LIST
153        "//external/robolectric-shadows:__subpackages__",
154        //This will eventually replace the item above, and serves the
155        //same purpose.
156        "//external/robolectric:__subpackages__",
157        "//frameworks/layoutlib:__subpackages__",
158    ],
159}
160
161// AIDL files under these paths are mixture of public and private ones.
162// They shouldn't be exported across module boundaries.
163java_defaults {
164    name: "framework-aidl-export-defaults",
165    aidl: {
166        export_include_dirs: [
167            "core/java",
168            "drm/java",
169            "graphics/java",
170            "identity/java",
171            "keystore/java",
172            "location/java",
173            "lowpan/java",
174            "media/java",
175            "media/mca/effect/java",
176            "media/mca/filterfw/java",
177            "media/mca/filterpacks/java",
178            "mms/java",
179            "opengl/java",
180            "rs/java",
181            "sax/java",
182            "telecomm/java",
183
184            // TODO(b/147699819): remove this
185            "telephony/java",
186        ],
187    },
188}
189
190// Collection of classes that are generated from non-Java files that are not listed in
191// framework_srcs. These have no or very limited dependency to the framework.
192java_library {
193    name: "framework-internal-utils",
194    static_libs: [
195        "apex_aidl_interface-java",
196        "packagemanager_aidl-java",
197        "framework-protos",
198        "updatable-driver-protos",
199        "ota_metadata_proto_java",
200        "android.hidl.base-V1.0-java",
201        "android.hardware.cas-V1.0-java",
202        "android.hardware.cas-V1.1-java",
203        "android.hardware.cas-V1.2-java",
204        "android.hardware.contexthub-V1.0-java",
205        "android.hardware.contexthub-V1.1-java",
206        "android.hardware.contexthub-V1.2-java",
207        "android.hardware.contexthub-V1-java",
208        "android.hardware.gnss-V1.0-java",
209        "android.hardware.gnss-V2.1-java",
210        "android.hardware.health-V1.0-java-constants",
211        "android.hardware.radio-V1.0-java",
212        "android.hardware.radio-V1.1-java",
213        "android.hardware.radio-V1.2-java",
214        "android.hardware.radio-V1.3-java",
215        "android.hardware.radio-V1.4-java",
216        "android.hardware.radio-V1.5-java",
217        "android.hardware.radio-V1.6-java",
218        "android.hardware.radio.data-V1-java",
219        "android.hardware.radio.messaging-V1-java",
220        "android.hardware.radio.modem-V1-java",
221        "android.hardware.radio.network-V1-java",
222        "android.hardware.radio.sim-V1-java",
223        "android.hardware.radio.voice-V1-java",
224        "android.hardware.thermal-V1.0-java-constants",
225        "android.hardware.thermal-V1.0-java",
226        "android.hardware.thermal-V1.1-java",
227        "android.hardware.thermal-V2.0-java",
228        "android.hardware.tv.input-V1.0-java-constants",
229        "android.hardware.usb-V1.0-java-constants",
230        "android.hardware.usb-V1.1-java-constants",
231        "android.hardware.usb-V1.2-java-constants",
232        "android.hardware.usb.gadget-V1.0-java",
233        "android.hardware.usb.gadget-V1.1-java",
234        "android.hardware.usb.gadget-V1.2-java",
235        "android.hardware.vibrator-V1.0-java",
236        "android.hardware.vibrator-V1.1-java",
237        "android.hardware.vibrator-V1.2-java",
238        "android.hardware.vibrator-V1.3-java",
239        "android.hardware.vibrator-V2-java",
240        "android.se.omapi-V1-java",
241        "android.system.suspend.control.internal-java",
242        "devicepolicyprotosnano",
243
244        "com.android.sysprop.apex",
245        "com.android.sysprop.init",
246        "com.android.sysprop.localization",
247        "PlatformProperties",
248    ],
249    sdk_version: "core_platform",
250    installable: false,
251}
252
253// NOTE: This filegroup is exposed for vendor libraries to depend on and is referenced in
254// documentation. Do not remove without consulting the treble/hidl teams.
255filegroup {
256    name: "framework-jarjar-rules",
257    srcs: ["framework-jarjar-rules.txt"],
258    visibility: ["//visibility:public"],
259}
260
261java_defaults {
262    name: "framework-minus-apex-defaults",
263    defaults: ["framework-aidl-export-defaults"],
264    srcs: [
265        ":framework-non-updatable-sources",
266        "core/java/**/*.logtags",
267        ":apex-info-list",
268    ],
269    aidl: {
270        generate_get_transaction_name: true,
271        local_include_dirs: [
272            "media/aidl",
273        ],
274        include_dirs: [
275            "frameworks/av/aidl",
276            "frameworks/native/libs/permission/aidl",
277            "packages/modules/Bluetooth/framework/aidl-export",
278            "packages/modules/Connectivity/framework/aidl-export",
279            "packages/modules/Media/apex/aidl/stable",
280            "hardware/interfaces/graphics/common/aidl",
281        ],
282    },
283    dxflags: [
284        "--core-library",
285        "--multi-dex",
286    ],
287    jarjar_rules: ":framework-jarjar-rules",
288    javac_shard_size: 150,
289    plugins: [
290        "view-inspector-annotation-processor",
291        "staledataclass-annotation-processor",
292        "error_prone_android_framework",
293    ],
294    required: [
295        // TODO(b/120066492): remove default_television.xml when the build system
296        // propagates "required" properly.
297        "default_television.xml",
298        "framework-platform-compat-config",
299        // TODO(b/120066492): remove gps_debug and protolog.conf.json when the build
300        // system propagates "required" properly.
301        "gps_debug.conf",
302        "icu4j-platform-compat-config",
303        "protolog.conf.json.gz",
304        "services-platform-compat-config",
305        "TeleService-platform-compat-config",
306        "documents-ui-compat-config",
307        "calendar-provider-compat-config",
308        "contacts-provider-platform-compat-config",
309    ],
310    libs: [
311        "app-compat-annotations",
312        "ext",
313        "framework-updatable-stubs-module_libs_api",
314        "unsupportedappusage",
315    ],
316    sdk_version: "core_platform",
317    static_libs: [
318        "android.hardware.common.fmq-V1-java",
319        // TODO(b/184162091)
320        "android.hardware.soundtrigger3-V1-java",
321        "bouncycastle-repackaged-unbundled",
322        "framework-internal-utils",
323        // If MimeMap ever becomes its own APEX, then this dependency would need to be removed
324        // in favor of an API stubs dependency in java_library "framework" below.
325        "mimemap",
326        "av-types-aidl-java",
327        "tv_tuner_resource_manager_aidl_interface-java",
328        "soundtrigger_middleware-aidl-java",
329        "modules-utils-build",
330        "modules-utils-preconditions",
331        "modules-utils-synchronous-result-receiver",
332        "modules-utils-os",
333        "modules-utils-uieventlogger-interface",
334        "framework-permission-aidl-java",
335        "spatializer-aidl-java",
336        "audiopolicy-types-aidl-java",
337    ],
338}
339
340java_library {
341    name: "framework-minus-apex",
342    defaults: ["framework-minus-apex-defaults"],
343    installable: true,
344    // For backwards compatibility.
345    stem: "framework",
346    apex_available: ["//apex_available:platform"],
347    visibility: [
348        "//frameworks/base",
349        // TODO(b/147128803) remove the below lines
350        "//frameworks/base/apex/blobstore/framework",
351        "//frameworks/base/apex/jobscheduler/framework",
352        "//frameworks/base/packages/Tethering/tests/unit",
353        "//packages/modules/Connectivity/Tethering/tests/unit",
354    ],
355    lint: {
356        extra_check_modules: ["AndroidFrameworkLintChecker"],
357    },
358    errorprone: {
359        javacflags: [
360            "-Xep:AndroidFrameworkBinderIdentity:ERROR",
361            "-Xep:AndroidFrameworkCompatChange:ERROR",
362            "-Xep:AndroidFrameworkUid:ERROR",
363        ],
364    },
365}
366
367java_library {
368    name: "framework-minus-apex-intdefs",
369    defaults: ["framework-minus-apex-defaults"],
370    plugins: ["intdef-annotation-processor"],
371}
372
373// This "framework" module is NOT installed to the device. It's
374// "framework-minus-apex" that gets installed to the device. Note that
375// the filename is still framework.jar (via the stem property) for
376// compatibility reason. The purpose of this module is to provide
377// framework APIs (both public and private) for bundled apps.
378// "framework-minus-apex" can't be used for the purpose because 1)
379// many apps have already hardcoded the name "framework" and
380// 2) it lacks API symbols from updatable modules - as it's clear from
381// its suffix "-minus-apex".
382java_library {
383    name: "framework",
384    defaults: ["framework-aidl-export-defaults"],
385    installable: false, // this lib is a build-only library
386    static_libs: [
387        "app-compat-annotations",
388        "framework-minus-apex",
389        "framework-updatable-stubs-module_libs_api",
390    ],
391    sdk_version: "core_platform",
392    apex_available: ["//apex_available:platform"],
393}
394
395platform_compat_config {
396    name: "framework-platform-compat-config",
397    src: ":framework-minus-apex",
398}
399
400filegroup {
401    name: "framework-ike-shared-srcs",
402    visibility: ["//packages/modules/IPsec"],
403    srcs: [
404        "core/java/com/android/internal/util/HexDump.java",
405        "core/java/com/android/internal/util/WakeupMessage.java",
406        "services/core/java/com/android/server/vcn/util/PersistableBundleUtils.java",
407        "telephony/java/android/telephony/Annotation.java",
408    ],
409}
410
411filegroup {
412    name: "framework-networkstack-shared-srcs",
413    srcs: [
414        // TODO: remove these annotations as soon as we can use andoid.support.annotations.*
415        ":framework-annotations",
416        ":modules-utils-preconditions-srcs",
417        "core/java/android/util/IndentingPrintWriter.java",
418        "core/java/android/util/LocalLog.java",
419        "core/java/com/android/internal/util/HexDump.java",
420        "core/java/com/android/internal/util/IndentingPrintWriter.java",
421        "core/java/com/android/internal/util/MessageUtils.java",
422        "core/java/com/android/internal/util/RingBufferIndices.java",
423        "core/java/com/android/internal/util/WakeupMessage.java",
424        "core/java/com/android/internal/util/TokenBucket.java",
425    ],
426}
427
428// Build ext.jar
429// ============================================================
430java_library {
431    name: "ext",
432    installable: true,
433    sdk_version: "core_platform",
434    static_libs: [
435        "libphonenumber-platform",
436        "tagsoup",
437        "rappor",
438    ],
439    dxflags: ["--core-library"],
440}
441
442// utility classes statically linked into framework-wifi and dynamically linked
443// into wifi-service
444java_library {
445    name: "framework-wifi-util-lib",
446    sdk_version: "module_current",
447    min_sdk_version: "30",
448    srcs: [
449        "core/java/com/android/internal/util/AsyncChannel.java",
450        "core/java/com/android/internal/util/AsyncService.java",
451        "core/java/com/android/internal/util/Protocol.java",
452        "telephony/java/android/telephony/Annotation.java",
453        ":net-utils-framework-wifi-common-srcs",
454    ],
455    libs: [
456        "framework-annotations-lib",
457        "framework-connectivity.stubs.module_lib",
458        "unsupportedappusage",
459    ],
460    visibility: [
461        "//frameworks/base/wifi",
462        "//frameworks/base/services/net",
463        "//packages/modules/Wifi/framework",
464    ],
465}
466
467// TODO(b/145644363): move this to under StubLibraries.bp or ApiDocs.bp
468metalava_framework_docs_args = "" +
469    "--api-lint-ignore-prefix android.icu. " +
470    "--api-lint-ignore-prefix java. " +
471    "--api-lint-ignore-prefix junit. " +
472    "--api-lint-ignore-prefix org. " +
473    "--error NoSettingsProvider " +
474    "--error UnhiddenSystemApi " +
475    "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.* " +
476    "--hide BroadcastBehavior " +
477    "--hide CallbackInterface " +
478    "--hide DeprecationMismatch " +
479    "--hide HiddenSuperclass " +
480    "--hide HiddenTypeParameter " +
481    "--hide MissingPermission " +
482    "--hide-package android.audio.policy.configuration.V7_0 " +
483    "--hide-package com.android.server " +
484    "--hide RequiresPermission " +
485    "--hide SdkConstant " +
486    "--hide Todo " +
487    "--hide Typo " +
488    "--hide UnavailableSymbol " +
489    "--manifest $(location core/res/AndroidManifest.xml) "
490
491packages_to_document = [
492    "android",
493    "dalvik",
494    "java",
495    "javax",
496    "junit",
497    "org.apache.http",
498    "org.json",
499    "org.w3c.dom",
500    "org.xml.sax",
501    "org.xmlpull",
502]
503
504filegroup {
505    name: "android-non-updatable-stub-sources",
506    srcs: [
507        ":framework-mime-sources", // mimemap builds separately but has no separate droidstubs.
508        ":framework-non-updatable-sources",
509        ":opt-telephony-srcs",
510        ":opt-net-voip-srcs",
511        "core/java/**/*.logtags",
512        "**/package.html",
513    ],
514    visibility: ["//visibility:private"],
515}
516
517// Defaults for all stubs that include the non-updatable framework. These defaults do not include
518// module symbols, so will not compile correctly on their own. Users must add module APIs to the
519// classpath (or sources) somehow.
520stubs_defaults {
521    name: "android-non-updatable-stubs-defaults",
522    srcs: [":android-non-updatable-stub-sources"],
523    sdk_version: "none",
524    system_modules: "none",
525    java_version: "1.8",
526    arg_files: ["core/res/AndroidManifest.xml"],
527    aidl: {
528        local_include_dirs: [
529            "media/aidl",
530            "telephony/java",
531        ],
532        include_dirs: [
533            "frameworks/av/aidl",
534            "frameworks/native/libs/permission/aidl",
535            "packages/modules/Bluetooth/framework/aidl-export",
536            "packages/modules/Connectivity/framework/aidl-export",
537            "packages/modules/Media/apex/aidl/stable",
538            "hardware/interfaces/graphics/common/aidl",
539        ],
540    },
541    // These are libs from framework-internal-utils that are required (i.e. being referenced)
542    // from framework-non-updatable-sources. Add more here when there's a need.
543    // DO NOT add the entire framework-internal-utils. It might cause unnecessary circular
544    // dependencies gets bigger.
545    libs: [
546        "android.hardware.cas-V1.2-java",
547        "android.hardware.health-V1.0-java-constants",
548        "android.hardware.radio-V1.5-java",
549        "android.hardware.radio-V1.6-java",
550        "android.hardware.thermal-V1.0-java-constants",
551        "android.hardware.thermal-V2.0-java",
552        "android.hardware.tv.input-V1.0-java-constants",
553        "android.hardware.usb-V1.0-java-constants",
554        "android.hardware.usb-V1.1-java-constants",
555        "android.hardware.usb.gadget-V1.0-java",
556        "android.hardware.vibrator-V1.3-java",
557        "framework-protos",
558    ],
559    filter_packages: packages_to_document,
560    high_mem: true, // Lots of sources => high memory use, see b/170701554
561    installable: false,
562    annotations_enabled: true,
563    previous_api: ":android.api.public.latest",
564    merge_annotations_dirs: ["metalava-manual"],
565    defaults_visibility: ["//visibility:private"],
566    visibility: ["//frameworks/base/api"],
567}
568
569// Defaults with module APIs in the classpath (mostly from prebuilts).
570// Suitable for compiling android-non-updatable.
571stubs_defaults {
572    name: "module-classpath-stubs-defaults",
573    aidl: {
574        include_dirs: [
575            "packages/modules/Bluetooth/framework/aidl-export",
576            "packages/modules/Connectivity/framework/aidl-export",
577            "packages/modules/Media/apex/aidl/stable",
578        ],
579    },
580    libs: [
581        "art.module.public.api",
582        "sdk_module-lib_current_framework-tethering",
583        "sdk_module-lib_current_framework-connectivity-t",
584        "sdk_public_current_framework-bluetooth",
585        // There are a few classes from modules used by the core that
586        // need to be resolved by metalava. We use a prebuilt stub of the
587        // full sdk to ensure we can resolve them. If a new class gets added,
588        // the prebuilts/sdk/current needs to be updated.
589        "sdk_system_current_android",
590        // NOTE: The below can be removed once the prebuilt stub contains IKE.
591        "sdk_system_current_android.net.ipsec.ike",
592    ],
593    defaults_visibility: ["//visibility:private"],
594}
595
596build = [
597    "StubLibraries.bp",
598    "ApiDocs.bp",
599    "ProtoLibraries.bp",
600    "TestProtoLibraries.bp",
601]
602