public static class NotificationListenerService.Ranking extends Object
Ranking objects aren't automatically updated as notification events
occur. Instead, ranking information has to be retrieved again via the
current NotificationListenerService.RankingMap
.
Modifier and Type | Field and Description |
---|---|
static int |
IMPORTANCE_DEFAULT
Default notification importance: shows everywhere, allowed to makes noise,
but does not visually intrude.
|
static int |
IMPORTANCE_HIGH
Higher notification importance: shows everywhere, allowed to makes noise and peek.
|
static int |
IMPORTANCE_LOW
Low notification importance: shows everywhere, but is not intrusive.
|
static int |
IMPORTANCE_MAX
Highest notification importance: shows everywhere, allowed to makes noise, peek, and
use full screen intents.
|
static int |
IMPORTANCE_MIN
Min notification importance: only shows in the shade, below the fold.
|
static int |
IMPORTANCE_NONE
A notification with no importance: shows nowhere, is blocked.
|
static int |
IMPORTANCE_UNSPECIFIED
Value signifying that the user has not expressed an importance.
|
static int |
VISIBILITY_NO_OVERRIDE
Value signifying that the user has not expressed a per-app visibility override value.
|
Constructor and Description |
---|
Ranking() |
Modifier and Type | Method and Description |
---|---|
int |
getImportance()
Returns the importance of the notification, which dictates its
modes of presentation, see:
NotificationManager.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.
|
int |
getVisibilityOverride()
Returns the user specificed visibility for the package that posted
this notification, or
VISIBILITY_NO_OVERRIDE if
no such preference has been expressed. |
static String |
importanceToString(int importance) |
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.
|
public static final int VISIBILITY_NO_OVERRIDE
public static final int IMPORTANCE_UNSPECIFIED
public static final int IMPORTANCE_NONE
public static final int IMPORTANCE_MIN
public static final int IMPORTANCE_LOW
public static final int IMPORTANCE_DEFAULT
public static final int IMPORTANCE_HIGH
public static final int IMPORTANCE_MAX
public String getKey()
public int getRank()
public boolean isAmbient()
public int getVisibilityOverride()
VISIBILITY_NO_OVERRIDE
if
no such preference has been expressed.public int getSuppressedVisualEffects()
NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF
, NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_ON
.public boolean matchesInterruptionFilter()
true
if the notification is allowed by the filter, or
false
if it is blocked.public int getImportance()
NotificationManager.IMPORTANCE_DEFAULT
, etc.public CharSequence getImportanceExplanation()
public String getOverrideGroupKey()
public static String importanceToString(int importance)