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 significantimprovement over DP1.The ���new features and APIs page���and blog posthighlight several changes. Some of those are also explored by Mishaal Rahman inthis 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 gotstopped, with corresponding stop reason constants (e.g., STOP_REASON_APP_STANDBY,STOP_REASON_QUOTA).

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

What Might Be Key

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

Among other things, KeyStoreManager has grantKeyAccess(), which allows App A to grantaccess to a key to App B. While I can see possible use cases, this does not seem to bedefended 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 thatcertificate transparency verification is requiredfor 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 wasnot 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 the START_ACTIVITIES_FROM_BACKGROUND permission)���,via a MODE_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 permissionmay be tied to this ranging change.

You can now tweak the Intent matching rules applied to your components (or to yourapp overall) via intentMatchingFlags.

A Spanned object now has a new span type, NoWritingToolsSpan.This allows you to indicate a section of text that soft keyboards (IMEs) should notoffer to modify, such as quoted text.

Via StrictMode, you can now find out whenyour 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 discussionthreads 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,via getStartComponent().You get told which of the four component types triggered the start, but not the specificclass. There is also a somewhat-disturbing START_COMPONENT_OTHERif your process was started just for the fun of it, or something.

What Happens Next?

We should get Android 16 Beta 1 in January.

 •  0 comments  •  flag
Share on Twitter
Published on December 18, 2024 15:39
No comments have been added yet.