StatusBarNotification
open class StatusBarNotification : Parcelable
| kotlin.Any | |
| ↳ | android.service.notification.StatusBarNotification |
Class encapsulating a Notification. Sent by the NotificationManagerService to clients including the status bar and any android.service.notification.NotificationListenerServices.
Summary
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
StatusBarNotification(in: Parcel!) |
|
StatusBarNotification(pkg: String!, opPkg: String!, id: Int, tag: String!, uid: Int, initialPid: Int, score: Int, notification: Notification!, user: UserHandle!, postTime: Long) |
|
| Public methods | |
|---|---|
| open StatusBarNotification! |
clone()Creates and returns a copy of this object. |
| open Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open String! |
A key that indicates the group with which this message ranks. |
| open Int |
getId()The id supplied to |
| open String! |
getKey()A unique instance key for this notification record. |
| open Notification! |
The |
| open String |
getOpPkg()The package that posted the notification. |
| open String! |
Returns the override group key. |
| open String! |
The package that the notification belongs to. |
| open Long |
The time (in |
| open String! |
getTag()The tag supplied to |
| open Int |
getUid()The notifying app's ( |
| open UserHandle! |
getUser()The |
| open Int |
Returns a userid for whom this notification is intended. |
| open Boolean |
Returns true if application asked that this notification be part of a group. |
| open Boolean |
Convenience method to check the notification's flags for either |
| open Boolean |
isGroup()Returns true if this notification is part of a group. |
| open Boolean |
Convenience method to check the notification's flags for |
| open Unit |
setOverrideGroupKey(overrideGroupKey: String!)Sets the override group key. |
| open String |
toString()Returns a string representation of the object. |
| open Unit |
writeToParcel(out: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<StatusBarNotification!> | |
Public constructors
StatusBarNotification
StatusBarNotification(
pkg: String!,
opPkg: String!,
id: Int,
tag: String!,
uid: Int,
initialPid: Int,
score: Int,
notification: Notification!,
user: UserHandle!,
postTime: Long)
Deprecated: Non-system apps should not need to create StatusBarNotifications.
Public methods
clone
open fun clone(): StatusBarNotification!
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:
x.clone() != x
x.clone().getClass() == x.getClass()
true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().
By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.
| Return | |
|---|---|
StatusBarNotification! |
a clone of this instance. |
| Exceptions | |
|---|---|
java.lang.CloneNotSupportedException |
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. |
describeContents
open fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getGroupKey
open fun getGroupKey(): String!
A key that indicates the group with which this message ranks.
getId
open fun getId(): Int
The id supplied to android.app.NotificationManager#notify(int, Notification).
getKey
open fun getKey(): String!
A unique instance key for this notification record.
getNotification
open fun getNotification(): Notification!
The android.app.Notification supplied to android.app.NotificationManager#notify(int, Notification).
getOpPkg
open fun getOpPkg(): String
The package that posted the notification.
Might be different from getPackageName() if the app owning the notification has a notification delegate.
| Return | |
|---|---|
String |
This value cannot be null. |
getOverrideGroupKey
open fun getOverrideGroupKey(): String!
Returns the override group key.
getPackageName
open fun getPackageName(): String!
The package that the notification belongs to.
getPostTime
open fun getPostTime(): Long
The time (in System.currentTimeMillis time) the notification was posted, which may be different than android.app.Notification#when.
getTag
open fun getTag(): String!
The tag supplied to android.app.NotificationManager#notify(int, Notification), or null if no tag was specified.
getUser
open fun getUser(): UserHandle!
The android.os.UserHandle for whom this notification is intended.
getUserId
open fungetUserId(): Int
Deprecated: Use getUser() instead.
Returns a userid for whom this notification is intended.
isAppGroup
open fun isAppGroup(): Boolean
Returns true if application asked that this notification be part of a group.
isClearable
open fun isClearable(): Boolean
Convenience method to check the notification's flags for either Notification.FLAG_ONGOING_EVENT or Notification.FLAG_NO_CLEAR.
isGroup
open fun isGroup(): Boolean
Returns true if this notification is part of a group.
isOngoing
open fun isOngoing(): Boolean
Convenience method to check the notification's flags for Notification.FLAG_ONGOING_EVENT.
setOverrideGroupKey
open fun setOverrideGroupKey(overrideGroupKey: String!): Unit
Sets the override group key.
toString
open fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
out: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|