Adds Robolectric-based androidHostTest coverage for the three notification
BroadcastReceivers. Verifies:
- ReplyReceiver sends a DataPacket derived from the contactKey then calls
appendOutgoingMessage followed by markConversationRead in that order.
- MarkAsReadReceiver invokes markConversationRead, ignores wrong actions,
and drops intents missing the contact key.
- ReactionReceiver dispatches a ServiceAction.Reaction and, on success,
calls markConversationRead. Failures in dispatch short-circuit markRead.
Uses the existing FakeRadioController and FakeMeshServiceNotifications
(marked open so tests can record calls) plus mokkery for ServiceRepository,
mirroring the pattern in SendMessageWorkerTest. Fakes are wired through a
per-test Koin graph to match each receiver's KoinComponent injection.
Also fixes a pre-existing compile break in MeshServiceNotificationsImplTest
that was missing the shortcutManager constructor argument.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Before cancelling a conversation notification in response to an inline
reply, post one final update that appends the outgoing text to the
MessagingStyle history, attributed to the local user. This gives
assistants such as Android Auto a tick to observe the sent message in
the notification's message history and surface a 'reply sent' style
confirmation before markConversationRead cancels the notification.
Extract the 'me' Person construction into buildMePerson() and share it
between showGroupSummary and createConversationNotification. The
conversation builder now optionally takes an extraOutgoingMessage which
is appended to the MessagingStyle (actions and when-timestamp continue
to be anchored on the last incoming message).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract the 'clear unread count + cancel message notification' pair into
a single suspend helper on MeshServiceNotifications so ReplyReceiver,
MarkAsReadReceiver, and ReactionReceiver use one consistent code path.
ReactionReceiver now also clears unread and cancels the notification
once the reaction dispatch succeeds, matching the other receivers.
Receivers that only depended on PacketRepository for this pair drop
that injection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>