Merge "Removed "forUser" variants in NotificationManager"
diff --git a/api/system-current.txt b/api/system-current.txt
index 1602e41..70b986d 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -546,10 +546,8 @@
public class NotificationManager {
method @Nullable public android.content.ComponentName getAllowedNotificationAssistant();
- method @Nullable public android.content.ComponentName getAllowedNotificationAssistantForUser(@NonNull android.os.UserHandle);
method public boolean isNotificationAssistantAccessGranted(@NonNull android.content.ComponentName);
method public void setNotificationAssistantAccessGranted(@Nullable android.content.ComponentName, boolean);
- method public void setNotificationAssistantAccessGrantedForUser(@Nullable android.content.ComponentName, @NonNull android.os.UserHandle, boolean);
}
public final class StatsManager {
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index 204fb6a..11b40c2 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -1270,6 +1270,8 @@
/**
* Grants/revokes Notification Assistant access to {@code assistant} for current user.
+ * To grant access for a particular user, obtain this service by using the {@link Context}
+ * provided by {@link Context#createPackageContextAsUser}
*
* @param assistant Name of component to grant/revoke access or {@code null} to revoke access to
* current assistant
@@ -1287,27 +1289,6 @@
}
}
- /**
- * Grants/revokes Notification Assistant access to {@code assistant} for given user.
- *
- * @param assistant Name of component to grant/revoke access or {@code null} to revoke access to
- * current assistant
- * @param user handle to associate assistant with
- * @param granted Grant/revoke access
- * @hide
- */
- @SystemApi
- public void setNotificationAssistantAccessGrantedForUser(@Nullable ComponentName assistant,
- @NonNull UserHandle user, boolean granted) {
- INotificationManager service = getService();
- try {
- service.setNotificationAssistantAccessGrantedForUser(assistant, user.getIdentifier(),
- granted);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
/** @hide */
public List<ComponentName> getEnabledNotificationListeners(int userId) {
INotificationManager service = getService();
@@ -1320,18 +1301,6 @@
/** @hide */
@SystemApi
- public @Nullable ComponentName getAllowedNotificationAssistantForUser(
- @NonNull UserHandle user) {
- INotificationManager service = getService();
- try {
- return service.getAllowedNotificationAssistantForUser(user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- @SystemApi
public @Nullable ComponentName getAllowedNotificationAssistant() {
INotificationManager service = getService();
try {