After upgrade to Android 5.0 Lollipop it started showing automatically ongoing notification on lock screen.
Sometimes users don\'t want to see all of them so they a
Seems like VISIBILITY_SECRET does the cleanest approach. As per the documentation:
a notification can be made VISIBILITY_SECRET, which will suppress its icon and ticker until the user has bypassed the lockscreen.
Per the source (NotificationData in the SystemUI AOSP project), VISIBILITY_SECRET is the only way to do it:
boolean shouldFilterOut(StatusBarNotification sbn) {
if (!(mEnvironment.isDeviceProvisioned() ||
showNotificationEvenIfUnprovisioned(sbn))) {
return true;
}
if (!mEnvironment.isNotificationForCurrentProfiles(sbn)) {
return true;
}
if (sbn.getNotification().visibility == Notification.VISIBILITY_SECRET &&
mEnvironment.shouldHideSensitiveContents(sbn.getUserId())) {
return true;
}
return false;
}
The only other type of notifications that appear to be filtered out are child notifications in a group where a summary is present. So unless you have multiple with a valid reason for a summary, VISIBILITY_SECRET is the best that can currently be done.