Merge \"Check caller\'s uid before allowing notification policy access.\" into mnc-dev

am: 234e1c25e4

Change-Id: I6724832d28362a76cd2f65432d6e805738f335fa
This commit is contained in:
Julia Reynolds
2016-07-15 14:06:49 +00:00
committed by android-build-merger

View File

@@ -1642,6 +1642,7 @@ public class NotificationManagerService extends SystemService {
}
private void enforcePolicyAccess(String pkg, String method) {
checkCallerIsSameApp(pkg);
if (!checkPolicyAccess(pkg)) {
Slog.w(TAG, "Notification policy access denied calling " + method);
throw new SecurityException("Notification policy access denied");
@@ -3130,6 +3131,10 @@ public class NotificationManagerService extends SystemService {
if (isCallerSystem()) {
return;
}
checkCallerIsSameApp(pkg);
}
private static void checkCallerIsSameApp(String pkg) {
final int uid = Binder.getCallingUid();
try {
ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(