Convert stubLibraries, soongMetricsSingleton, sdkSingleton,
complianceMetadataSingleton, freezeApiSingleton and testSuiteFiles to
use ModuleProxy.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I91789633ff0d4e0ab170717caf0a6b4f63c38593
diff --git a/android/prebuilt.go b/android/prebuilt.go
index 6b076b7..7273599 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -357,6 +357,17 @@
return true
}
+func IsModulePreferredProxy(ctx OtherModuleProviderContext, module ModuleProxy) bool {
+ if OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).ReplacedByPrebuilt {
+ // A source module that has been replaced by a prebuilt counterpart.
+ return false
+ }
+ if p, ok := OtherModuleProvider(ctx, module, PrebuiltModuleInfoProvider); ok {
+ return p.UsePrebuilt
+ }
+ return true
+}
+
// IsModulePrebuilt returns true if the module implements PrebuiltInterface and
// has been initialized as a prebuilt and so returns a non-nil value from the
// PrebuiltInterface.Prebuilt() method.