Merge "Fix multiuser access to setNotificationPolicy"

This commit is contained in:
Julia Reynolds
2020-07-10 13:16:28 +00:00
committed by Android (Google) Code Review

View File

@@ -4674,10 +4674,11 @@ public class NotificationManagerService extends SystemService {
@Override
public void setNotificationPolicy(String pkg, Policy policy) {
enforcePolicyAccess(pkg, "setNotificationPolicy");
int callingUid = Binder.getCallingUid();
final long identity = Binder.clearCallingIdentity();
try {
final ApplicationInfo applicationInfo = mPackageManager.getApplicationInfo(pkg,
0, UserHandle.getUserId(MY_UID));
0, UserHandle.getUserId(callingUid));
Policy currPolicy = mZenModeHelper.getNotificationPolicy();
if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.P) {