From 25a0a2baa7d2ed618aa6aef7f32653b008019179 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 8 Oct 2020 13:43:48 +0100 Subject: [PATCH] Convert appsearch to java_sdk_library AppSearch build file only defined a subset of the stubs and api tracking, which prevents making progress on creating a correct "merged" current.txt. Convert it to the standard build setup modules should use. Implementation wise, this is a little bit special in that it's somewhere between a module and not. The implementation library requires platform internals to compile. The stubs do not, and we rely on this to make the build work at all -- via impl_only_libs we compile the stubs *without* framework-minus-apex, which allows framework-minus-apex to depend on the stubs. Bug: 169304493 Test: m checkapi Change-Id: I10a331bb6df56072cb9e9ada99ae47c5446869fd --- Android.bp | 7 +-- StubLibraries.bp | 2 +- apex/appsearch/framework/Android.bp | 59 +++---------------- apex/appsearch/framework/api/current.txt | 1 + .../framework/api/module-lib-current.txt | 1 + .../framework/api/module-lib-removed.txt | 1 + apex/appsearch/framework/api/removed.txt | 1 + .../framework/api/system-current.txt | 9 +++ .../framework/api/system-removed.txt | 1 + 9 files changed, 26 insertions(+), 56 deletions(-) create mode 100644 apex/appsearch/framework/api/current.txt create mode 100644 apex/appsearch/framework/api/module-lib-current.txt create mode 100644 apex/appsearch/framework/api/module-lib-removed.txt create mode 100644 apex/appsearch/framework/api/removed.txt create mode 100644 apex/appsearch/framework/api/system-current.txt create mode 100644 apex/appsearch/framework/api/system-removed.txt diff --git a/Android.bp b/Android.bp index 06f3666c9aab7..d4cd474d06450 100644 --- a/Android.bp +++ b/Android.bp @@ -374,7 +374,7 @@ filegroup { java_library { name: "framework-updatable-stubs-module_libs_api", static_libs: [ - "framework-appsearch-stubs", // TODO: Update to module_libs_api when there is one. + "framework-appsearch.stubs.module_lib", "framework-graphics.stubs.module_lib", "framework-media.stubs.module_lib", "framework-mediaprovider.stubs.module_lib", @@ -393,7 +393,7 @@ java_library { installable: false, static_libs: [ "framework-minus-apex", - "framework-appsearch", + "framework-appsearch.impl", "framework-graphics.impl", "framework-mediaprovider.impl", "framework-permission.impl", @@ -623,8 +623,7 @@ java_library { static_libs: [ "app-compat-annotations", "framework-minus-apex", - // TODO(b/146218515): should be removed - "framework-appsearch", + "framework-appsearch.impl", // TODO(b/146218515): should be removed "framework-updatable-stubs-module_libs_api", ], sdk_version: "core_platform", diff --git a/StubLibraries.bp b/StubLibraries.bp index 53053ce87bbea..d8b4e47578272 100644 --- a/StubLibraries.bp +++ b/StubLibraries.bp @@ -408,7 +408,7 @@ java_library_static { srcs: [ ":system-api-stubs-docs-non-updatable" ], static_libs: [ "conscrypt.module.public.api.stubs", - "framework-appsearch-stubs", // TODO: standardize appsearch stubs + "framework-appsearch.stubs.system", "framework-graphics.stubs.system", "framework-media.stubs.system", "framework-mediaprovider.stubs.system", diff --git a/apex/appsearch/framework/Android.bp b/apex/appsearch/framework/Android.bp index 321f471c3c8b9..e10fb074126f1 100644 --- a/apex/appsearch/framework/Android.bp +++ b/apex/appsearch/framework/Android.bp @@ -21,60 +21,17 @@ filegroup { path: "java", } -java_library { +java_sdk_library { name: "framework-appsearch", - installable: true, + srcs: [ ":framework-appsearch-sources" ], sdk_version: "core_platform", // TODO(b/146218515) should be module_current - srcs: [":framework-appsearch-sources"], - hostdex: true, // for hiddenapi check - libs: [ - "framework-minus-apex", // TODO(b/146218515) should be removed - ], + impl_only_libs: ["framework-minus-apex"], // TODO(b/146218515) should be removed static_libs: ["icing-java-proto-lite"], - visibility: [ - // TODO(b/146218515) remove this when framework is built with the stub of appsearch - "//frameworks/base", - "//frameworks/base/apex/appsearch:__subpackages__", - ], - jarjar_rules: "jarjar-rules.txt", + defaults: ["framework-module-defaults"], permitted_packages: ["android.app.appsearch"], + jarjar_rules: "jarjar-rules.txt", + aidl: { + include_dirs: ["frameworks/base/core/java"], // TODO(b/146218515) should be removed + }, apex_available: ["com.android.appsearch"], } - -metalava_appsearch_docs_args = - "--hide-package com.android.server " + - "--error UnhiddenSystemApi " + - "--hide RequiresPermission " + - "--hide MissingPermission " + - "--hide BroadcastBehavior " + - "--hide HiddenSuperclass " + - "--hide DeprecationMismatch " + - "--hide UnavailableSymbol " + - "--hide SdkConstant " + - "--hide HiddenTypeParameter " + - "--hide Todo --hide Typo " + - "--hide HiddenTypedefConstant " + - "--show-annotation android.annotation.SystemApi " - -droidstubs { - name: "framework-appsearch-stubs-srcs", - srcs: [":framework-appsearch-sources"], - libs: ["framework-annotations-lib"], - aidl: { - include_dirs: ["frameworks/base/core/java"], - }, - args: metalava_appsearch_docs_args, - sdk_version: "module_current", -} - -java_library { - name: "framework-appsearch-stubs", - srcs: [":framework-appsearch-stubs-srcs"], - aidl: { - export_include_dirs: [ - "java", - ], - }, - sdk_version: "module_current", - installable: false, -} diff --git a/apex/appsearch/framework/api/current.txt b/apex/appsearch/framework/api/current.txt new file mode 100644 index 0000000000000..d802177e249b3 --- /dev/null +++ b/apex/appsearch/framework/api/current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/appsearch/framework/api/module-lib-current.txt b/apex/appsearch/framework/api/module-lib-current.txt new file mode 100644 index 0000000000000..d802177e249b3 --- /dev/null +++ b/apex/appsearch/framework/api/module-lib-current.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/appsearch/framework/api/module-lib-removed.txt b/apex/appsearch/framework/api/module-lib-removed.txt new file mode 100644 index 0000000000000..d802177e249b3 --- /dev/null +++ b/apex/appsearch/framework/api/module-lib-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/appsearch/framework/api/removed.txt b/apex/appsearch/framework/api/removed.txt new file mode 100644 index 0000000000000..d802177e249b3 --- /dev/null +++ b/apex/appsearch/framework/api/removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/apex/appsearch/framework/api/system-current.txt b/apex/appsearch/framework/api/system-current.txt new file mode 100644 index 0000000000000..4a6194e2915db --- /dev/null +++ b/apex/appsearch/framework/api/system-current.txt @@ -0,0 +1,9 @@ +// Signature format: 2.0 +package android.app.appsearch { + + public class AppSearchManagerFrameworkInitializer { + method public static void initialize(); + } + +} + diff --git a/apex/appsearch/framework/api/system-removed.txt b/apex/appsearch/framework/api/system-removed.txt new file mode 100644 index 0000000000000..d802177e249b3 --- /dev/null +++ b/apex/appsearch/framework/api/system-removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0