Let callers specify which storage to operate on.

Since CE and DE storage can have different availability lifecycles,
callers can't operate on both at the same time.  Let them use flags
to specify which storage to work with.

Remove old unused methods, and name consistently in preparation for
eventual move to AIDL.

Bug: 26466827
Change-Id: Id5d7d03f5d8814864eea801f5a46496c085afdff
diff --git a/cmds/installd/commands.h b/cmds/installd/commands.h
index 55a6e62..5510e7b 100644
--- a/cmds/installd/commands.h
+++ b/cmds/installd/commands.h
@@ -28,28 +28,24 @@
 namespace android {
 namespace installd {
 
-int install(const char *uuid, const char *pkgname, uid_t uid, gid_t gid, const char *seinfo);
-int uninstall(const char *uuid, const char *pkgname, userid_t userid);
-int renamepkg(const char *oldpkgname, const char *newpkgname);
-int fix_uid(const char *uuid, const char *pkgname, uid_t uid, gid_t gid);
-int delete_user_data(const char *uuid, const char *pkgname, userid_t userid);
-int make_user_data(const char *uuid, const char *pkgname, uid_t uid,
-        userid_t userid, const char* seinfo);
-int copy_complete_app(const char* from_uuid, const char *to_uuid,
-        const char *package_name, const char *data_app_name, appid_t appid,
-        const char* seinfo);
+int create_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags,
+        appid_t appid, const char* seinfo);
+int restorecon_app_data(const char* uuid, const char* pkgName, userid_t userid, int flags,
+        appid_t appid, const char* seinfo);
+int clear_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags);
+int destroy_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags);
+
+int move_complete_app(const char* from_uuid, const char *to_uuid, const char *package_name,
+        const char *data_app_name, appid_t appid, const char* seinfo);
+
+int get_app_size(const char *uuid, const char *pkgname, int userid, int flags,
+        const char *apkpath, const char *libdirpath, const char *fwdlock_apkpath,
+        const char *asecpath, const char *instruction_set, int64_t *codesize, int64_t *datasize,
+        int64_t *cachesize, int64_t *asecsize);
+
 int make_user_config(userid_t userid);
 int delete_user(const char *uuid, userid_t userid);
-int delete_cache(const char *uuid, const char *pkgname, userid_t userid);
-int delete_code_cache(const char *uuid, const char *pkgname, userid_t userid);
-int move_dex(const char *src, const char *dst, const char *instruction_set);
 int rm_dex(const char *path, const char *instruction_set);
-int protect(char *pkgname, gid_t gid);
-int get_size(const char *uuid, const char *pkgname, int userid,
-        const char *apkpath, const char *libdirpath,
-        const char *fwdlock_apkpath, const char *asecpath,
-        const char *instruction_set, int64_t *codesize, int64_t *datasize,
-        int64_t *cachesize, int64_t *asecsize);
 int free_cache(const char *uuid, int64_t free_size);
 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);
@@ -57,11 +53,8 @@
 int movefiles();
 int linklib(const char* uuid, const char* pkgname, const char* asecLibDir, int userId);
 int idmap(const char *target_path, const char *overlay_path, uid_t uid);
-int restorecon_data(const char *uuid, const char* pkgName, const char* seinfo, uid_t uid);
 int create_oat_dir(const char* oat_dir, const char *instruction_set);
 int rm_package_dir(const char* apk_path);
-int move_package_dir(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path,
-                            const char *instruction_set);
 int link_file(const char *relative_path, const char *from_base, const char *to_base);
 
 }  // namespace installd