Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2256fd4e11
@@ -1631,6 +1631,11 @@ public class NotificationManagerService extends SystemService {
|
||||
@Override
|
||||
public boolean areNotificationsEnabledForPackage(String pkg, int uid) {
|
||||
checkCallerIsSystemOrSameApp(pkg);
|
||||
if (UserHandle.getCallingUserId() != UserHandle.getUserId(uid)) {
|
||||
getContext().enforceCallingPermission(
|
||||
android.Manifest.permission.INTERACT_ACROSS_USERS,
|
||||
"canNotifyAsPackage for uid " + uid);
|
||||
}
|
||||
|
||||
return mRankingHelper.getImportance(pkg, uid) != IMPORTANCE_NONE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user