Touch up manifest if there's no source code.
The new package manager behavior requires packages without source code
to have an application element with hasCode attribute set to false in
their manifest. With this change, Soong can now automatically insert one
for codeless apps.
Test: app_test.go, manifest_fixer_test.py
Fixes: 124375490
Change-Id: Ied89a8d07c63805ab910859a4f7c45fc1c60bb73
diff --git a/java/aar.go b/java/aar.go
index 65a7c2a..1b84a47 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -85,6 +85,7 @@
useEmbeddedDex bool
usesNonSdkApis bool
sdkLibraries []string
+ hasNoCode bool
splitNames []string
splits []split
@@ -204,7 +205,7 @@
manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)
manifestPath := manifestFixer(ctx, manifestSrcPath, sdkContext, sdkLibraries,
- a.isLibrary, a.useEmbeddedNativeLibs, a.usesNonSdkApis, a.useEmbeddedDex)
+ a.isLibrary, a.useEmbeddedNativeLibs, a.usesNonSdkApis, a.useEmbeddedDex, a.hasNoCode)
a.transitiveManifestPaths = append(android.Paths{manifestPath}, transitiveStaticLibManifests...)