If a profile is passed, we should always pass output-vdex and input-vdex.

Passing only input-vdex means the vdex will be updated in place, which
is not something we do with a profile in production.

Test: 629-vdex

(cherry picked from commit fbc4f118aff7c284f0d9d2ca209166b7ff79e542)

Change-Id: Ie7afabe7e017476fe5347781f304043db2555462
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index f8b008b..6e13aad 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -585,7 +585,9 @@
     # Use -k 1m to SIGKILL it a minute later if it hasn't ended.
     dex2oat_cmdline="timeout -k 1m -s SIGRTMIN+2 1m ${dex2oat_cmdline}"
   fi
-  if [ "$TEST_VDEX" = "y" ]; then
+  if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then
+    vdex_cmdline="${dex2oat_cmdline} ${VDEX_FILTER} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex --output-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex"
+  elif [ "$TEST_VDEX" = "y" ]; then
     vdex_cmdline="${dex2oat_cmdline} ${VDEX_FILTER} --input-vdex=$DEX_LOCATION/oat/$ISA/$TEST_NAME.vdex"
   fi
 fi