Merge "installd: Set priority to background for dexopting" into lmp-mr1-dev

This commit is contained in:
Igor Murashkin 2014-11-06 02:43:56 +00:00 committed by Android (Google) Code Review
commit 106e582053

View File

@ -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;
@ -985,6 +986,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);