Revert "Revert "[dexopt] Allow secondary dex files to generate app images""

Reason for revert: Breaking up the original topic into individual CLs so
that we can merge non-broken code sooner (and fix/merge the broken test
on its own).
Reverted Changes:
Ic30045e59: Revert "[dexopt] Allow secondary dex files to gene...

Test: adb shell pm bg-dexopt-job with app installed that uses secondary
dexes, verify app image is generated for secondary image. Launch app and
verify no class linker/class loader/image space warnings in logcat

(cherry-picked from commit b79acc02221cc4573708ae29aac0cd3281d34520)
Bug: 149098478

Merged-In: Id6e633fb95798041df75e0e3e8b926aa6038a9ac
Change-Id: Id6e633fb95798041df75e0e3e8b926aa6038a9ac
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 70bbc33..1af6edd 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -1273,11 +1273,6 @@
 Dex2oatFileWrapper maybe_open_app_image(const char* out_oat_path,
         bool generate_app_image, bool is_public, int uid, bool is_secondary_dex) {
 
-    // We don't create an image for secondary dex files.
-    if (is_secondary_dex) {
-        return Dex2oatFileWrapper();
-    }
-
     const std::string image_path = create_image_filename(out_oat_path);
     if (image_path.empty()) {
         // Happens when the out_oat_path has an unknown extension.