Merge changes I4e1861ea,Ic99b7333 into rvc-dev
* changes:
java_sdk_library: Path extraction from deps depend on tag
Expand SystemApi annotation for generating system api
diff --git a/java/app.go b/java/app.go
index d9f9769..156deb8 100755
--- a/java/app.go
+++ b/java/app.go
@@ -178,6 +178,8 @@
noticeOutputs android.NoticeOutputs
overriddenManifestPackageName string
+
+ android.ApexBundleDepsInfo
}
func (a *AndroidApp) IsInstallable() bool {
@@ -633,6 +635,8 @@
ctx.InstallFile(a.installDir, extra.Base(), extra)
}
}
+
+ a.buildAppDependencyInfo(ctx)
}
func collectAppDeps(ctx android.ModuleContext, shouldCollectRecursiveNativeDeps bool,
@@ -701,6 +705,49 @@
return jniLibs, certificates
}
+func (a *AndroidApp) walkPayloadDeps(ctx android.ModuleContext,
+ do func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool)) {
+
+ ctx.WalkDeps(func(child, parent android.Module) bool {
+ isExternal := !a.DepIsInSameApex(ctx, child)
+ if am, ok := child.(android.ApexModule); ok {
+ do(ctx, parent, am, isExternal)
+ }
+ return !isExternal
+ })
+}
+
+func (a *AndroidApp) buildAppDependencyInfo(ctx android.ModuleContext) {
+ if ctx.Host() {
+ return
+ }
+
+ depsInfo := android.DepNameToDepInfoMap{}
+ a.walkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) {
+ depName := to.Name()
+ if info, exist := depsInfo[depName]; exist {
+ info.From = append(info.From, from.Name())
+ info.IsExternal = info.IsExternal && externalDep
+ depsInfo[depName] = info
+ } else {
+ toMinSdkVersion := "(no version)"
+ if m, ok := to.(interface{ MinSdkVersion() string }); ok {
+ if v := m.MinSdkVersion(); v != "" {
+ toMinSdkVersion = v
+ }
+ }
+ depsInfo[depName] = android.ApexModuleDepInfo{
+ To: depName,
+ From: []string{from.Name()},
+ IsExternal: externalDep,
+ MinSdkVersion: toMinSdkVersion,
+ }
+ }
+ })
+
+ a.ApexBundleDepsInfo.BuildDepsInfoLists(ctx, a.MinSdkVersion(), depsInfo)
+}
+
func (a *AndroidApp) getCertString(ctx android.BaseModuleContext) string {
certificate, overridden := ctx.DeviceConfig().OverrideCertificateFor(ctx.ModuleName())
if overridden {
diff --git a/java/app_builder.go b/java/app_builder.go
index e8c16c2..967c55f 100644
--- a/java/app_builder.go
+++ b/java/app_builder.go
@@ -87,6 +87,7 @@
if lineageFile != nil {
flags = append(flags, "--lineage", lineageFile.String())
+ deps = append(deps, lineageFile)
}
ctx.Build(pctx, android.BuildParams{