diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
commit | d24b8183b93e781080b2c16c487e60d51c12da31 (patch) | |
tree | fbb89154858984eb8e41556da7e9433040d55cd4 /cmds | |
parent | f1e484acb594a726fb57ad0ae4cfe902c7f35858 (diff) | |
download | frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.zip frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.gz frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.bz2 |
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/dumpstate/dumpstate.c | 2 | ||||
-rw-r--r-- | cmds/installd/commands.c | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c index dea269d..4621f57 100644 --- a/cmds/dumpstate/dumpstate.c +++ b/cmds/dumpstate/dumpstate.c @@ -224,6 +224,8 @@ int main(int argc, char *argv[]) { } if (compress) strcat(path, ".gz"); + else + strcat(path, ".txt"); /* ensure that all directories in the path exist */ create_directories(path); diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index a3651b2..70a1206 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -413,7 +413,8 @@ int create_cache_path(char path[PKG_PATH_MAX], const char *src) return 0; } -static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name) +static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name, + const char* dexopt_flags) { static const char* DEX_OPT_BIN = "/system/bin/dexopt"; static const int MAX_INT_LEN = 12; // '-'+10dig+'\0' -OR- 0x+8dig @@ -424,7 +425,7 @@ static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name) sprintf(odex_num, "%d", odex_fd); execl(DEX_OPT_BIN, DEX_OPT_BIN, "--zip", zip_num, odex_num, input_file_name, - (char*) NULL); + dexopt_flags, (char*) NULL); LOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno)); } @@ -465,6 +466,7 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) struct utimbuf ut; struct stat apk_stat, dex_stat; char dex_path[PKG_PATH_MAX]; + char dexopt_flags[PROPERTY_VALUE_MAX]; char *end; int res, zip_fd=-1, odex_fd=-1; @@ -475,6 +477,9 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) return -1; } + /* platform-specific flags affecting optimization and verification */ + property_get("dalvik.vm.dexopt-flags", dexopt_flags, ""); + strcpy(dex_path, apk_path); end = strrchr(dex_path, '.'); if (end != NULL) { @@ -533,8 +538,8 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) exit(66); } - run_dexopt(zip_fd, odex_fd, apk_path); /* does not return */ - exit(67); + run_dexopt(zip_fd, odex_fd, apk_path, dexopt_flags); + exit(67); /* only get here on exec failure */ } else { res = wait_dexopt(pid, apk_path); if (res != 0) { |