Fix multiuser access to setNotificationPolicy
Fixes an issue where the call would fail if called from a secondary user when the app wasn't installed on the primary user Test: install an app on secondary user only and ensure that it can change the dnd policy Bug: 148620301 Change-Id: Ibb45685f48017e9a42a98eb20b879d8fb1588137
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user