Notification sync
Purpose
Show how the phone acquires Notification Listener privileges, narrows mirrored apps, and forwards payloads downstream; and how the glasses consume them.
Entry points
Phone:
NotificationActivityMessageNotificationListenerService
Glass consumer:
MessageReceiveActivityinsideglassdemo
Platforms
- Phone + Glass
Main files
Flow
- User opens the notification settings surface.
- Guard logic checks whether listener access is granted.
- If not, deep-link to the OS listener approval screen.
- Enumerate installed apps and let the user opt into mirroring.
- Listener service receives
StatusBarNotificationobjects and filters per policy. - Glass logs or renders the forwarded payload.
FAQ
Capturing vs rendering
Both are touched, but the stress test is capture + policy on the phone; the glass side is minimal on purpose.
Why permission setup often “fails”
Listener access is not a standard runtime dialog — you must enable the specific listener component and any app-level gates stored in prefs.
Caveats
- UI toggles differentiate global vs lock-screen-only policies.
- When listener access lapses, the sheet auto-routes users back to approve it again.