Split all dexopt-related code into dexopt.cpp.

Only a few minor changes to return bool instead of binder::Status.

Test: builds, boots, apps install/uninstall fine
Change-Id: I538024c0e9da8ca2c0983a6e779c34bd40752053
diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h
index 1bfef02..1115c78 100644
--- a/cmds/installd/dexopt.h
+++ b/cmds/installd/dexopt.h
@@ -19,9 +19,31 @@
 
 #include <sys/types.h>
 
+#include <cutils/multiuser.h>
+
 namespace android {
 namespace installd {
 
+/* dexopt needed flags matching those in dalvik.system.DexFile */
+static constexpr int DEX2OAT_FROM_SCRATCH        = 1;
+static constexpr int DEX2OAT_FOR_BOOT_IMAGE      = 2;
+static constexpr int DEX2OAT_FOR_FILTER          = 3;
+static constexpr int DEX2OAT_FOR_RELOCATION      = 4;
+static constexpr int PATCHOAT_FOR_RELOCATION     = 5;
+
+typedef int fd_t;
+
+bool clear_reference_profile(const char* pkgname);
+bool clear_current_profile(const char* pkgname, userid_t user);
+bool clear_current_profiles(const char* pkgname);
+
+bool move_ab(const char* apk_path, const char* instruction_set, const char* output_path);
+
+bool analyse_profiles(uid_t uid, const char* pkgname);
+bool dump_profiles(int32_t uid, const char* pkgname, const char* code_paths);
+
+bool delete_odex(const char* apk_path, const char* instruction_set, const char* output_path);
+
 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);