Modify jar dependencies collection from dexpreopt to jar with resource
Soong build system modify the jar installed path to dexpreopt, however, the jar only contains dex without java information. This patch modify the jar collection from installed path to ImplementationJars.
Bug: 121231786
Test: 1. m aidegen
2. $ANDROID_HOST_OUT/bin/aidegen framework
3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Change-Id: I8f24f3a3476e125d3fd808e0047db425e15046ac
diff --git a/java/jdeps.go b/java/jdeps.go
index c7fa42a..2eaeab8 100644
--- a/java/jdeps.go
+++ b/java/jdeps.go
@@ -78,9 +78,9 @@
if data.Class != "" {
dpInfo.Classes = append(dpInfo.Classes, data.Class)
}
- out := data.OutputFile.String()
- if out != "" {
- dpInfo.Installed_paths = append(dpInfo.Installed_paths, out)
+
+ if dep, ok := module.(Dependency); ok {
+ dpInfo.Installed_paths = append(dpInfo.Installed_paths, dep.ImplementationJars().Strings()...)
}
dpInfo.Classes = android.FirstUniqueStrings(dpInfo.Classes)
dpInfo.Installed_paths = android.FirstUniqueStrings(dpInfo.Installed_paths)