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
-
A network security config can now declare that certificate transparency verification is required for a particular network.
-
We can now opt into tapjacking attacks in some scenarios, if I am interpreting this correctly. It is unclear why we would want to do that.
-
You can now get the “state of health” of the battery. This is “the remaining estimated full charge capacity relative to the rated capacity in %”. Given that we are talking about batteries, I am disappointed that the value was not named
BATTERY_PROPERTY_STATE_OF_SHOCK
. 😁 -
We can now allow a
PendingIntent
to have “all background activity start privileges, including those normally reserved for privileged contexts (e.g., companion apps or those with theSTART_ACTIVITIES_FROM_BACKGROUND
permission)”, via aMODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
flag. I wonder if this will get abused enough to warrant a permission. -
Speaking of permissions, five new ones showed up. The
RANGING
permission may be tied to this ranging change. -
You can now tweak the
Intent
matching rules applied to your components (or to your app overall) viaintentMatchingFlags
. -
A
Spanned
object now has a new span type,NoWritingToolsSpan
. This allows you to indicate a section of text that soft keyboards (IMEs) should not offer to modify, such as quoted text. -
Via
StrictMode
, you can now find out when your app was prevented from launching an activity in the background. This sort of thing might be useful to monitor in the field. -
Devices can now declare that they support the Thread networking protocol. I do not look forward to trying to make sense of Thread threads, let alone discussion threads about Thread threads.
-
There are now standard
Intent
actions for capturing a “motion photo”. -
A
VirtualDisplay
can now be rotated. -
ApplicationStartInfo
now tells you generally why your process was started, viagetStartComponent()
. You get told which of the four component types triggered the start, but not the specific class. There is also a somewhat-disturbingSTART_COMPONENT_OTHER
if your process was started just for the fun of it, or something.
What Happens Next?
We should get Android 16 Beta 1 in January.