NotificationListenerBus

Process-wide SharedFlow of NotificationEvents emitted by McpNotificationListenerServiceBase when notifications post.

Hosts that want to react to incoming notifications subscribe to events from their own coroutine scope. The watch tools in :droid-mcp-notification-watch are one such subscriber but not the only intended consumer — apps with bespoke flows (auto-reply skills, monitor dashboards, etc.) can subscribe directly without pulling in the watch module.

Replay is 0 — joining late doesn't backfill. Use notifications-reply's list_repliable_notifications for snapshot reads of the active set.

Buffer is 64 with DROP_OLDEST overflow so a slow collector can't back-pressure the listener service.

Properties

Link copied to clipboard
val events: SharedFlow<NotificationEvent>

Functions

Link copied to clipboard

Cancel a notification by its key. Returns true on dispatch, false when no listener service is currently bound or the underlying binder rejected the call. Delegates to McpNotificationListenerServiceBase.cancelByKey.