summaryrefslogtreecommitdiffstats
path: root/cmds/installd/installd.h
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-02-02 10:49:14 -0800
committerDianne Hackborn <hackbod@google.com>2010-02-03 15:42:02 -0800
commitb858dfda5012a1040927ed62c3bb856c3294d882 (patch)
treed865e8580e15ecda54e4fd4e891c489eb222a8b1 /cmds/installd/installd.h
parent70d10c0156f5d2d1c639d0ebe62de8ec950d4306 (diff)
downloadframeworks_base-b858dfda5012a1040927ed62c3bb856c3294d882.zip
frameworks_base-b858dfda5012a1040927ed62c3bb856c3294d882.tar.gz
frameworks_base-b858dfda5012a1040927ed62c3bb856c3294d882.tar.bz2
Implement system data migration support.
This adds three new features: - <original-package android:name="com.foo" /> manifest tag. This allows an .apk to specify another package it originally came from, propagating all state and data from the old to new package. - <adopt-permissions android:name="com.foo" /> manifest tag. In some more complicated cases, a new .apk may be a combination of multiple older .apks that each declared their own permissions. This allows you to propagate the permissions from these other .apks into the new one. - A new system/etc/updatecmds directory. You can place files here which describe data files to move from one package to another. (See below for details.) Also in this change: we now clean up the data directories of .apks that disappear from the system image, and some improvements to logging and reporting error messages. A typical file in the updatecmds directory looks like this: ------- com.google.android.gsf:com.google.android.providers.talk databases/talk.db com.google.android.gsf:com.google.android.googleapps databases/gls.db ------- This says that for com.google.android.sfs, there are two packages to move files from: From com.google.android.providers.talk, the file databases/talk.db. From com.google.android.googleapps, the file databases/gls.db As part of moving the file, its owner will be changed from the old package to whoever is the owner of the new package's data directory. If those two files had existed, after booting you would now have the files: /data/data/com.google.android.gsf/databases/talk.db /data/data/com.google.android.gsf/databases/gls.db Note that all three of these facilities assume that the older .apk is completely removed from the newer system. The WILL NOT work correctly if the older .apk still remains.
Diffstat (limited to 'cmds/installd/installd.h')
-rw-r--r--cmds/installd/installd.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h
index 35a173e..92ae310 100644
--- a/cmds/installd/installd.h
+++ b/cmds/installd/installd.h
@@ -73,6 +73,7 @@
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
#define DALVIK_CACHE_POSTFIX "/classes.dex"
+#define UPDATE_COMMANDS_DIR_PREFIX "/system/etc/updatecmds/"
#define PKG_NAME_MAX 128 /* largest allowed package name */
#define PKG_PATH_MAX 256 /* max size of any path we use */
@@ -97,6 +98,7 @@ int delete_dir_contents_fd(int dfd, const char *name);
int install(const char *pkgname, int encrypted_fs_flag, uid_t uid, gid_t gid);
int uninstall(const char *pkgname, int encrypted_fs_flag);
+int renamepkg(const char *oldpkgname, const char *newpkgname, int encrypted_fs_flag);
int delete_user_data(const char *pkgname, int encrypted_fs_flag);
int delete_cache(const char *pkgname, int encrypted_fs_flag);
int move_dex(const char *src, const char *dst);
@@ -106,3 +108,4 @@ int get_size(const char *pkgname, const char *apkpath, const char *fwdlock_apkpa
int *codesize, int *datasize, int *cachesize, int encrypted_fs_flag);
int free_cache(int free_size);
int dexopt(const char *apk_path, uid_t uid, int is_public);
+int movefiles();