diff --git a/api/current.txt b/api/current.txt index 651cda564ee93..76c5d753b6dab 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5957,6 +5957,7 @@ package android.app { method public long[] getVibrationPattern(); method public boolean hasUserSetImportance(); method public boolean hasUserSetSound(); + method public boolean isDemoted(); method public boolean isImportantConversation(); method public void setAllowBubbles(boolean); method public void setBypassDnd(boolean); diff --git a/api/test-current.txt b/api/test-current.txt index dc6626586efa8..9802e4b961d25 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -451,6 +451,7 @@ package android.app { method public void lockFields(int); method public void setBlockable(boolean); method public void setDeleted(boolean); + method public void setDemoted(boolean); method public void setFgServiceShown(boolean); method public void setImportanceLockedByCriticalDeviceFunction(boolean); method public void setImportanceLockedByOEM(boolean); @@ -474,6 +475,7 @@ package android.app { method public boolean isNotificationAssistantAccessGranted(@NonNull android.content.ComponentName); method public boolean matchesCallFilter(android.os.Bundle); method public void setNotificationAssistantAccessGranted(@Nullable android.content.ComponentName, boolean); + method public void updateNotificationChannel(@NonNull String, int, @NonNull android.app.NotificationChannel); } public final class PictureInPictureParams implements android.os.Parcelable { diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index cf2f7690bc2c3..c827e601ce88d 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -828,12 +828,15 @@ public final class NotificationChannel implements Parcelable { /** * @hide */ + @TestApi public void setDemoted(boolean demoted) { mDemoted = demoted; } /** - * @hide + * Returns whether the user has decided that this channel does not represent a conversation. The + * value will always be false for channels that never claimed to be conversations - that is, + * for channels where {@link #getConversationId()} and {@link #getParentChannelId()} are empty. */ public boolean isDemoted() { return mDemoted; diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java index eef9c022fda84..98df224ce36f2 100644 --- a/core/java/android/app/NotificationManager.java +++ b/core/java/android/app/NotificationManager.java @@ -953,6 +953,20 @@ public class NotificationManager { } } + /** + * @hide + */ + @TestApi + public void updateNotificationChannel(@NonNull String pkg, int uid, + @NonNull NotificationChannel channel) { + INotificationManager service = getService(); + try { + service.updateNotificationChannelForPackage(pkg, uid, channel); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + /** * @hide */ diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index c14f23f6ace05..c70f764ee92b4 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -5957,6 +5957,7 @@ package android.app { method public long[] getVibrationPattern(); method public boolean hasUserSetImportance(); method public boolean hasUserSetSound(); + method public boolean isDemoted(); method public boolean isImportantConversation(); method public void setAllowBubbles(boolean); method public void setBypassDnd(boolean);