Most visited

Recently visited

Added in API level 21

NotificationListenerService.Ranking

public static class NotificationListenerService.Ranking
extends Object

java.lang.Object
   ↳ android.service.notification.NotificationListenerService.Ranking


Stores ranking related information on a currently active notification.

Ranking objects aren't automatically updated as notification events occur. Instead, ranking information has to be retrieved again via the current NotificationListenerService.RankingMap.

Summary

Public constructors

NotificationListenerService.Ranking()

Public methods

int getImportance()

Returns the importance of the notification, which dictates its modes of presentation, see: IMPORTANCE_DEFAULT, etc.

CharSequence getImportanceExplanation()

If the importance has been overriden by user preference, then this will be non-null, and should be displayed to the user.

String getKey()

Returns the key of the notification this Ranking applies to.

String getOverrideGroupKey()

If the system has overriden the group key, then this will be non-null, and this key should be used to bundle notifications.

int getRank()

Returns the rank of the notification.

int getSuppressedVisualEffects()

Returns the type(s) of visual effects that should be suppressed for this notification.

boolean isAmbient()

Returns whether the notification is an ambient notification, that is a notification that doesn't require the user's immediate attention.

boolean matchesInterruptionFilter()

Returns whether the notification matches the user's interruption filter.

Inherited methods

From class java.lang.Object

Public constructors

NotificationListenerService.Ranking

Added in API level 21
NotificationListenerService.Ranking ()

Public methods

getImportance

Added in API level 24
int getImportance ()

Returns the importance of the notification, which dictates its modes of presentation, see: IMPORTANCE_DEFAULT, etc.

Returns
int the rank of the notification

getImportanceExplanation

Added in API level 24
CharSequence getImportanceExplanation ()

If the importance has been overriden by user preference, then this will be non-null, and should be displayed to the user.

Returns
CharSequence the explanation for the importance, or null if it is the natural importance

getKey

Added in API level 21
String getKey ()

Returns the key of the notification this Ranking applies to.

Returns
String

getOverrideGroupKey

Added in API level 24
String getOverrideGroupKey ()

If the system has overriden the group key, then this will be non-null, and this key should be used to bundle notifications.

Returns
String

getRank

Added in API level 21
int getRank ()

Returns the rank of the notification.

Returns
int the rank of the notification, that is the 0-based index in the list of active notifications.

getSuppressedVisualEffects

Added in API level 24
int getSuppressedVisualEffects ()

Returns the type(s) of visual effects that should be suppressed for this notification. See SUPPRESSED_EFFECT_SCREEN_OFF, SUPPRESSED_EFFECT_SCREEN_ON.

Returns
int

isAmbient

Added in API level 21
boolean isAmbient ()

Returns whether the notification is an ambient notification, that is a notification that doesn't require the user's immediate attention.

Returns
boolean

matchesInterruptionFilter

Added in API level 21
boolean matchesInterruptionFilter ()

Returns whether the notification matches the user's interruption filter.

Returns
boolean true if the notification is allowed by the filter, or false if it is blocked.

Hooray!