@Implements(value=android.app.NotificationManager.class, looseSignatures=true) public class ShadowNotificationManager extends java.lang.Object
Constructor and Description |
---|
ShadowNotificationManager() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
addAutomaticZenRule(android.app.AutomaticZenRule automaticZenRule) |
protected boolean |
areNotificationsEnabled() |
protected void |
cancel(int id) |
protected void |
cancel(java.lang.String tag,
int id) |
protected void |
cancelAll() |
protected void |
createNotificationChannel(java.lang.Object channel) |
protected void |
createNotificationChannelGroup(java.lang.Object group) |
protected void |
createNotificationChannels(java.util.List<java.lang.Object> channelList) |
protected void |
deleteNotificationChannel(java.lang.String channelId) |
protected void |
deleteNotificationChannelGroup(java.lang.String channelGroupId)
Delete a notification channel group and all notification channels associated with the group.
|
android.service.notification.StatusBarNotification[] |
getActiveNotifications() |
java.util.List<android.app.Notification> |
getAllNotifications() |
protected android.app.AutomaticZenRule |
getAutomaticZenRule(java.lang.String id) |
protected java.util.Map<java.lang.String,android.app.AutomaticZenRule> |
getAutomaticZenRules() |
protected int |
getCurrentInterruptionFilter() |
android.app.Notification |
getNotification(int id) |
android.app.Notification |
getNotification(java.lang.String tag,
int id) |
protected java.lang.Object |
getNotificationChannel(java.lang.String channelId) |
java.lang.Object |
getNotificationChannelGroup(java.lang.String id) |
protected java.util.List<java.lang.Object> |
getNotificationChannelGroups() |
java.util.List<java.lang.Object> |
getNotificationChannels() |
protected android.app.NotificationManager.Policy |
getNotificationPolicy() |
boolean |
isChannelDeleted(java.lang.String channelId)
Checks whether a channel is considered a “deleted” channel by Android.
|
protected boolean |
isNotificationPolicyAccessGranted() |
protected void |
notify(int id,
android.app.Notification notification) |
protected void |
notify(java.lang.String tag,
int id,
android.app.Notification notification) |
protected boolean |
removeAutomaticZenRule(java.lang.String id) |
protected void |
setInterruptionFilter(int interruptionFilter)
Currently does not support checking for granted policy access.
|
protected void |
setNotificationPolicy(android.app.NotificationManager.Policy policy)
Currently does not support checking for granted policy access.
|
void |
setNotificationPolicyAccessGranted(boolean granted)
Sets the value returned by
NotificationManager.isNotificationPolicyAccessGranted() . |
void |
setNotificationsEnabled(boolean areNotificationsEnabled) |
int |
size() |
protected boolean |
updateAutomaticZenRule(java.lang.String id,
android.app.AutomaticZenRule automaticZenRule) |
@Implementation protected void notify(int id, android.app.Notification notification)
@Implementation protected void notify(java.lang.String tag, int id, android.app.Notification notification)
@Implementation protected void cancel(int id)
@Implementation protected void cancel(java.lang.String tag, int id)
@Implementation protected void cancelAll()
@Implementation(minSdk=24) protected boolean areNotificationsEnabled()
public void setNotificationsEnabled(boolean areNotificationsEnabled)
@Implementation(minSdk=23) public android.service.notification.StatusBarNotification[] getActiveNotifications()
@Implementation(minSdk=26) protected java.lang.Object getNotificationChannel(java.lang.String channelId)
@Implementation(minSdk=26) protected void createNotificationChannelGroup(java.lang.Object group)
@Implementation(minSdk=26) protected java.util.List<java.lang.Object> getNotificationChannelGroups()
@Implementation(minSdk=26) protected void createNotificationChannel(java.lang.Object channel)
@Implementation(minSdk=26) protected void createNotificationChannels(java.util.List<java.lang.Object> channelList)
@Implementation(minSdk=26) public java.util.List<java.lang.Object> getNotificationChannels()
@Implementation(minSdk=26) protected void deleteNotificationChannel(java.lang.String channelId)
@Implementation(minSdk=26) protected void deleteNotificationChannelGroup(java.lang.String channelGroupId)
Delete a notification channel group and all notification channels associated with the group. This method will not notify any NotificationListenerService of resulting changes to notification channel groups nor to notification channels.
@Implementation(minSdk=23) protected final int getCurrentInterruptionFilter()
NotificationManager.INTERRUPTION_FILTER_ALL
by default, or the value specified via setInterruptionFilter(int)
@Implementation(minSdk=23) protected final void setInterruptionFilter(int interruptionFilter)
Currently does not support checking for granted policy access.
NotificationManager.getCurrentInterruptionFilter()
@Implementation(minSdk=23) protected final android.app.NotificationManager.Policy getNotificationPolicy()
#setNotificationPolicy(Policy)
@Implementation(minSdk=23) protected final boolean isNotificationPolicyAccessGranted()
setNotificationPolicyAccessGranted(boolean)
@Implementation(minSdk=23) protected final void setNotificationPolicy(android.app.NotificationManager.Policy policy)
Currently does not support checking for granted policy access.
NotificationManager.getNotificationPolicy()
public void setNotificationPolicyAccessGranted(boolean granted)
Sets the value returned by NotificationManager.isNotificationPolicyAccessGranted()
. If granted
is false, this also deletes all AutomaticZenRule
s.
NotificationManager.isNotificationPolicyAccessGranted()
@Implementation(minSdk=24) protected android.app.AutomaticZenRule getAutomaticZenRule(java.lang.String id)
@Implementation(minSdk=24) protected java.util.Map<java.lang.String,android.app.AutomaticZenRule> getAutomaticZenRules()
@Implementation(minSdk=24) protected java.lang.String addAutomaticZenRule(android.app.AutomaticZenRule automaticZenRule)
@Implementation(minSdk=24) protected boolean updateAutomaticZenRule(java.lang.String id, android.app.AutomaticZenRule automaticZenRule)
@Implementation(minSdk=24) protected boolean removeAutomaticZenRule(java.lang.String id)
public boolean isChannelDeleted(java.lang.String channelId)
Checks whether a channel is considered a “deleted” channel by Android. This is a channel that was created but later deleted. If a channel is created that was deleted before, it recreates the channel with the old settings.
public java.lang.Object getNotificationChannelGroup(java.lang.String id)
public int size()
public android.app.Notification getNotification(int id)
public android.app.Notification getNotification(java.lang.String tag, int id)
public java.util.List<android.app.Notification> getAllNotifications()