Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbfbb1d9 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Removed "forUser" variants in NotificationManager

Removed the variants for NotificationAssistant

Test: NotificationManagerTest passing
Fixes: 126701384
Change-Id: Ic19ab009354a74182ad0557f33c251ea26f3244b
parent 66b5c276
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -546,10 +546,8 @@ package android.app {
  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 {
+2 −33
Original line number Diff line number Diff line
@@ -1270,6 +1270,8 @@ public class NotificationManager {

    /**
     * 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 @@ public class NotificationManager {
        }
    }

    /**
     * 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();
@@ -1318,18 +1299,6 @@ public class NotificationManager {
        }
    }

    /** @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() {