Let apps see if their conversations have been demoted

Test: cts
Bug: 154140688
Change-Id: Ief3c2535f3f253e60470c63fde9325e06ceda484
This commit is contained in:
Julia Reynolds
2020-07-27 09:28:55 -04:00
parent dc91aaab2d
commit cecd53dc71
5 changed files with 22 additions and 1 deletions

View File

@@ -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);

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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
*/

View File

@@ -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);