Check uid for notification policy access.

Bug: 29421441
Change-Id: Ia0a7b06112dde1c925ec3232f50bf4d90b17b5e5
This commit is contained in:
Julia Reynolds
2016-06-29 08:43:00 -04:00
parent bbadc5d313
commit 0cd1b78956

View File

@@ -1997,6 +1997,7 @@ public class NotificationManagerService extends SystemService {
android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
return;
}
checkCallerIsSameApp(pkg);
if (!checkPolicyAccess(pkg)) {
Slog.w(TAG, "Notification policy access denied calling " + method);
throw new SecurityException("Notification policy access denied");
@@ -3655,6 +3656,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(