Honor PreventInstall for APKs and dexpreopt files

Native coverage builds create a second variant of APKs and set
PreventInstall on the non-coverage variant.  Skip calling
ctx.InstallFile for APKs and in dexpreopt when PreventInstall
is set.

Fixes: 205865567
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="*" NATIVE_COVERAGE_EXCLUDE_PATHS="art bionic/libc device external/compiler-rt external/clang external/llvm external/swiftshader/third_party/llvm-10.0"
Change-Id: I9e38ac737315db12475e8f9bfb3e0e7c0327fc06
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 8ab5a45..7c081b6 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -66,6 +66,7 @@
 	isApp               bool
 	isTest              bool
 	isPresignedPrebuilt bool
+	preventInstall      bool
 
 	manifestFile        android.Path
 	statusFile          android.WritablePath
@@ -356,7 +357,7 @@
 				installDirOnDevice:  installPath,
 				installFileOnDevice: installBase,
 			})
-		} else {
+		} else if !d.preventInstall {
 			ctx.InstallFile(installPath, installBase, install.From)
 		}
 	}