Random Musings on the Android 16 Beta 2

In my previous musings post, I wrote:

Android 16 Beta 1 probably is the last Android 16 pre-release version with significant API changes.

I had not realized that “platform stability” is slated for March, after two betas. This is a bit of a change from our recent round of OS version updates, where platform stability hit with Beta 1.

Regardless, here are a fresh round of musings, based on the API differences report and the blog post. As usual, I focus on things that did not get mentioned in the blog post or where the blog post had some issues, such as with the first items.

What Makes Me Like Editors

In the blog post, there is a section named “Elegant font APIs deprecated and disabled”, with the following:

Apps targeting Android 15 (API level 35) have the elegantTextHeight TextView attribute set to true by default, replacing the compact font with one that is much more readable. You could override this by setting the elegantTextHeight attribute to false.

Android 16 deprecates the elegantTextHeight attribute, and the attribute will be ignored once your app targets Android 16. The “UI fonts” controlled by these APIs are being discontinued, so you should adapt any layouts to ensure consistent and future proof text rendering in Arabic, Lao, Myanmar, Tamil, Gujarati, Kannada, Malayalam, Odia, Telugu or Thai.

That is fine, up to the part about the “UI fonts” being discontinued. It is unclear if this means:

  • The changes made in Android 15 are being rolled back, and we’re on our own for dealing with this font rendering issue, or

  • The changes made in Android 15 are being mandated (no more opt-out)

What Seems Janky

There are a new series of APIs for identifying UI jank at runtime, centered around AppJankStats and RelativeFrameTimeHistogram. Presumably, this ties into the Jetpack JankStats library.

You can ask a View to add your own jank stats, though it is unclear when we would want to do this.

What Seems Advanced, and Possibly Protective

Google has had their Advanced Protection Program for quite some time. Android 16 now has AdvancedProtectionManager. Right now, all we can do is find out when the device has been enrolled in “advanced protection”, or unenrolled from the same. I am assuming that the naming here is intentional, and that AdvancedProtectionManager is connected to the Advanced Protection Program, but that is not certain.

Note that you might need to request the QUERY_ADVANCED_PROTECTION_MODE permission to use this API, though it is unclear whether this is a runtime permission or not.

What Might Be Fruit-Flavored

iOS and Android have had distinct approaches towards application settings. iOS tends to expect apps to register to have a screen inside the system Settings app, with centrally-managed settings. Android has largely left application settings up to individual developers.

Android 16, though, adds a SettingsPreferenceService that apps can implement. This exposes APIs to enumerate available settings and allow clients to read and write those settings. My guess is that this is a foundation piece for eventually having the system Settings app expose application-level settings via a standard UI.

What Other Things Changed in Settings

There are four new action strings for launching screens within the system Settings app:

  • What is the first day of the week
  • What is the unit measurement system (SI, Imperial)
  • What is the temperature unit system (Celsius, Fahrenheit)
  • What is the “region” (uncertain what this means, presumably a geographic region)

As a physics major, I hope that Kelvin is a valid temperature unit.

What Else Seemed Interesting

DevicePolicyManager now has APIs related to “auto time”. Based on the API, I am guessing that this refers to the device being able to synchronize the time and time zone with external data sources, such as SNTP servers or time data baked into cell signals.

App widgets are returning to the “keyguard” (locked screen state), at least on tablets IIRC. If you do not want your app widget being offered there, you can now declare that expectation.

You can now find out when displays are added, removed, and altered. “Altered” includes changes to the refresh rate.

There are a bunch of additional IAMF audio formats for encoding/decoding.

There are many new key events, including F13 through F24.