From 0bdcb27970c2dc209a43a58d3e7f71a93e879c1f Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 6 Feb 2020 15:24:57 +0000 Subject: java_sdk_library_import - Allow it to replace java_sdk_library Previously a java_sdk_library_import module did not replace the corresponding java_sdk_library module, even when it was marked as prefer=true. That is because the java_sdk_library_import had an empty set of sources. However, the stubs modules that are created by the java_sdk_library_import did override the stubs modules created by the corresponding java_sdk_library module. That created inconsistent behavior between the cases where only the prebuilt is available and both source and prebuilt are available and the prebuilt is preferred. e.g. assume a java_sdk_library/import module called SDKLIB. When both prebuilt and source modules are available for SDKLIB then even if the prebuilt is preferred then any dependencies on the SDKLIB module would use the source module. This change fixes that inconsisteny by making the array of sources non-empty. Bug: 148080325 Test: m droid && TARGET_BUILD_APPS=Camera2 m Change-Id: I25395e020393921735ada20c5492f27f1260f6c5 --- java/sdk_library.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java') diff --git a/java/sdk_library.go b/java/sdk_library.go index 4b88b3f03..3c376d079 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -899,7 +899,7 @@ func sdkLibraryImportFactory() android.Module { module.AddProperties(&module.properties) - android.InitPrebuiltModule(module, &[]string{}) + android.InitPrebuiltModule(module, &[]string{""}) InitJavaModule(module, android.HostAndDeviceSupported) android.AddLoadHook(module, func(mctx android.LoadHookContext) { module.createInternalModules(mctx) }) -- cgit v1.2.3-59-g8ed1b