Merge "Explicitly allow shell to update listener/assist" into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2017-08-11 19:16:17 +00:00
committed by Android (Google) Code Review

View File

@@ -2823,7 +2823,7 @@ public class NotificationManagerService extends SystemService {
public void setNotificationListenerAccessGrantedForUser(ComponentName listener, int userId, public void setNotificationListenerAccessGrantedForUser(ComponentName listener, int userId,
boolean granted) throws RemoteException { boolean granted) throws RemoteException {
Preconditions.checkNotNull(listener); Preconditions.checkNotNull(listener);
enforceSystemOrSystemUI("grant notification listener access"); checkCallerIsSystemOrShell();
if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) {
mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(), mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(),
userId, false, granted); userId, false, granted);
@@ -2844,7 +2844,7 @@ public class NotificationManagerService extends SystemService {
public void setNotificationAssistantAccessGrantedForUser(ComponentName assistant, public void setNotificationAssistantAccessGrantedForUser(ComponentName assistant,
int userId, boolean granted) throws RemoteException { int userId, boolean granted) throws RemoteException {
Preconditions.checkNotNull(assistant); Preconditions.checkNotNull(assistant);
enforceSystemOrSystemUI("grant notification assistant access"); checkCallerIsSystemOrShell();
if (!mActivityManager.isLowRamDevice()) { if (!mActivityManager.isLowRamDevice()) {
mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(), mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(),
userId, false, granted); userId, false, granted);