Add support for embedded icons and custom layouts in Android notifications

The practical upshot of this is that gmail, messages and similar apps
show the sender's profile picture on the glasses, the Dexcom app shows a
This commit is contained in:
James Babcock committed 2026-10-31 12:39:20 -07:00
1 parent 032fc307e9
commit 032797f0f6
10 files changed
+633 -93

No files matched your search

+9 -3
View File
@@ -4,7 +4,7 @@ import { AncsClient, ANCS_CONNECT_MESSAGE, type AncsState } from '../g2/ancs-cli
import { rememberNotificationSources } from './notification-sources'
import type { AndroidNotification } from './notification-types'
export type { AndroidNotification, AndroidNotificationAction } from './notification-types'
export type { NotificationIconsResult, NotificationIconResult, NotificationPictureResult } from './notification-icons'
export type { NotificationIconsResult, NotificationIconResult, NotificationImageResult } from './notification-icons'
export const ALL_NOTIFICATIONS = 0x7fffffff
let active: AncsClient | null = null
@@ -61,7 +61,13 @@ export function readNotificationIconByKey(key: string, _allowStale: boolean) {
const notification = readActiveNotifications(ALL_NOTIFICATIONS).find(n => n.key === key)
return {icon: notification ? categoryIcon(notification.category) : null,stale:false}
}
// ANCS carries no attachments.
// ANCS carries no attachments, avatars or custom layouts.
export function readNotificationPicture(_notification: AndroidNotification, _maxWidth: number, _maxHeight: number, _allowStale: boolean) {
return {picture: null,stale:false}
return {image: null,stale:false}
}
export function readNotificationLargeIcon(_notification: AndroidNotification, _size: number, _allowStale: boolean) {
return {image: null,stale:false}
}
export function readNotificationCustomView(_notification: AndroidNotification, _maxWidth: number, _maxHeight: number, _allowStale: boolean) {
return {image: null,stale:false}
}