Skip to content

feat(wearable): add ANCS notification attributes parser and model - #3747

Open
digivasserver-ai wants to merge 2 commits into
microg:masterfrom
digivasserver-ai:wearable/ancs-notification-parser
Open

feat(wearable): add ANCS notification attributes parser and model#3747
digivasserver-ai wants to merge 2 commits into
microg:masterfrom
digivasserver-ai:wearable/ancs-notification-parser

Conversation

@digivasserver-ai

Copy link
Copy Markdown

What

The first, fully self-contained block toward the notification bridge for WearOS support (#2843): a pure-JVM ANCS (Apple Notification Center Service) notification-attributes parser and model.

  • AncsNotifications.parse(byte[]) decodes a Notification Attributes Data Source frame into a structured value object (notificationUid, appIdentifier, title, subtitle, message, messageSize, date, positive/negative action labels).
  • AncsNotifications.readAttributesRequest(uid, ids…) builds the matching Control Point request.
  • Strict bounds checking: truncated frames and overlength attribute values are rejected instead of yielding partial state; unknown/future attribute IDs are skipped so the parser stays forward compatible.
  • The model implements com.google.android.gms.wearable.AncsNotification, ready to be routed via WearableListenerService#onNotificationReceived.

Why

The AncsNotification API surface is currently an empty interface and injectAncsNotificationForTesting is unimplemented — there is no notification path at all on the wear side. This is the parsing/transport-adjacent core that the companion notification flow needs regardless of which Bluetooth transport lands first.

Verification

  • 7 unit tests (AncsNotificationsTest) covering full frames, the MESSAGE_SIZE uint32 special case, unknown-attribute skipping, and malformed/truncated rejection — all passing (verified standalone with junit:junit:4.13.2).

Next steps (tracked, device-dependent)

  • Notification sync engine feeding parsed notifications to WearableListenerService.
  • Companion pairing/transport wiring so frames arrive from the wear device.

digivasserver-ai added 2 commits August 29, 2026 01:31
First block of the notification bridge for WearOS support (microg#2843).
Implements parsing of ANCS 'Get Notification Attributes' Data Source
frames into a structured value object (uid, app identifier, title,
subtitle, message, message size, date, action labels) with strict
bounds checking, plus a Control Point request builder. Pure JVM,
covered by 7 unit tests.
@TobiPeterG

Copy link
Copy Markdown

Can you please provide a video of you pairing your watch with your phone using this version?

@digivasserver-ai

This comment was marked as spam.

@digivasserver-ai

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants