Android 12 Developer Preview 2 is here with better notification security and picture-in-picture enhancements
With each passing day, we grow closer and closer to the eventual release of the next major Android OS: Android 12. In case you are yearning to see what the future holds for the forthcoming iteration of Android, Google has you covered for today. The company has just announced a new Developer Preview build for eligible Pixel devices. Android 12 Developer Preview 2, like the first Developer Preview, is still intended only for developers, and the list of changes mentioned in the blog post focuses on new APIs and platform behavior changes that developers will have to adapt to. Here’s what has changed.
What’s new in Android 12 Developer Preview 2
Trust and safety
- Allowing an app to overlay windows on top of other apps poses an obvious security risk. To that end, the new HIDE_OVERLAY_WINDOWS permission introduced in Developer Preview 2 ensures that an app can call Window#setHideOverlayWindows() to indicate that all TYPE_APPLICATION_OVERLAY windows should be hidden when the app’s window is visible.
- Notification visibility controls have been updated in this new preview release. Now you can configure notification actions so that they will always generate an authentication challenge when triggered from the lockscreen. For example, a messaging app now requires authentication before deleting a message or marking it as read.
- Android 12 Developer Preview 2 has added support for a simpler, more efficient way to obtain the checksum of an installed app. Developers can choose from several standard digest algorithms such as SHA256, SHA512, Merkle Root, and others. A backward compatible version of this feature is in the works, which should be available in the form of a Jetpack library in the near future.
New Android 12 API Changes
- Rounded corners: In Android 12 Developer Preview 2, developers can check if the device has a screen with rounded corners and get their details. From the perspective of UI design, one can now utilize the absolute details for each rounded corner as well as the corner details relative to an app’s bounds.
- Picture in Picture (PIP) improvements: Apps can now enable seamless resize to let the system resize the PIP Activity when needed. In addition, enabling auto-PIP now makes the system directly transition the app to PIP mode on an up-to-home gesture, without waiting for the up-to-home animation to complete. Finally, Android now supports stashing the PIP window by dragging it to the left or right edge of the screen.
- Updates to companion device app API: Wearable devices like smartwatches and fitness trackers usually need a dedicated app for managing them. Google wants to make it easier for such apps to be running and connected whenever an associated companion device is nearby. To do that, Android 12 Developer Preview 2 has introduced a new CompanionDeviceService API. Moreover, the new companion device profile greatly simplifies the companion device enrollment process.
- Bandwidth estimation improvements: Google has greatly enhanced the existing bandwidth estimation APIs. Developers can now get an estimate of aggregate throughput per carrier or Wi-Fi SSID, network type, and signal level, for all users on the device.
- Visual effects: Applying common graphics effects is now easier than ever in Android 12 with the RenderEffect class. You can now separately apply blurs and color filters, or combine these effects as chain effects as a whole.
You can go here to see the full API diff between Android 12 DP1 and DP2. Since Google has revamped several of the APIs, make sure to run and debug your app through the behavior change toggles to prepare it for targeting Android 12. Feedback can be given here.
Download Android 12 Developer Preview 2
To install Android 12 Developer Preview 2 on a Pixel device, you must have a Pixel 3, Pixel 3 XL, Pixel 3a, Pixel 3a XL, Pixel 4, Pixel 4 XL, Pixel 4a, Pixel 4a 5G, or Pixel 5. We have links to download the latest system images for these Google Pixel devices on this page. You can either take the incremental OTA update or flash the builds manually. In case you don’t have a compatible device, you can run the build in Android Studio’s Android Emulator.
There should be one more major Developer Preview release in April followed by a couple of beta releases. The stable Android 12 build will be made available sometime in Q3 of 2021 if all goes to plan.
For all the latest Android 12 news, bookmark the following tag: