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
- Trampoline Activity routes shortcuts to three different UIs based on launch context
- Hardcoded display name check detects Bubble launches until Android 12 added official API
- Canceling notifications dismisses Bubbles, requiring read state checks before clearing
- Work Profile bug on Android 11 broke Bubbles for 5% of users
- ActiveTeamDetector websocket model broke with multi team Bubble scenarios
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.
About This Article
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.
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.
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.