Package-level declarations

Types

Link copied to clipboard

Lists currently-active watches from WatchRegistry.list, with each entry's TTL countdown (expires_in_seconds, floored at 0) and how many times it has fired so far. Expired watches are swept from the registry before the list is built, so this never returns a watch whose TTL has already elapsed. No preconditions — always succeeds, even with an empty registry.

Link copied to clipboard

Provider for the notification-watch module. Wires up WatchNotificationsTool, UnwatchNotificationsTool, ListNotificationWatchesTool, and PollNotificationWatchTool, all backed by WatchRegistry. Watches match against the live stream via NotificationListenerBus.events rather than polling — the host's listener service must be bound and notification listener access granted for events to flow. As with the sibling NotificationsReplyTools module, this is a special-access permission granted via Settings, so requiredPermissions is empty and hasPermissions always returns true; use isNotificationListenerEnabled or permissionStatus to check actual readiness.

Link copied to clipboard

Returns the notifications a watch has matched since it was registered (or since the last clearing poll), via WatchRegistry.poll. Each watch buffers at most WatchRegistry.MAX_BUFFERED_EVENTS events; older ones are dropped and counted in dropped. clear (default true) drains the buffer so the next poll only sees newer events; pass false to peek. An unknown or expired watch_id returns watch_not_found.

Link copied to clipboard

Removes a watch by id via WatchRegistry.unregister. Idempotent — removing an id that doesn't exist (already expired, already removed, or never valid) returns success with removed=false rather than an error, so callers don't need to check existence first. Output: the echoed watch_id and removed.

Link copied to clipboard

Registers a filter against the live notification stream in WatchRegistry, returning a watch_id for later PollNotificationWatchTool / ListNotificationWatchesTool / UnwatchNotificationsTool calls. Matched events are buffered per watch (up to WatchRegistry.MAX_BUFFERED_EVENTS) and retrieved with poll_notification_watch. At most WatchRegistry.MAX_WATCHES watches may be active at once, else too_many_watches. Requires the listener service bound and notification listener access granted, else notification_listener_not_enabled. At least one of package_name (exact match), sender_pattern (substring on title), or keyword (substring on text/bigText/subText/ ticker) is required — supplying none is invalid_filter; supplying several AND-combines. sender_pattern and keyword match case-insensitively. ttl_seconds (clamped 60-86400, default 3600) auto-expires the watch; fire_on_update (default false) controls whether subsequent updates to an already-matched notification key fire again. Output: watch_id, expires_at, the effective ttl_seconds, and fire_on_update.