AgentRunNotifications
The agent's run as notifications. While it runs: one ongoing notification that follows it, as an Android 16 Live Update (ProgressStyle, promoted to the status bar chip and the lock screen, shortCriticalText in the chip) and a plain progress notification on earlier versions. When it ends: a "reply ready" (or "stopped") notification. Every text comes from AgentProgress.
Approvals are not answered from the notification: it says the agent is waiting and opens the chat, where the user sees what the call would do.
This artifact declares POST_NOTIFICATIONS (which the app asks for at runtime) and POST_PROMOTED_NOTIFICATIONS. An app that keeps the run going in the background posts running from a foreground service.
Functions
Creates the channel (once); call before posting.
The notification of a finished run: the reply's start, or why it stopped.
The ongoing notification of a run in progress.