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

Commit 03533715 authored by Geoffrey Pitsch's avatar Geoffrey Pitsch
Browse files

API improvements for creating NotificationChannels

Remove listener for aysnchronous operation.
Allow multiple channel creation from a single call.
Silently no-op for creating existing channels.

Test: runtest systemui-notification
Change-Id: Ibc1340d21efa0c12d126bee437adcbb99141e86a
parent 92b504cb
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ LOCAL_SRC_FILES += \
	core/java/android/app/IBackupAgent.aidl \
	core/java/android/app/IEphemeralResolver.aidl \
	core/java/android/app/IInstrumentationWatcher.aidl \
	core/java/android/app/IOnNotificationChannelCreatedListener.aidl \
	core/java/android/app/INotificationManager.aidl \
	core/java/android/app/IProcessObserver.aidl \
	core/java/android/app/ISearchManager.aidl \
+2 −5
Original line number Diff line number Diff line
@@ -5414,7 +5414,8 @@ package android.app {
    method public void cancel(int);
    method public void cancel(java.lang.String, int);
    method public void cancelAll();
    method public void createNotificationChannel(android.app.NotificationChannel, android.app.NotificationManager.OnNotificationChannelCreatedListener, android.os.Handler);
    method public void createNotificationChannel(android.app.NotificationChannel);
    method public void createNotificationChannels(java.util.List<android.app.NotificationChannel>);
    method public void deleteNotificationChannel(java.lang.String);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.app.AutomaticZenRule getAutomaticZenRule(java.lang.String);
@@ -5448,10 +5449,6 @@ package android.app {
    field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
  }
  public static abstract interface NotificationManager.OnNotificationChannelCreatedListener {
    method public abstract void onNotificationChannelCreated(android.app.NotificationChannel);
  }
  public static class NotificationManager.Policy implements android.os.Parcelable {
    ctor public NotificationManager.Policy(int, int, int);
    ctor public NotificationManager.Policy(int, int, int, int);
+2 −5
Original line number Diff line number Diff line
@@ -5587,7 +5587,8 @@ package android.app {
    method public void cancel(int);
    method public void cancel(java.lang.String, int);
    method public void cancelAll();
    method public void createNotificationChannel(android.app.NotificationChannel, android.app.NotificationManager.OnNotificationChannelCreatedListener, android.os.Handler);
    method public void createNotificationChannel(android.app.NotificationChannel);
    method public void createNotificationChannels(java.util.List<android.app.NotificationChannel>);
    method public void deleteNotificationChannel(java.lang.String);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.app.AutomaticZenRule getAutomaticZenRule(java.lang.String);
@@ -5621,10 +5622,6 @@ package android.app {
    field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
  }
  public static abstract interface NotificationManager.OnNotificationChannelCreatedListener {
    method public abstract void onNotificationChannelCreated(android.app.NotificationChannel);
  }
  public static class NotificationManager.Policy implements android.os.Parcelable {
    ctor public NotificationManager.Policy(int, int, int);
    ctor public NotificationManager.Policy(int, int, int, int);
+2 −5
Original line number Diff line number Diff line
@@ -5424,7 +5424,8 @@ package android.app {
    method public void cancel(int);
    method public void cancel(java.lang.String, int);
    method public void cancelAll();
    method public void createNotificationChannel(android.app.NotificationChannel, android.app.NotificationManager.OnNotificationChannelCreatedListener, android.os.Handler);
    method public void createNotificationChannel(android.app.NotificationChannel);
    method public void createNotificationChannels(java.util.List<android.app.NotificationChannel>);
    method public void deleteNotificationChannel(java.lang.String);
    method public android.service.notification.StatusBarNotification[] getActiveNotifications();
    method public android.app.AutomaticZenRule getAutomaticZenRule(java.lang.String);
@@ -5459,10 +5460,6 @@ package android.app {
    field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
  }
  public static abstract interface NotificationManager.OnNotificationChannelCreatedListener {
    method public abstract void onNotificationChannelCreated(android.app.NotificationChannel);
  }
  public static class NotificationManager.Policy implements android.os.Parcelable {
    ctor public NotificationManager.Policy(int, int, int);
    ctor public NotificationManager.Policy(int, int, int, int);
+1 −3
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@

package android.app;

import android.app.IOnNotificationChannelCreatedListener;
import android.app.ITransientNotification;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -52,8 +51,7 @@ interface INotificationManager
    boolean areNotificationsEnabled(String pkg);
    int getPackageImportance(String pkg);

    void createNotificationChannel(String pkg, in NotificationChannel channel,
            in IOnNotificationChannelCreatedListener listener);
    void createNotificationChannels(String pkg, in ParceledListSlice channelsList);
    void updateNotificationChannelForPackage(String pkg, int uid, in NotificationChannel channel);
    NotificationChannel getNotificationChannel(String pkg, String channelId);
    NotificationChannel getNotificationChannelForPackage(String pkg, int uid, String channelId);
Loading