Manifest Fixer Params code refactor
This CL refactors the code related to ManifestFixer parameters.
The required parameters android.ModuleContext, manifest android.Path are
passed separately as the parameters and the optional parameters are
kept as part of the ManifestFixerParams struct.
By default, the member variable of struct have the zero (nil, false,
empty string) values. Hence, it is only required to pass the
parameters of interest at the time of function call to
ManifestFixer.
Manual testing done to check the working of the code.
Test: m nothing && m test_com.android.sdkext
Test: manually tested the generation of AndroidManifest in the out
directory with the testOnly attribute
Test: atest manifest_fixer_test --host
To test the existing unittests are not breaking.
Change-Id: I20cb6c06c57f8fe7811050288bcb03945dc0425b
diff --git a/java/aar.go b/java/aar.go
index 51aad8d..8e10253 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -280,9 +280,7 @@
manifestFile := proptools.StringDefault(a.aaptProperties.Manifest, "AndroidManifest.xml")
manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile)
- manifestPath := ManifestFixer(ManifestFixerParams{
- Ctx: ctx,
- Manifest: manifestSrcPath,
+ manifestPath := ManifestFixer(ctx, manifestSrcPath, ManifestFixerParams{
SdkContext: sdkContext,
ClassLoaderContexts: classLoaderContexts,
IsLibrary: a.isLibrary,
@@ -290,7 +288,6 @@
UsesNonSdkApis: a.usesNonSdkApis,
UseEmbeddedDex: a.useEmbeddedDex,
HasNoCode: a.hasNoCode,
- TestOnly: false,
LoggingParent: a.LoggingParent,
})