Språk

Notification.Visibility Property

Definition

Sphere of visibility of this notification, which affects how and when the SystemUI reveals the notification's presence and contents on the secure lockscreen and, starting with Android 15, during screen sharing.

[Android.Runtime.GeneratedEnum]
[Android.Runtime.Register("visibility")]
public Android.App.NotificationVisibility Visibility { get; set; }
[<Android.Runtime.GeneratedEnum>]
[<Android.Runtime.Register("visibility")>]
member this.Visibility : Android.App.NotificationVisibility with get, set

Property Value

The declared visibility level for notification content on the secure lockscreen and, starting with Android 15, during screen sharing.

Attributes

Remarks

Sphere of visibility of this notification, which affects how and when the SystemUI reveals the notification's presence and contents in untrusted situations, such as on the secure lockscreen. The default level, VISIBILITY_PRIVATE, shows the notification's icon and tickerText (if available), but its contents are only available if the device is unlocked for the appropriate user. A more permissive policy can be expressed by VISIBILITY_PUBLIC; such a notification can be read above a secure lockscreen. To modify the public version of this notification, for example to redact some portions, see Builder.setPublicVersion(Notification). A notification can also be made VISIBILITY_SECRET, which will suppress its icon and ticker until the user has bypassed the lockscreen. Value is one of the following: VISIBILITY_PUBLIC VISIBILITY_PRIVATE VISIBILITY_SECRET.

Starting with Android 15, a VISIBILITY_PUBLIC notification may be shown in full during screen sharing, unless channel settings require redaction. For a notification subject to redaction, the system shows its public version if supplied using Builder.setPublicVersion(Notification); otherwise, it hides the content. VISIBILITY_SECRET notifications can be hidden during screen sharing.

Android reference for android.app.Notification.visibility.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to