[Installd] Clean up logic for secondary dex oat files

Add a new method to installd, reconcileSecondaryOdex, which checks if
the given dex files still exist and if not, deletes the oat files that
were generated for it.

Test: devices bots
      adb shell cmd package reconcile-secondary-dex
com.android.google.gms (after artificially/temporarily renaming some
dex files)

Bug: 32871170

(cherry picked from commit bd9683607d391a29b1422a50f8972267e9bddc47)

Change-Id: Icb5c71b43a0e531d5be5d900149e707d0fe0a8de

Merged-In: I8465a7be9fd4e44e191ad40f7bd0f41c8b2d6f73
diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h
index 94eddf2..7bb6eee 100644
--- a/cmds/installd/dexopt.h
+++ b/cmds/installd/dexopt.h
@@ -45,6 +45,11 @@
 
 bool delete_odex(const char* apk_path, const char* instruction_set, const char* output_path);
 
+bool reconcile_secondary_dex_file(const std::string& dex_path,
+        const std::string& pkgname, int uid, const std::vector<std::string>& isas,
+        const std::unique_ptr<std::string>& volumeUuid, int storage_flag,
+        /*out*/bool* out_secondary_dex_exists);
+
 int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set,
         int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter,
         const char* volume_uuid, const char* shared_libraries);