Bubbles in Android Q will fully replace the overlay API in a future Android version
Google’s annual I/O developer conference is chock full of news about all of Google’s apps, services, and developer tools, but the Android OS is one of the biggest topics. Android, now used on over 2.5 billion devices globally, takes up a huge chunk of time at Google I/O. There’s a lot of changes to the platform – so many, in fact, that it’s impossible for Google to bring equal attention to every change. During the “What’s new in Android” talk on the first day of I/O 2019, Google announced a major upcoming change to a very old API: SYSTEM_ALERT_WINDOW. The API lets developers draw an overlay on top of the screen, and its most famous use is for chat head bubbles (think Facebook Messenger). Now that Google offers an alternative API to SYSTEM_ALERT_WINDOW in the form of Bubbles in Android Q, Google has decided to eventually deprecate SYSTEM_ALERT_WINDOW in a future Android release.
The writing has been on the wall for SYSTEM_ALERT_WINDOW’s impending deprecation. Allowing an app to overlay windows on top of other apps poses an obvious security risk; the infamous “Cloak and Dagger” exploit proved that SYSTEM_ALERT_WINDOW needed to be reined in.
Google started restricting the areas in which overlays can draw back in Android Oreo, and they’ve completely removed access to the API for Android Q (Go Edition.) The biggest problem with SYSTEM_ALERT_WINDOW is that, despite the fact that users are supposed to manually grant the permission through a special permission management screen, the Google Play Store automatically grants access to the permission upon installation. In Android Q, access to the SYSTEM_ALERT_WINDOW permission is transient: side-loaded apps only have access to the permission for 30 seconds and apps installed via Google Play have access to the permission until a device reboot.
But in a future Android release, SYSTEM_ALERT_WINDOW will be fully deprecated, and all Android apps using it will have to transition over to the new Bubbles API introduced in Android Q beta 2.
However, Bubbles are a part of the Notification API, so it’s not a full replacement for SYSTEM_ALERT_WINDOW. Although Bubbles come in the form of a tiny, resizable activity, they must be launched by the user from a Notification that meets one or more of these conditions.
Developers of apps that use the SYSTEM_ALERT_WINDOW API, of which there are many, will have to start looking into the alternative Bubbles API in the near future. We tried to get a timeline of when Google plans on deprecating the API but didn’t get an answer. Assume the API won’t stick around for very long, though: I would bet it will no longer be available in Android R.
You can watch the entire “What’s new in Android” session from the following YouTube link (starts at 16:53.)