From afd3d11a795b9f331637d3587a94142f20e8c55d Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 8 Jun 2020 19:24:09 +0900 Subject: [PATCH] dex_import that isn't available for platform isn't installed This change fixes a bug that dex_import module is always installed to the platform even when the module is not available to the platform. Bug: 158284983 Test: OUT_DIR=/tmp/ndk build/soong/scripts/build-ndk-prebuilts.sh Change-Id: I85570506e700be59ee63e4f1d7902a40e36df39c --- java/java.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/java.go b/java/java.go index f2f47b7d0..b0865040e 100644 --- a/java/java.go +++ b/java/java.go @@ -2741,8 +2741,10 @@ func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.maybeStrippedDexJarFile = dexOutputFile - ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), - j.Stem()+".jar", dexOutputFile) + if j.IsForPlatform() { + ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), + j.Stem()+".jar", dexOutputFile) + } } func (j *DexImport) DexJar() android.Path {