summaryrefslogtreecommitdiff
path: root/java/aar.go
diff options
context:
space:
mode:
author Gurpreet Singh <gurpreetgs@google.com> 2022-01-24 17:44:05 +0000
committer Gurpreet Singh <gurpreetgs@google.com> 2022-02-01 12:03:48 +0000
commit75d65f360c18806e683aed87679ce5bcc52823d4 (patch)
tree12fc747a1cc501f24995891bc91ccd84893cea24 /java/aar.go
parent2d305010af8f36a6b5d45560f5304094a3e0a765 (diff)
Add testOnly attribute to AndroidManifest file of apex_test
If the build file contains the apex_test module, add the testOnly attribute to the application element of the corresponding AndroidManifest file and set its value to true. If the testOnly attribute is already present and has value false, then do nothing. Tests added in manifest_fixer_test.py to check if the updated AndroidManifest file has the testOnly attribute set to true or not. Bug: 213310150 Test: atest --host manifest_fixer_test Test: m nothing Test: manually checked the AndroidManifest file generated Change-Id: I36247dbe0261c342d451a4422c314fd8fe0c2369
Diffstat (limited to 'java/aar.go')
-rw-r--r--java/aar.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/java/aar.go b/java/aar.go
index aabbec6a3..4687424c2 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -276,9 +276,19 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext android.SdkCon
manifestFile := proptools.StringDefault(a.aaptProperties.Manifest, "AndroidManifest.xml")
manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)
- manifestPath := manifestFixer(ctx, manifestSrcPath, sdkContext, classLoaderContexts,
- a.isLibrary, a.useEmbeddedNativeLibs, a.usesNonSdkApis, a.useEmbeddedDex, a.hasNoCode,
- a.LoggingParent)
+ manifestPath := ManifestFixer(ManifestFixerParams{
+ Ctx: ctx,
+ Manifest: manifestSrcPath,
+ SdkContext: sdkContext,
+ ClassLoaderContexts: classLoaderContexts,
+ IsLibrary: a.isLibrary,
+ UseEmbeddedNativeLibs: a.useEmbeddedNativeLibs,
+ UsesNonSdkApis: a.usesNonSdkApis,
+ UseEmbeddedDex: a.useEmbeddedDex,
+ HasNoCode: a.hasNoCode,
+ TestOnly: false,
+ LoggingParent: a.LoggingParent,
+ })
// Add additional manifest files to transitive manifests.
additionalManifests := android.PathsForModuleSrc(ctx, a.aaptProperties.Additional_manifests)