Merge "Fix issue #31403654: Elevation of privilege vulnerability in deviceidle service" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c26c98cd4a
@@ -2726,12 +2726,12 @@ public class DeviceIdleController extends SystemService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ("whitelist".equals(cmd)) {
|
} else if ("whitelist".equals(cmd)) {
|
||||||
long token = Binder.clearCallingIdentity();
|
|
||||||
try {
|
|
||||||
String arg = shell.getNextArg();
|
String arg = shell.getNextArg();
|
||||||
if (arg != null) {
|
if (arg != null) {
|
||||||
getContext().enforceCallingOrSelfPermission(
|
getContext().enforceCallingOrSelfPermission(
|
||||||
android.Manifest.permission.DEVICE_POWER, null);
|
android.Manifest.permission.DEVICE_POWER, null);
|
||||||
|
long token = Binder.clearCallingIdentity();
|
||||||
|
try {
|
||||||
do {
|
do {
|
||||||
if (arg.length() < 1 || (arg.charAt(0) != '-'
|
if (arg.length() < 1 || (arg.charAt(0) != '-'
|
||||||
&& arg.charAt(0) != '+' && arg.charAt(0) != '=')) {
|
&& arg.charAt(0) != '+' && arg.charAt(0) != '=')) {
|
||||||
@@ -2754,6 +2754,9 @@ public class DeviceIdleController extends SystemService
|
|||||||
pw.println(getPowerSaveWhitelistAppInternal(pkg));
|
pw.println(getPowerSaveWhitelistAppInternal(pkg));
|
||||||
}
|
}
|
||||||
} while ((arg=shell.getNextArg()) != null);
|
} while ((arg=shell.getNextArg()) != null);
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
for (int j=0; j<mPowerSaveWhitelistAppsExceptIdle.size(); j++) {
|
for (int j=0; j<mPowerSaveWhitelistAppsExceptIdle.size(); j++) {
|
||||||
@@ -2776,9 +2779,6 @@ public class DeviceIdleController extends SystemService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
Binder.restoreCallingIdentity(token);
|
|
||||||
}
|
|
||||||
} else if ("tempwhitelist".equals(cmd)) {
|
} else if ("tempwhitelist".equals(cmd)) {
|
||||||
String opt;
|
String opt;
|
||||||
while ((opt=shell.getNextOption()) != null) {
|
while ((opt=shell.getNextOption()) != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user