Merge "Check uid for notification policy access." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8f17d2a48b
@@ -1983,6 +1983,7 @@ public class NotificationManagerService extends SystemService {
|
|||||||
android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
|
android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
checkCallerIsSameApp(pkg);
|
||||||
if (!checkPolicyAccess(pkg)) {
|
if (!checkPolicyAccess(pkg)) {
|
||||||
Slog.w(TAG, "Notification policy access denied calling " + method);
|
Slog.w(TAG, "Notification policy access denied calling " + method);
|
||||||
throw new SecurityException("Notification policy access denied");
|
throw new SecurityException("Notification policy access denied");
|
||||||
@@ -3643,6 +3644,10 @@ public class NotificationManagerService extends SystemService {
|
|||||||
if (isCallerSystem()) {
|
if (isCallerSystem()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
checkCallerIsSameApp(pkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkCallerIsSameApp(String pkg) {
|
||||||
final int uid = Binder.getCallingUid();
|
final int uid = Binder.getCallingUid();
|
||||||
try {
|
try {
|
||||||
ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(
|
ApplicationInfo ai = AppGlobals.getPackageManager().getApplicationInfo(
|
||||||
|
|||||||
Reference in New Issue
Block a user