public final class NotificationRecord extends Object
NotificationListenerService
s.
These objects should not be mutated unless the code is synchronized
on NotificationManagerService.mNotificationList
, and any
modification should be followed by a sorting of that list.
Is sortable by NotificationComparator
.
Modifier and Type | Field and Description |
---|---|
boolean |
isUpdate |
Constructor and Description |
---|
NotificationRecord(Context context,
StatusBarNotification sbn) |
Modifier and Type | Method and Description |
---|---|
void |
copyRankingInformation(NotificationRecord previous) |
int |
getAuthoritativeRank() |
float |
getContactAffinity() |
int |
getExposureMs(long now) |
int |
getFlags() |
int |
getFreshnessMs(long now) |
String |
getGlobalSortKey() |
String |
getGroupKey() |
int |
getImportance() |
CharSequence |
getImportanceExplanation() |
String |
getKey() |
int |
getLifespanMs(long now) |
Notification |
getNotification() |
int |
getPackagePriority() |
int |
getPackageVisibilityOverride() |
long |
getRankingTimeMs()
Returns the timestamp to use for time-based sorting in the ranker.
|
int |
getSuppressedVisualEffects() |
UserHandle |
getUser() |
int |
getUserId()
Deprecated.
Use
getUser() instead. |
int |
getUserImportance() |
boolean |
isAudioAttributesUsage(int usage) |
boolean |
isAudioStream(int stream) |
boolean |
isCategory(String category) |
boolean |
isImportanceFromUser() |
boolean |
isIntercepted() |
boolean |
isRecentlyIntrusive() |
boolean |
isSeen()
Check if any of the listeners have marked this notification as seen by the user.
|
void |
setAuthoritativeRank(int authoritativeRank) |
void |
setContactAffinity(float contactAffinity) |
void |
setGlobalSortKey(String globalSortKey) |
void |
setImportance(int importance,
CharSequence explanation) |
boolean |
setIntercepted(boolean intercept) |
void |
setPackagePriority(int packagePriority) |
void |
setPackageVisibilityOverride(int packageVisibility) |
void |
setRecentlyIntrusive(boolean recentlyIntrusive) |
void |
setSeen()
Mark the notification as seen by the user.
|
void |
setSuppressedVisualEffects(int effects) |
void |
setUserImportance(int importance) |
void |
setVisibility(boolean visible,
int rank)
Set the visibility of the notification.
|
String |
toString()
Returns a string representation of the object.
|
public NotificationRecord(Context context, StatusBarNotification sbn)
public void copyRankingInformation(NotificationRecord previous)
public Notification getNotification()
public int getFlags()
public UserHandle getUser()
public String getKey()
public int getUserId()
getUser()
instead.public final String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public void setContactAffinity(float contactAffinity)
public float getContactAffinity()
public void setRecentlyIntrusive(boolean recentlyIntrusive)
public boolean isRecentlyIntrusive()
public void setPackagePriority(int packagePriority)
public int getPackagePriority()
public void setPackageVisibilityOverride(int packageVisibility)
public int getPackageVisibilityOverride()
public void setUserImportance(int importance)
public int getUserImportance()
public void setImportance(int importance, CharSequence explanation)
public int getImportance()
public CharSequence getImportanceExplanation()
public boolean setIntercepted(boolean intercept)
public boolean isIntercepted()
public void setSuppressedVisualEffects(int effects)
public int getSuppressedVisualEffects()
public boolean isCategory(String category)
public boolean isAudioStream(int stream)
public boolean isAudioAttributesUsage(int usage)
public long getRankingTimeMs()
public int getFreshnessMs(long now)
now
- this current time in milliseconds.public int getLifespanMs(long now)
now
- this current time in milliseconds.public int getExposureMs(long now)
now
- this current time in milliseconds.public void setVisibility(boolean visible, int rank)
public void setGlobalSortKey(String globalSortKey)
public String getGlobalSortKey()
public boolean isSeen()
public void setSeen()
public void setAuthoritativeRank(int authoritativeRank)
public int getAuthoritativeRank()
public String getGroupKey()
public boolean isImportanceFromUser()