Skip to content

feat: Add profile picture/BIMI in mail notification#2854

Merged
aymericmariaux merged 14 commits intomainfrom
contact-picture-in-notification
Apr 27, 2026
Merged

feat: Add profile picture/BIMI in mail notification#2854
aymericmariaux merged 14 commits intomainfrom
contact-picture-in-notification

Conversation

@amariaux
Copy link
Copy Markdown

@amariaux amariaux commented Apr 8, 2026

Retrieving and passing image URLs/Initials + BIMI authorization and BitMap display via setLargeIcon

@amariaux amariaux requested a review from a team April 8, 2026 12:34
@amariaux amariaux removed the request for review from a team April 8, 2026 12:34
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

PR Reviewer Guide 🔍

(Review updated until commit b6312c7)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Parcelable Deserialization Error

NotificationPayload was changed from Serializable to Parcelable, but line 106 still uses intent.serializableExtra() to retrieve the payload. This will always return null or throw ClassCastException because Parcelable objects cannot be retrieved via the Serializable API. Must use intent.parcelableExtra() (available via the added core-ktx dependency) to match the new Parcelable implementation.

val payload = intent.serializableExtra(EXTRA_PAYLOAD) as? NotificationPayload ?: return@launch
Wrong Mailbox Context for BIMI

The isBimiEnabledFlow in AvatarMergedContactData uses AccountUtils.currentMailboxId, which may not match the specific mailbox being processed in showNotification(). If background sync processes multiple mailboxes, the BIMI feature flag from the wrong mailbox (the "current" one rather than the target one) could be applied to notifications. Consider checking the feature flag directly from the mailbox parameter passed to the function.

val isBimiEnabled = avatarMergedContactData.isBimiEnabledFlow.first();
val mergedContacts = avatarMergedContactData.mergedContactFlow.first()

Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationPayload.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Persistent review updated to latest commit 95c222d

Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationPayload.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Persistent review updated to latest commit 5c925cb

Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationPayload.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
@amariaux amariaux force-pushed the contact-picture-in-notification branch from 5c925cb to 0f4dac8 Compare April 8, 2026 14:15
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Persistent review updated to latest commit 0f4dac8

Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationPayload.kt Outdated
@amariaux amariaux force-pushed the contact-picture-in-notification branch from 3869ab9 to 4fe5f78 Compare April 9, 2026 07:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Persistent review updated to latest commit 4fe5f78

Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
@amariaux amariaux force-pushed the contact-picture-in-notification branch from b4f9fe8 to 063f228 Compare April 9, 2026 08:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Persistent review updated to latest commit 063f228

Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationPayload.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
@amariaux amariaux force-pushed the contact-picture-in-notification branch from 063f228 to bfb9405 Compare April 9, 2026 08:52
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Failed to generate code suggestions for PR

@amariaux amariaux requested a review from a team April 9, 2026 11:34
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Failed to generate code suggestions for PR

@benjaminVadon benjaminVadon self-requested a review April 13, 2026 05:50
Comment thread app/src/main/java/com/infomaniak/mail/views/itemViews/AvatarMergedContactData.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/views/itemViews/AvatarMergedContactData.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/views/itemViews/AvatarMergedContactData.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt
Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

amariaux pushed a commit to Infomaniak/android-core that referenced this pull request Apr 13, 2026
@amariaux amariaux force-pushed the contact-picture-in-notification branch from a3ab2cd to a2eedeb Compare April 13, 2026 14:26
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit a2eedeb

@amariaux amariaux force-pushed the contact-picture-in-notification branch from 8b02c14 to fab1029 Compare April 15, 2026 14:45
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit fab1029

Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit 1c84b8b

Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt
Comment thread app/src/main/java/com/infomaniak/mail/receivers/NotificationActionsReceiver.kt Outdated
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit b6312c7

@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

Comment thread app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Outdated
Comment thread gradle/libs.versions.toml Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/FetchMessagesManager.kt Outdated
@aymericmariaux aymericmariaux force-pushed the contact-picture-in-notification branch from 0203ab9 to 93fff02 Compare April 23, 2026 14:13
Replace Flow with LiveData as it was unnecessary for this use case.
@aymericmariaux aymericmariaux force-pushed the contact-picture-in-notification branch from 3356b45 to 28ee12d Compare April 24, 2026 06:32
@sonarqubecloud
Copy link
Copy Markdown

@aymericmariaux aymericmariaux merged commit 8fe126f into main Apr 27, 2026
7 checks passed
@aymericmariaux aymericmariaux deleted the contact-picture-in-notification branch April 27, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants