Merge "[RESTRICT_AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage" into oc-dev
am: 2256fd4e11
Change-Id: I1658f2dc59428265adf385ec2e9c579abbefb023
This commit is contained in:
@@ -1639,6 +1639,11 @@ public class NotificationManagerService extends SystemService {
|
|||||||
@Override
|
@Override
|
||||||
public boolean areNotificationsEnabledForPackage(String pkg, int uid) {
|
public boolean areNotificationsEnabledForPackage(String pkg, int uid) {
|
||||||
checkCallerIsSystemOrSameApp(pkg);
|
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;
|
return mRankingHelper.getImportance(pkg, uid) != IMPORTANCE_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user