diff options
Diffstat (limited to 'Android.bp')
| -rw-r--r-- | Android.bp | 154 |
1 files changed, 140 insertions, 14 deletions
diff --git a/Android.bp b/Android.bp index 53554bce43b8..431f0b9317ac 100644 --- a/Android.bp +++ b/Android.bp @@ -408,21 +408,18 @@ java_defaults { ], } -java_library { - name: "framework-minus-apex", +// Separated so framework-minus-apex-defaults can be used without the libs dependency +java_defaults { + name: "framework-minus-apex-with-libs-defaults", defaults: ["framework-minus-apex-defaults"], - installable: true, - // For backwards compatibility. - stem: "framework", - apex_available: ["//apex_available:platform"], - visibility: [ - "//frameworks/base", - // TODO(b/147128803) remove the below lines - "//frameworks/base/apex/blobstore/framework", - "//frameworks/base/apex/jobscheduler/framework", - "//frameworks/base/packages/Tethering/tests/unit", - "//packages/modules/Connectivity/Tethering/tests/unit", + libs: [ + "framework-virtualization.stubs.module_lib", + "framework-location.impl", ], +} + +java_defaults { + name: "framework-non-updatable-lint-defaults", lint: { extra_check_modules: ["AndroidFrameworkLintChecker"], disabled_checks: ["ApiMightLeakAppVisibility"], @@ -436,6 +433,43 @@ java_library { "UseOfCallerAwareMethodsWithClearedIdentity", ], }, +} + +// we are unfortunately building the turbine jar twice, but more efficient and less complex +// than generating a similar set of stubs with metalava +java_library { + name: "framework-minus-apex-headers", + defaults: ["framework-minus-apex-defaults"], + installable: false, + // For backwards compatibility. + stem: "framework", + apex_available: ["//apex_available:platform"], + visibility: [ + "//frameworks/base/location", + ], + compile_dex: false, + headers_only: true, +} + +java_library { + name: "framework-minus-apex", + defaults: [ + "framework-minus-apex-with-libs-defaults", + "framework-non-updatable-lint-defaults", + ], + installable: true, + // For backwards compatibility. + stem: "framework", + apex_available: ["//apex_available:platform"], + visibility: [ + "//frameworks/base", + "//frameworks/base/location", + // TODO(b/147128803) remove the below lines + "//frameworks/base/apex/blobstore/framework", + "//frameworks/base/apex/jobscheduler/framework", + "//frameworks/base/packages/Tethering/tests/unit", + "//packages/modules/Connectivity/Tethering/tests/unit", + ], errorprone: { javacflags: [ "-Xep:AndroidFrameworkCompatChange:ERROR", @@ -446,7 +480,7 @@ java_library { java_library { name: "framework-minus-apex-intdefs", - defaults: ["framework-minus-apex-defaults"], + defaults: ["framework-minus-apex-with-libs-defaults"], plugins: ["intdef-annotation-processor"], // Errorprone and android lint will already run on framework-minus-apex, don't rerun them on @@ -474,6 +508,7 @@ java_library { installable: false, // this lib is a build-only library static_libs: [ "app-compat-annotations", + "framework-location.impl", "framework-minus-apex", "framework-updatable-stubs-module_libs_api", ], @@ -701,6 +736,97 @@ stubs_defaults { ], } +// Defaults for the java_sdk_libraries of unbundled jars from framework. +// java_sdk_libraries using these defaults should also add themselves to the +// non_updatable_modules list in frameworks/base/api/api.go +java_defaults { + name: "framework-non-updatable-unbundled-defaults", + defaults: ["framework-non-updatable-lint-defaults"], + + sdk_version: "core_platform", + + // Api scope settings + public: { + enabled: true, + sdk_version: "module_current", + libs: ["android_module_lib_stubs_current"], + }, + system: { + enabled: true, + sdk_version: "module_current", + libs: ["android_module_lib_stubs_current"], + }, + module_lib: { + enabled: true, + sdk_version: "module_current", + libs: ["android_module_lib_stubs_current"], + }, + test: { + enabled: true, + sdk_version: "test_frameworks_core_current", + libs: ["android_test_frameworks_core_stubs_current"], + }, + + stub_only_libs: [ + "framework-protos", + ], + impl_only_libs: [ + "framework-minus-apex-headers", // full access to framework-minus-apex including hidden API + "framework-annotations-lib", + ], + visibility: ["//visibility:public"], + stubs_library_visibility: ["//visibility:public"], + stubs_source_visibility: ["//visibility:private"], + impl_library_visibility: [ + ":__pkg__", + "//frameworks/base", + "//frameworks/base/api", // For framework-all + ], + defaults_visibility: [ + "//frameworks/base/location", + ], + plugins: [ + "error_prone_android_framework", + ], + errorprone: { + javacflags: [ + "-Xep:AndroidFrameworkCompatChange:ERROR", + "-Xep:AndroidFrameworkUid:ERROR", + ], + }, + + // Include manual annotations in API txt files + merge_annotations_dirs: ["metalava-manual"], + + // Use the source of annotations that affect metalava doc generation, since + // the relevant generation instructions are themselves in javadoc, which is + // not present in class files. + api_srcs: [":framework-metalava-annotations"], + + // Framework modules are not generally shared libraries, i.e. they are not + // intended, and must not be allowed, to be used in a <uses-library> manifest + // entry. + shared_library: false, + + // Prevent dependencies that do not specify an sdk_version from accessing the + // implementation library by default and force them to use stubs instead. + default_to_stubs: true, + + // Subdirectory for the artifacts that are copied to the dist directory + dist_group: "android", + + droiddoc_options: [ + "--error UnhiddenSystemApi " + + "--hide CallbackInterface " + + "--hide HiddenTypedefConstant " + + "--hide RequiresPermission " + + "--enhance-documentation " + + "--hide-package com.android.server ", + ], + + annotations_enabled: true, +} + build = [ "AconfigFlags.bp", "ProtoLibraries.bp", |