summaryrefslogtreecommitdiff
path: root/java/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/app.go')
-rw-r--r--java/app.go22
1 files changed, 17 insertions, 5 deletions
diff --git a/java/app.go b/java/app.go
index abbf034fa..a634f9c32 100644
--- a/java/app.go
+++ b/java/app.go
@@ -512,10 +512,14 @@ func (a *AndroidApp) checkJniLibsSdkVersion(ctx android.ModuleContext, minSdkVer
// The domain of cc.sdk_version is "current" and <number>
// We can rely on android.SdkSpec to convert it to <number> so that "current" is
// handled properly regardless of sdk finalization.
- jniSdkVersion, err := android.SdkSpecFrom(ctx, commonInfo.MinSdkVersion).EffectiveVersion(ctx)
+ ver := ""
+ if !commonInfo.MinSdkVersion.IsPlatform {
+ ver = commonInfo.MinSdkVersion.ApiLevel.String()
+ }
+ jniSdkVersion, err := android.SdkSpecFrom(ctx, ver).EffectiveVersion(ctx)
if err != nil || minSdkVersion.LessThan(jniSdkVersion) {
ctx.OtherModuleErrorf(m, "min_sdk_version(%v) is higher than min_sdk_version(%v) of the containing android_app(%v)",
- commonInfo.MinSdkVersion, minSdkVersion, ctx.ModuleName())
+ ver, minSdkVersion, ctx.ModuleName())
return
}
@@ -1256,7 +1260,7 @@ func (a *AndroidApp) WalkPayloadDeps(ctx android.BaseModuleContext, do android.P
// TODO(ccross): Should this use android.DepIsInSameApex? Right now it is applying the android app
// heuristics to every transitive dependency, when it should probably be using the heuristics of the
// immediate parent.
- isExternal := !a.OutgoingDepIsInSameApex(ctx.OtherModuleDependencyTag(child))
+ isExternal := !a.GetDepInSameApexChecker().OutgoingDepIsInSameApex(ctx.OtherModuleDependencyTag(child))
if am, ok := child.(android.ApexModule); ok {
if !do(ctx, parent, am, isExternal) {
return false
@@ -1333,11 +1337,19 @@ func (a *AndroidApp) getCertString(ctx android.BaseModuleContext) string {
return a.overridableAppProperties.Certificate.GetOrDefault(ctx, "")
}
-func (a *AndroidApp) OutgoingDepIsInSameApex(tag blueprint.DependencyTag) bool {
+func (m *AndroidApp) GetDepInSameApexChecker() android.DepInSameApexChecker {
+ return AppDepInSameApexChecker{}
+}
+
+type AppDepInSameApexChecker struct {
+ android.BaseDepInSameApexChecker
+}
+
+func (m AppDepInSameApexChecker) OutgoingDepIsInSameApex(tag blueprint.DependencyTag) bool {
if IsJniDepTag(tag) {
return true
}
- return a.Library.OutgoingDepIsInSameApex(tag)
+ return depIsInSameApex(tag)
}
func (a *AndroidApp) Privileged() bool {