Repository navigation
fix(notification): use content uri for bubble icon - #6896
SeniorZhai wants to merge 1 commit into
Conversation
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.
|
AI review done for 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.
|
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
No description provided.