Merge \\"Check caller\\'s uid before allowing notification policy access.\\" into mnc-dev am: 234e1c25e4
am: 8e8bb6633c
Change-Id: Ic36dbb69f0eeddd85b17579b2fc90f75349e4ca3
This commit is contained in:
@@ -1643,6 +1643,7 @@ public class NotificationManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void enforcePolicyAccess(String pkg, String method) {
|
private void enforcePolicyAccess(String pkg, String method) {
|
||||||
|
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");
|
||||||
@@ -3131,6 +3132,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