diff options
Diffstat (limited to 'cmds/installd/commands.c')
-rw-r--r-- | cmds/installd/commands.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 5cd2593..344a5a3 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -20,6 +20,7 @@ #include <cutils/sched_policy.h> #include <diskusage/dirsize.h> #include <selinux/android.h> +#include <system/thread_defs.h> /* Directory records that are used in execution of commands. */ dir_rec_t android_data_dir; @@ -1029,6 +1030,10 @@ int dexopt(const char *apk_path, uid_t uid, bool is_public, ALOGE("set_sched_policy failed: %s\n", strerror(errno)); exit(70); } + if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) { + ALOGE("setpriority failed: %s\n", strerror(errno)); + exit(71); + } if (flock(out_fd, LOCK_EX | LOCK_NB) != 0) { ALOGE("flock(%s) failed: %s\n", out_path, strerror(errno)); exit(67); @@ -1076,6 +1081,21 @@ fail: return -1; } +int mark_boot_complete(const char* instruction_set) +{ + char boot_marker_path[PKG_PATH_MAX]; + sprintf(boot_marker_path,"%s%s/.booting", DALVIK_CACHE_PREFIX, instruction_set); + + ALOGV("mark_boot_complete : %s", boot_marker_path); + if (unlink(boot_marker_path) != 0) { + ALOGE("Unable to unlink boot marker at %s, error=%s", boot_marker_path, + strerror(errno)); + return -1; + } + + return 0; +} + void mkinnerdirs(char* path, int basepos, mode_t mode, int uid, int gid, struct stat* statbuf) { |