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, Bubbles would disappear immediately. This created a frustrating experience where opening a Bubble would cause it to close within seconds.
The team added a check to see if a Bubble was actively being used before canceling its notification. This stopped the conversation window from closing prematurely.
Users could keep Bubbles open while having ongoing conversations without them unexpectedly closing. This made it easier to multitask and read messages across different devices.