Skip to content

fix(notification): use content uri for bubble icon - #6896

Open
SeniorZhai wants to merge 1 commit into
masterfrom
fix/notification-bubble-icon
Open

SeniorZhai wants to merge 1 commit into
masterfrom
fix/notification-bubble-icon

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

Cache circular notification avatar bitmaps in app cache and pass a FileProvider content URI to BubbleMetadata with bitmap fallback, while loading the avatar via Coil off the main thread with hardware bitmaps disabled.
@gaotic

gaotic Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

AI review done for 7530d5d in 34m 23s · 2 comments

Quality: Needs fixes before merge. I traced both paths through the PR and AOSP source and reproduced the shortcut race with stubbed Android APIs. Device rendering remains unverified.

Role Model Status
Reviewer GPT codex/gpt-6.2-sol · effort high ok
Reviewer Grok grok/grok-4.7@500k · effort medium failed (timed out)
Summary codex/gpt-6.2-sol · effort medium ok

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review · GPT (Grok failed) · 7530d5d

Request changes. git diff --check passed, and the focused Kotlin check reproduced the shortcut eviction. Offline Gradle configuration could not resolve the Foojay plugin, so compilation, lint, and unit tests did not run.


buildBubble(context, conversation, notificationBuilder, message, resource, person)
notificationManager.notify(conversationNotificationId(message.conversationId), notificationBuilder.build())
buildBubble(context, conversation, notificationBuilder, message, resource, person)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concurrent notification jobs can evict a newly published bubble shortcut before its notify() call. With two dynamic slots, posting B and C while A is between updateShortcuts() and notify() can remove A before Android 11 resolves it, so A cannot bubble. Prepare the icon off-thread, then serialize shortcut publication and notification posting together.

val bubbleIcon = createBubbleIcon(context, conversation.conversationId, bitmap)
val bubbleMetadata =
NotificationCompat.BubbleMetadata.Builder(bubbleIntent, icon)
NotificationCompat.BubbleMetadata.Builder(bubbleIntent, bubbleIcon)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content URI is attached to bubble metadata, but AOSP SystemUI uses the conversation shortcut’s icon whenever it resolves the shortcut. This notification publishes that shortcut with a bitmap, so the PNG write leaves the displayed bubble icon bitmap-backed. Put the URI on the shortcut icon that SystemUI loads. AOSP icon selection

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.

1 participant