fix swapped min / max in priority parsing

- This error led into not handling highest priority,
  which made zygote's priority boost no-op

bug: 32718256
Test: check init log during bootup

Change-Id: I959eb94912a9c1d95bfdb98ee675fdd12cf85699
This commit is contained in:
Keun-young Park 2016-11-11 18:06:31 -08:00
parent 84db3f19bc
commit dd34ca45ea

View file

@ -357,8 +357,8 @@ bool Service::ParseGroup(const std::vector<std::string>& args, std::string* err)
bool Service::ParsePriority(const std::vector<std::string>& args, std::string* err) {
priority_ = 0;
if (!ParseInt(args[1], &priority_,
static_cast<int>(ANDROID_PRIORITY_LOWEST),
static_cast<int>(ANDROID_PRIORITY_HIGHEST))) {
static_cast<int>(ANDROID_PRIORITY_HIGHEST), // highest is negative
static_cast<int>(ANDROID_PRIORITY_LOWEST))) {
*err = StringPrintf("process priority value must be range %d - %d",
ANDROID_PRIORITY_HIGHEST, ANDROID_PRIORITY_LOWEST);
return false;