Add dex_import module type
Add a module type for importing a prebuilt jar that contains
classes.dex files.
Test: m with a prebuilt jar that contains classes.dex files in
PRODUCT_BOOT_JARS
Test: java_test.go, dexpreopt_test.go, dexpreopt_bootjars_test.go
Bug: 124804356
Bug: 125517186
Change-Id: I496848f9dca11f758d49b1cb68168cec7f8e1718
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 64de21a..a23b477 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -152,7 +152,7 @@
ctx.VisitAllModules(func(module android.Module) {
// Collect dex jar paths for the modules listed above.
- if j, ok := module.(Dependency); ok {
+ if j, ok := module.(interface{ DexJar() android.Path }); ok {
name := ctx.ModuleName(module)
if i := android.IndexList(name, image.modules); i != -1 {
bootDexJars[i] = j.DexJar()