diff options
author | 2023-08-07 11:18:09 +0000 | |
---|---|---|
committer | 2023-08-23 15:55:52 +0000 | |
commit | 9ee1866f3e6d15da37571d1d094c3ce80efbfa39 (patch) | |
tree | ec911ac74cb332a0b9c39d275089ae9fa26278a3 | |
parent | 59ccaf0cda89876e6019ec3c422e81a8218b8386 (diff) |
Created empty framework-location non-updatable module
Bug: 289776578
Test: presubmit
Change-Id: Id077cff3825cea0da2ea9fad06c53eeb4f8655a2
-rw-r--r-- | Android.bp | 154 | ||||
-rw-r--r-- | api/Android.bp | 1 | ||||
-rw-r--r-- | api/StubLibraries.bp | 2 | ||||
-rw-r--r-- | api/api.go | 7 | ||||
-rw-r--r-- | location/Android.bp | 41 | ||||
-rw-r--r-- | location/api/current.txt | 1 | ||||
-rw-r--r-- | location/api/module-lib-current.txt | 1 | ||||
-rw-r--r-- | location/api/module-lib-removed.txt | 1 | ||||
-rw-r--r-- | location/api/removed.txt | 1 | ||||
-rw-r--r-- | location/api/system-current.txt | 1 | ||||
-rw-r--r-- | location/api/system-removed.txt | 1 | ||||
-rw-r--r-- | location/api/test-current.txt | 1 | ||||
-rw-r--r-- | location/api/test-removed.txt | 1 | ||||
-rw-r--r-- | location/placeholder_java/android/location/Placeholder.java | 27 |
14 files changed, 223 insertions, 17 deletions
diff --git a/Android.bp b/Android.bp index be589b2857b4..a0f2623e7d0f 100644 --- a/Android.bp +++ b/Android.bp @@ -407,21 +407,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"], @@ -435,6 +432,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", @@ -445,7 +479,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 @@ -473,6 +507,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", ], @@ -700,6 +735,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 = [ "ProtoLibraries.bp", "TestProtoLibraries.bp", diff --git a/api/Android.bp b/api/Android.bp index c16bce5a1aea..9d4c913bddce 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -86,6 +86,7 @@ combined_apis { "framework-devicelock", "framework-graphics", "framework-healthfitness", + "framework-location", "framework-media", "framework-mediaprovider", "framework-ondevicepersonalization", diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp index c37ff9761757..e481fe9971fc 100644 --- a/api/StubLibraries.bp +++ b/api/StubLibraries.bp @@ -487,7 +487,6 @@ java_library { static_libs: [ "all-updatable-modules-system-stubs", "android-non-updatable.stubs.test", - "private-stub-annotations-jar", ], defaults: [ "android.jar_defaults", @@ -613,6 +612,7 @@ java_defaults { api_contributions: [ "test-api-stubs-docs-non-updatable.api.contribution", "framework-virtualization.stubs.source.test.api.contribution", + "framework-location.stubs.source.test.api.contribution", ], } diff --git a/api/api.go b/api/api.go index d5c6145ba062..6095a9a781d8 100644 --- a/api/api.go +++ b/api/api.go @@ -31,6 +31,7 @@ const art = "art.module.public.api" const conscrypt = "conscrypt.module.public.api" const i18n = "i18n.module.public.api" const virtualization = "framework-virtualization" +const location = "framework-location" var core_libraries_modules = []string{art, conscrypt, i18n} @@ -42,7 +43,7 @@ var core_libraries_modules = []string{art, conscrypt, i18n} // APIs. // In addition, the modules in this list are allowed to contribute to test APIs // stubs. -var non_updatable_modules = []string{virtualization} +var non_updatable_modules = []string{virtualization, location} // The intention behind this soong plugin is to generate a number of "merged" // API-related modules that would otherwise require a large amount of very @@ -278,8 +279,10 @@ func createMergedFrameworkImpl(ctx android.LoadHookContext, modules []string) { } func createMergedFrameworkModuleLibStubs(ctx android.LoadHookContext, modules []string) { - // The user of this module compiles against the "core" SDK, so remove core libraries to avoid dupes. + // The user of this module compiles against the "core" SDK and against non-updatable modules, + // so remove to avoid dupes. modules = removeAll(modules, core_libraries_modules) + modules = removeAll(modules, non_updatable_modules) props := libraryProps{} props.Name = proptools.StringPtr("framework-updatable-stubs-module_libs_api") props.Static_libs = transformArray(modules, "", ".stubs.module_lib") diff --git a/location/Android.bp b/location/Android.bp new file mode 100644 index 000000000000..46dca74e7e40 --- /dev/null +++ b/location/Android.bp @@ -0,0 +1,41 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + +//location sources that will populate the new module +filegroup { + name: "framework-location-nonupdatable-sources", + srcs: [ + "placeholder_java/android/location/Placeholder.java", + ], +} + +java_sdk_library { + name: "framework-location", + srcs: [ + ":framework-location-nonupdatable-sources", + ], + defaults: ["framework-non-updatable-unbundled-defaults"], + permitted_packages: [ + "android.location", + "com.android.internal.location", + ], + libs: [ + "app-compat-annotations", + "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage + ], + hidden_api_packages: [ + "com.android.internal.location", + ], + aidl: { + include_dirs: [ + "frameworks/base/location/java", + "frameworks/base/core/java", + ], + }, +} diff --git a/location/api/current.txt b/location/api/current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/module-lib-current.txt b/location/api/module-lib-current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/module-lib-current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/module-lib-removed.txt b/location/api/module-lib-removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/module-lib-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/removed.txt b/location/api/removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/system-current.txt b/location/api/system-current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/system-current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/system-removed.txt b/location/api/system-removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/system-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/test-current.txt b/location/api/test-current.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/test-current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/api/test-removed.txt b/location/api/test-removed.txt new file mode 100644 index 000000000000..d802177e249b --- /dev/null +++ b/location/api/test-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/location/placeholder_java/android/location/Placeholder.java b/location/placeholder_java/android/location/Placeholder.java new file mode 100644 index 000000000000..f0dbce829174 --- /dev/null +++ b/location/placeholder_java/android/location/Placeholder.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.location; + +/** + * Placeholder class so new frameworks-location module isn't empty, will be removed once module is + * populated. + * + * @hide + * + */ +public class Placeholder { +} |