Notification.BridgedNotificationMetadata


public static final class Notification.BridgedNotificationMetadata
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.Notification.BridgedNotificationMetadata


Encapsulates the information needed to display a notification as a bridged notification. A bridged notification is a notification sent from another device via a bridging application. The notification is displayed with customized content to differentiate it to the user from a local notification. Only preauthorized applications with bridging permissions can post bridged notifications.

Summary

Inherited constants

Fields

public static final Creator<Notification.BridgedNotificationMetadata> CREATOR

Public constructors

BridgedNotificationMetadata(String originDeviceName, String packageName, String channelId, Icon appIcon)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Icon getAppIcon()

An icon representing the application the notification originated from.

String getChannelId()

The channel ID for the notification on the origin device.

String getOriginDeviceName()

The name of the device the notification originated from (e.g. "Jane's phone").

String getPackageName()

The package name of the application the notification originated from.

void writeToParcel(Parcel out, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in API level 37
public static final Creator<Notification.BridgedNotificationMetadata> CREATOR

Public constructors

BridgedNotificationMetadata

Added in API level 37
public BridgedNotificationMetadata (String originDeviceName, 
                String packageName, 
                String channelId, 
                Icon appIcon)

Parameters
originDeviceName String: This value cannot be null.

packageName String: This value cannot be null.

channelId String: This value cannot be null.

appIcon Icon: This value cannot be null.

Public methods

describeContents

Added in API level 37
public int describeContents ()

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(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getAppIcon

Added in API level 37
public Icon getAppIcon ()

An icon representing the application the notification originated from.

Returns
Icon This value cannot be null.

getChannelId

Added in API level 37
public String getChannelId ()

The channel ID for the notification on the origin device. Generally this should match the channel ID that the notification would have gone to on the local device if the app is installed in both places. This is used for blocking bridged notifications if the user has muted notifications for the applications channel on the local device.

Returns
String This value cannot be null.

getOriginDeviceName

Added in API level 37
public String getOriginDeviceName ()

The name of the device the notification originated from (e.g. "Jane's phone").

Returns
String This value cannot be null.

getPackageName

Added in API level 37
public String getPackageName ()

The package name of the application the notification originated from.

Returns
String This value cannot be null.

writeToParcel

Added in API level 37
public void writeToParcel (Parcel out, 
                int flags)

Flatten this object in to a Parcel.

Parameters
out Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following: