From a76d6606ce8e43f5b4a15a7ff21471f9f83d3d9d Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Tue, 16 Mar 2021 15:34:50 +0000 Subject: [PATCH] Don't depend on nonexistent manifest when manifest_check is disabled. This is a follow-up for https://android-review.googlesource.com/1614807. Bug: 132357300 Test: lunch aosp_cf_x86_64_phone-userdebug && m Test: lunch qemu_trusty_arm64-userdebug && \ m out/soong/.intermediates/packages/apps/DocumentsUI/DocumentsUI/android_common/DocumentsUI-unsigned.apk Change-Id: I84c5d171bd976f35f342abd94b592506c71e4b1d --- java/app.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/app.go b/java/app.go index 0c1c717a6..bc2a5010f 100755 --- a/java/app.go +++ b/java/app.go @@ -1286,7 +1286,7 @@ func (u *usesLibrary) freezeEnforceUsesLibraries() { // an APK with the manifest embedded in it (manifest_check will know which one it is by the file // extension: APKs are supposed to end with '.apk'). func (u *usesLibrary) verifyUsesLibraries(ctx android.ModuleContext, inputFile android.Path, - outputFile android.WritablePath) { + outputFile android.WritablePath) android.Path { statusFile := dexpreopt.UsesLibrariesStatusFile(ctx) @@ -1295,7 +1295,7 @@ func (u *usesLibrary) verifyUsesLibraries(ctx android.ModuleContext, inputFile a // non-linux build platforms where dexpreopt is generally disabled (the check may fail due to // various unrelated reasons, such as a failure to get manifest from an APK). if dexpreopt.GetGlobalConfig(ctx).DisablePreopt { - return + return inputFile } rule := android.NewRuleBuilder(pctx, ctx) @@ -1322,14 +1322,14 @@ func (u *usesLibrary) verifyUsesLibraries(ctx android.ModuleContext, inputFile a } rule.Build("verify_uses_libraries", "verify ") + return outputFile } // verifyUsesLibrariesManifest checks the tags in an AndroidManifest.xml against // the build system and returns the path to a copy of the manifest. func (u *usesLibrary) verifyUsesLibrariesManifest(ctx android.ModuleContext, manifest android.Path) android.Path { outputFile := android.PathForModuleOut(ctx, "manifest_check", "AndroidManifest.xml") - u.verifyUsesLibraries(ctx, manifest, outputFile) - return outputFile + return u.verifyUsesLibraries(ctx, manifest, outputFile) } // verifyUsesLibrariesAPK checks the tags in the manifest of an APK against the build