Random Musings on the Android 16 Developer Preview 2

(I really wanted to open this post with an Android development-themed riff on “Twas the Night Before Christmas”, but the rhyming part of my brain is malfunctioning right now…)

So, we got our second and final developer preview for Android 16. I say “final developer preview” because the next round should be classified as a beta.

Google actually talked a bit more about this release, which is a significant improvement over DP1. The “new features and APIs page” and blog post highlight several changes. Some of those are also explored by Mishaal Rahman in this Android Police post.

Google still has not documented “app functions”. To me, that feels like it might be running late and not make the Android 16 cut.

Beyond that, here is what else caught my eye:

What Might Make Work Wobbly

All apps on Android 16 are subject to “JobScheduler quota optimizations”. To be blunt, this section is not well-written. For example, it refers to “active standby buckets”, which (at present) aren’t a thing, at least in terms of the SDK. Still, from the tone, it feels like background jobs (including WorkManager work) might get stopped more frequently. Fortunately, they did add getStopReason() methods so we can find out why work got stopped, with corresponding stop reason constants (e.g., STOP_REASON_APP_STANDBY, STOP_REASON_QUOTA).

Also, if you had been relying upon the deprecated setImportantWhileForeground() option on JobInfo.Builder, that no longer does anything. While they were at it, they also deprecated and nerfed isImportantWhileForegound() on JobInfo.

What Might Be Key

There is a new KeyStoreManager system service, retrieved via getSystemService() and KEYSTORE_SERVICE.

Among other things, KeyStoreManager has grantKeyAccess(), which allows App A to grant access to a key to App B. While I can see possible use cases, this does not seem to be defended by a permission or anything, and it seems like an obvious thing for malware to want to use. 🤷🏻

What You Might Find Interesting

What Happens Next?

We should get Android 16 Beta 1 in January.