diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 0a307c9d8..f2d8befe9 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -20,6 +20,7 @@ #include #include #include +#include /* Directory records that are used in execution of commands. */ dir_rec_t android_data_dir; @@ -1017,6 +1018,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);