Installd: don't generate app image without reference profile

Use app images only if we are compiling profile-guided
and reference profile exists.

Fixed test logic to use a dm_file so that the profile is actually
opened by dexopt.cpp.

Test: adb install xxx.apk & check if app image file exists
Bug: 112860306
Change-Id: I50375a9d9213ee1e7b1fffbdd69c8510f509e008
Signed-off-by: liulvping <liulvping@xiaomi.com>
diff --git a/cmds/installd/tests/Android.bp b/cmds/installd/tests/Android.bp
index aa79fdc..bd45005 100644
--- a/cmds/installd/tests/Android.bp
+++ b/cmds/installd/tests/Android.bp
@@ -89,6 +89,8 @@
         "libinstalld",
         "liblog",
         "liblogwrap",
+        "libziparchive",
+        "libz",
     ],
     test_config: "installd_dexopt_test.xml",
 }