Random Musings on the Android 14 Developer Beta 1
When Google releases a new developer preview, I rummage throughthe API differences reportthe high-level overviews,and even the release blog post,to see if there are things that warrant more attention from developers. I try to emphasize mainstream features that any developermight reasonably use, along with things that may notget quite as much attention, because they are buried in the JavaDocs.
We���ve moved out of developer previews and into beta releases. That slows downthe pace of change, but still there some things worth mentioning. My focus ison the developer side; see Mishaal Rahman���s Twitter thread for a broader look at Beta 1.
What Got Top-Line Attention?One trend with these musings is that I cover something before Google does, forone reason or another. Some stuff from my DP2 musingsthat were announced this time were:
Also, Path is no longer a largely write-only API,which has been a large pain point for developers over the years.
Something I noticed in DP2 but didn���t understand enough to write about is thenew limitation on accessibility services. Apps can indicate certain UI elementsthat are only available to ���true��� accessibility services, those that actuallyhelp people with accessibility. Mishaal Rahman wrote more about that.You can use ACCESSIBILITY_DATA_SENSITIVE_YESor android:accessibilityDataSensitiveto enable this.
What Else At Least Was AnnouncedThe concept of ���non-dismissable notifications��� was always a bit scary, insofaras apps can really annoy users with those. They have been slowly becoming moredismissable, and Android 14 makes them mostly dismissable.
While dynamic code loading via PathClassLoader and kin might get you banned fromthe Play Store, it���s still a technique used by many an app. Android 14requires that code to be marked as read-only,once you are targeting Android 14.
Eight years ago, I published some safe unZIP codeto avoid path traversal attacks.Android 14 now enforces that at the system level,for apps targeting Android 14. I really hope safe unZIP code becomes available in a Jetpacklibrary, so it can be used by all apps on more OS versions.Bonus points if they also stop ZIP bombs.
One hole in the background activity start limitation was IPC. Other apps could arrangeto start activities by convincing some other app to start them, such as via a PendingIntent. Android 14 makes that opt-in,for apps targeting Android 14.
What���s Outta HereoverridePendingTransition() on Activityis deprecated, replaced by overrideActivityTransition().
Google removed the ���data transfer��� type of JobInfo.
What Could Be Kinda WildThe IntentFilter class appears to now allow filtering by extras.Since the parameter is a PersistableBundle, this is not merely filtering based on theexistence of extras by name, but presumably they also must match on value. Prior tothis, extras were purely ���payload��� of an Intent and were not something that you couldfilter upon. It will be interesting to see where Google puts this to use.
What Else Caught My EyeView continues to get handwriting recognition APIs.
Google���s ill-documented HttpEngine now supports a bi-directional streamAPI, backed by a BidirectionalStream class.
The NetworkCapabilities API now explicitly supports Thread,of particular interest to those working with Matter.
I had not realized this, but apparently getType() on a ContentProvider wasnot defended by read permissions. Since that could leak information (the MIME typefor a particular Uri), they added getTypeAnonymous().getType() will be protected by read permissions for providers that also implementgetTypeAnonymous().
In DP1, Google stated that context-registered receivers might not receive broadcastsin real time.They have now added some APIs for the reverse direction: a broadcast itself,via BroadcastOptions, can have a deferral policy. The description ofDEFERRAL_POLICY_UNTIL_ACTIVEsounds a lot like their DP1 announcement��� except this would be opt-in by thesender. ����
Broadcasts now have some form of ���delivery group��� semantics,though the documentation on this is confusing.
And, there is now a dedicated exceptionif you try to startForeground() a service that is not actually started.


