NotificationDetails.Builder


public static final class NotificationDetails.Builder
extends Object

java.lang.Object
   ↳ android.app.personalcontext.hint.NotificationDetails.Builder


Builder for NotificationDetails.

Summary

Public constructors

Builder()

Public methods

NotificationDetails build()

Builds the NotificationDetails.

NotificationDetails.Builder setKey(String key)

Sets the unique status bar key of the notification.

NotificationDetails.Builder setNotification(Notification notification)

Sets the underlying Notification.

NotificationDetails.Builder setPackageName(String packageName)

Sets the package name of the app that posted the notification.

NotificationDetails.Builder setPostTimeMillis(long postTimeMillis)

Sets the post timestamp of the notification in milliseconds since epoch.

NotificationDetails.Builder setUser(UserHandle user)

Sets the user associated with this notification.

Inherited methods

Public constructors

Builder

Added in version 37.2
public Builder ()

Public methods

build

Added in version 37.2
public NotificationDetails build ()

Builds the NotificationDetails.

Returns
NotificationDetails This value cannot be null.

setKey

Added in version 37.2
public NotificationDetails.Builder setKey (String key)

Sets the unique status bar key of the notification.

Parameters
key String: This value cannot be null.

Returns
NotificationDetails.Builder This value cannot be null.

setNotification

Added in version 37.2
public NotificationDetails.Builder setNotification (Notification notification)

Sets the underlying Notification.

Parameters
notification Notification: This value cannot be null.

Returns
NotificationDetails.Builder This value cannot be null.

setPackageName

Added in version 37.2
public NotificationDetails.Builder setPackageName (String packageName)

Sets the package name of the app that posted the notification.

Parameters
packageName String: This value cannot be null.

Returns
NotificationDetails.Builder This value cannot be null.

setPostTimeMillis

Added in version 37.2
public NotificationDetails.Builder setPostTimeMillis (long postTimeMillis)

Sets the post timestamp of the notification in milliseconds since epoch.

Parameters
postTimeMillis long

Returns
NotificationDetails.Builder This value cannot be null.

setUser

Added in version 37.2
public NotificationDetails.Builder setUser (UserHandle user)

Sets the user associated with this notification.

Parameters
user UserHandle: This value cannot be null.

Returns
NotificationDetails.Builder This value cannot be null.