Slack Aug 25, 2021

Building Android Conversation Bubbles

Article Summary

Mathias Roth from Slack reveals how a hardcoded Android display name prefix saved their Conversation Bubbles implementation. What started as straightforward API work turned into a detective story involving work profiles, websockets, and virtual displays.

Slack's Android team built support for Conversation Bubbles on Android 11, allowing DMs to float over other apps. The implementation required MessagingStyle notifications, Sharing Shortcuts with custom icons, and a resizable embedded Activity. What seemed simple became complex fast.

Key Takeaways

Critical Insight

Slack successfully shipped Android Conversation Bubbles by solving notification lifecycle issues, websocket conflicts, and a critical Work Profile bug affecting 5% of Android 11 users.

The team's solution for handling multiple workspace websockets while a Bubble floats over the main app is surprisingly elegant.

About This Article

Problem

When conversations were marked as read in Slack, the notification clearing mechanism would immediately dismiss Bubbles. This meant that opening a Bubble would cause it to disappear within seconds, which frustrated users.

Solution

The team added a check to verify whether an active Bubble is tied to a notification before canceling it. This prevented the conversation view from closing prematurely.

Impact

Users could keep Bubbles open for ongoing conversations without the UI collapsing unexpectedly. This made it easier to multitask and read messages across different devices.