Random Musings on the Android 12 Developer Preview 2
Each time Google releases a follow-on developer preview, I rummage throughthe incremental API differences reportthe release notes,and even the release blog post,to see if there are things that warrant more attention from developers. I try to emphasize things that mainstream developers might use but may notget quite as much attention, because they are buried in the JavaDocs.
Just shy of a month after Developer Preview 1 was released, we got Developer Preview2!
What Amuses MeGoogle has gotten into a bit of a habit of soft-releasing certain changes. Theyinclude the changes in the SDK, but do not talk about them in the announcementsand documentation. Then, when the next developer preview comes around, they starttouting the ���new��� stuff��� even when it had been in the SDK already. So, you may wantto start by reviewing my Developer Preview 1 musings,as I mention some things there that only formally got announced today, including:
Hiding application overlay windows
Secure lockscreen notification actions
App digest API
Keeping companion apps awake
And, as a result, these random musings will be a mix of stuff that is ���really real���here in DP2 and a preview of stuff that might get announced in DP3 in a month or so.
What I Apparently Missed For YearsI never noticed the bandwidth estimation APIstucked away in the NetworkCapabilities object. They have been around since Android 5.0;Android 12 is improving them a fair bit, in terms of expected accuracy and relevance.
What May Cause Problems For YouIf you use the accelerometer, gyroscope, or magnetic field sensors, you may needto declare a permission to read those at high rates.
What Is Finally Getting Some LoveApp widgets ��� which had been a moribund backwater for years ��� are gettingsome updates. It���s almost as if competition matters or something.
But, we canapparently use subclasses of CompoundButton now,including RadioButton and RadioGroup.A bunch of new methods were added for configuring particular elements(e.g., setColorStateList()). We can request specific sizesand control the maximum size for a resize operation.And we can provide a descriptionand a layout to use instead of an image for the preview.I thought app widgets might get replaced someday, but at least for now, Googleis trying to improve what we already have.
What Just Keeps Getting More and More LoveNotifications now have a CallStyle.Despite the description, based on other options,this appears to be designed for VOIP apps or other apps that might raise a notificationrepresenting an incoming call.
What May Make a Splash in DP3SplashScreenis a thing now.I seem to recall a certain firm decrying the use of splash screens a few years ago ���wonder whatever became of them���
What Makes Me Wish I Knew More About Mobile CarriersApparently, 5G networks can be ���sliced���.Mobile carriers can ���virtually divide theirnetworks in portions and use different portions for specific use cases; for example,a corporation can have a deal/agreement with a carrier that all of its employees���devices use data on a slice dedicated for enterprise use.��� I am not well-versed in 5G,but I am still surprised that I had not heard about this capability.
There is a new VcnManagerto be able to ���configure and manage Virtual Carrier Networks���. I am not an expertin mobile networks, but this feels a bit like exposing Google Fi-like ability tocombine multiple networks into a seamless aggregate network.
What May Be Good or May Be BadThere is a new SCHEDULE_EXACT_ALARM permission,described as ���allows an app to use exact alarm scheduling APIs to perform timing sensitive background work���.I do not know if this means that the exact family of AlarmManager APIs willnow work better (good!) or if this means that you need a permission to be ableto use them even in their current state (less good!).
What Is Here Today, Gone TomorrowThe SMS_FINANCIAL_TRANSACTIONS permissionis deprecated. And the DP1 BACKGROUND_CAMERA and RECORD_BACKGROUND_AUDIOpermissions were removed outright.
A version of sendStickyBroadcast()was added and deprecated��� both in Android 12 DP2, if the docs are to be believed.
What Is Gone Today, Stumbling Around Like a Zombie TomorrowThe deprecated AnalogClock widget got new methods.
What Is Still Missing in ActionThe app search APIs were revisedbut were not yet announced.
What Else Seems InterestingApps can now persist a preferred night mode behavior.
There may be a new option to initialize the native heap with zeros,which, if true, is a nice safety enhancement.
There are now List forms of methods like checkUriPermissions(),for being able to check a list of Uri values at once.
We can now ask a PendingIntent what it is used for,such as isActivity().
There is now a new external storage directory for recordings.
We can control the thumb and track icons used by a Switch,as well as the button icon for a CompoundButton.
We now have solid and patterned ripples.
Apps can control notification channel��� fields?.
There is a new MediaMetricsManager.that does��� something with media metrics.
There are now an official system color palette.
We may be getting APIs for determining the status of individual batteries.It���s unclear if this is for devices with multiple internal batteries or ifthis is for some sort of external battery.
There may be an optionfor enabling hardware-assisted memory tagging.
There may be new options for different types of app installs, such as���bulk���.
We now have headless usersand foreground users.


