@Implements(value=android.app.NotificationManager.class, looseSignatures=true) public class ShadowNotificationManager extends Object
Constructor and Description |
---|
ShadowNotificationManager() |
Modifier and Type | Method and Description |
---|---|
protected String |
addAutomaticZenRule(AutomaticZenRule automaticZenRule) |
protected boolean |
areNotificationsEnabled() |
protected void |
cancel(int id) |
protected void |
cancel(String tag,
int id) |
protected void |
cancelAll() |
protected void |
createNotificationChannel(Object channel) |
protected void |
createNotificationChannelGroup(Object group) |
protected void |
createNotificationChannelGroups(List<Object> groupList) |
protected void |
createNotificationChannels(List<Object> channelList) |
protected void |
deleteNotificationChannel(String channelId) |
protected void |
deleteNotificationChannelGroup(String channelGroupId)
Delete a notification channel group and all notification channels associated with the group.
|
StatusBarNotification[] |
getActiveNotifications() |
List<Notification> |
getAllNotifications() |
protected AutomaticZenRule |
getAutomaticZenRule(String id) |
protected Map<String,AutomaticZenRule> |
getAutomaticZenRules() |
protected int |
getCurrentInterruptionFilter() |
Notification |
getNotification(int id) |
Notification |
getNotification(String tag,
int id) |
protected Object |
getNotificationChannel(String channelId) |
Object |
getNotificationChannelGroup(String id) |
protected List<Object> |
getNotificationChannelGroups() |
List<Object> |
getNotificationChannels() |
protected NotificationManager.Policy |
getNotificationPolicy() |
boolean |
isChannelDeleted(String channelId)
Checks whether a channel is considered a “deleted” channel by Android.
|
protected boolean |
isNotificationPolicyAccessGranted() |
protected void |
notify(int id,
Notification notification) |
protected void |
notify(String tag,
int id,
Notification notification) |
protected boolean |
removeAutomaticZenRule(String id) |
protected void |
setInterruptionFilter(int interruptionFilter)
Currently does not support checking for granted policy access.
|
protected void |
setNotificationPolicy(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(String id,
AutomaticZenRule automaticZenRule) |
@Implementation protected void notify(int id, Notification notification)
@Implementation protected void notify(String tag, int id, Notification notification)
@Implementation protected void cancel(int id)
@Implementation protected void cancel(String tag, int id)
@Implementation protected void cancelAll()
@Implementation(minSdk=24) protected boolean areNotificationsEnabled()
public void setNotificationsEnabled(boolean areNotificationsEnabled)
@Implementation(minSdk=23) public StatusBarNotification[] getActiveNotifications()
@Implementation(minSdk=26) protected Object getNotificationChannel(String channelId)
@Implementation(minSdk=26) protected void createNotificationChannelGroup(Object group)
@Implementation(minSdk=26) protected void createNotificationChannelGroups(List<Object> groupList)
@Implementation(minSdk=26) protected List<Object> getNotificationChannelGroups()
@Implementation(minSdk=26) protected void createNotificationChannel(Object channel)
@Implementation(minSdk=26) protected void createNotificationChannels(List<Object> channelList)
@Implementation(minSdk=26) public List<Object> getNotificationChannels()
@Implementation(minSdk=26) protected void deleteNotificationChannel(String channelId)
@Implementation(minSdk=26) protected void deleteNotificationChannelGroup(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.
@Implementation(minSdk=23) protected final NotificationManager.Policy getNotificationPolicy()
#setNotificationPolicy(Policy)
@Implementation(minSdk=23) protected final boolean isNotificationPolicyAccessGranted()
setNotificationPolicyAccessGranted(boolean)
@Implementation(minSdk=23) protected final void setNotificationPolicy(NotificationManager.Policy policy)
Currently does not support checking for granted policy access.
public void setNotificationPolicyAccessGranted(boolean granted)
Sets the value returned by NotificationManager.isNotificationPolicyAccessGranted()
. If granted
is false, this also deletes all AutomaticZenRule
s.
@Implementation(minSdk=24) protected AutomaticZenRule getAutomaticZenRule(String id)
@Implementation(minSdk=24) protected Map<String,AutomaticZenRule> getAutomaticZenRules()
@Implementation(minSdk=24) protected String addAutomaticZenRule(AutomaticZenRule automaticZenRule)
@Implementation(minSdk=24) protected boolean updateAutomaticZenRule(String id, AutomaticZenRule automaticZenRule)
@Implementation(minSdk=24) protected boolean removeAutomaticZenRule(String id)
public boolean isChannelDeleted(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 int size()
public Notification getNotification(int id)
public Notification getNotification(String tag, int id)
public List<Notification> getAllNotifications()