Random Musings on the Android 13 Developer Preview 2

Random Musings on the Android 13 Developer Preview 2

Every time Google releases a brand new developer preview, I rummage by means of
the API variations report
the high-level overviews,
and even the discharge weblog put up,
to see if there are issues that warrant extra consideration from
builders. I attempt to emphasize mainstream options that any developer
may fairly use, together with issues that won’t
get fairly as a lot consideration, as a result of they’re buried within the JavaDocs.

What Acquired Clarified From Final Time

About 5 weeks in the past, I wrote about DP1.

This time round, the “13 DP1 whereas 12L is in beta?” reply is “12L is now folded
into DP2”.

Additionally, they’re now
documenting the POST_NOTIFICATIONS permission.
Of explicit notice is that this permission impacts all apps, no matter
targetSdkVersion. In case your targetSdkVersion is under Android 13’s presumed
worth of 33, the system will immediate the person to grant permission if you create
your first notification channel, for a newly-installed app on 13.
Should you create that channel at an inopportune time… you’ll
want to switch your app.

They’re additionally documenting the brand new possibility for controlling whether or not a dynamically-registered receiver is exported.
And, they talked about within the weblog put up the choice for revoking already-granted
permissions, although the strategy title modified.
Plus, they speak a bit about BODY_SENSORS_BACKGROUND.

However past that, the mysteries from DP1 stay mysteries.

What Else Acquired Introduced Of Be aware?

The most important factor is the Foreground Providers (FGS) Job Supervisor. This enables
customers to cease your app’s course of simply from the notification shade, in case your
app has a foreground service working. Of explicit notice is that the OS will
nag customers periodically about your app, in case your service runs more often than not
(20 hours out of the previous 24, with a most of 1 nag per 30 days).
Builders might wind up including flags
to keep away from customers getting bothered by these messages, which in flip will trigger
Google to take away the impacts of these flags in some future Android launch.

(for those who spend sufficient time in Android growth, predicting developer-and-Google
actions upfront turns into merely a matter of sample matching…)

The Conflict on Background Processing
continues, past the FGS Job Supervisor.

In a tweak to JobScheduler, “In Android 13, the system now tries to find out the subsequent time an app will likely be launched”,
which isn’t in any respect creepy. Nope, not one bit.

The official weblog put up mentions just a few issues that may impression a small
proportion of builders.

And, that’s just about it for official stuff.

What’s Up With All of the New Permissions?

DP2 provides 15 new permissions over DP1,
not to mention prior variations of Android.

documented as “Not to be used by third-party purposes”, which makes you marvel
why they bothered to place them in an Android SDK that’s explicitly for third-party purposes.

They’ve added three content-specific permissions: READ_MEDIA_AUDIO,
READ_MEDIA_IMAGE, and READ_MEDIA_VIDEO. The JavaDocs point out that these
are replacements for READ_EXTERNAL_STORAGE, however just for these app that focus on
Android 13 or greater. Presumably, holding certainly one of these permissions, and never READ_EXTERNAL_STORAGE,
solely provides you learn entry to that media kind and never different content material.

The opposite permission that will generate widespread curiosity is USE_EXACT_ALARM.
Android 12 added SCHEDULE_EXACT_ALARM to have the ability to use precise alarms, however this
is an “app ops” permission, one which customers must grant immediately in Settings.
USE_EXACT_ALARM seems to be a regular permission, however the JavaDocs make it
plain that the Play Retailer (and maybe elsewhere) would require you to fill out a kind
to have the ability to ship an app that requests it. As many builders are discovering
with MANAGE_EXTERNAL_STORAGE, you want a very good cause to request certainly one of these
kinds of permissions.

What Is Up Within the Clouds

Final time, I discussed ACTION_PICK_IMAGES and the way it could also be backed by CloudMediaProvider objects.
It seems that this may lengthen past photos sometime, as there are
new interfaces tied to CloudMediaProvider rendering previews on a equipped Floor
It’s doable that that is only for animated photos, however my guess is that there
could also be extra coming on this space, if not in Android 13 then in future variations
of Android.

What Makes Me Wish to Change the Channel

There are a ton of recent and adjusted courses
in android.media.television,
which pertains to precise TV channel playback on an Android TV system.

And, there are
modifications to the brand new android.media.television.interactive bundle,
together with a brand new TvInteractiveAppService.
That’s described as “a service that gives runtime atmosphere and runs TV interactive purposes”.
It’s not utterly clear what “TV interactive purposes” are which can be someway
completely different from “purposes that run on Android TV”.

What Brings to Thoughts a Beatles Tune

Actions, fragments, and dialogs all now implement OnBackInvokedDispatcherOwner.
From these, you will get an OnBackInvokedDispatcher
and use that to register an OnBackInvokedCallback,
permitting you to get again.

What Makes Me Surprise If These Dietary supplements Are FDA-Authorized

A course of may be supplemental.
It’s unclear what this implies.

There’s additionally a brand new supplementalapi bundle,
containing an AdServicesVersion. As a result of in fact an working system
needs to be within the enterprise of managing advertisements.

Oddly, given these modifications, SUPPLEMENTAL_PROCESS_SERVICE was eliminated in DP2 after
having been added in DP1.

What Fulfills Some Developer Fantasies

I see a good variety of builders wanting to dam or the screenshots proven within the overview
display. FLAG_SECURE blocks them properly, but additionally blocks all different forms of screenshots.
Some builders have been attempting to play video games with changing the exercise content material
at simply the appropriate time, like that’s ever going to be dependable. Now, we lastly can
decide out of these screenshots.

What Helps Me Keep Awake At Evening

Now you can name setStateListener() on a WakeLock
and register a WakeLockStateListener,
letting you already know if the WakeLock is enabled or disabled.

Principally, this seems to be for circumstances the place you need the wakelock to be enabled,
however the system determined to disable it.

What Else Caught My Eye

There are a bunch of recent characteristic identifiers,
together with ones that appear tied to the 12L merger (e.g., FEATURE_EXPANDED_PICTURE_IN_PICTURE).

Android 12L added exercise embedding, as one solution to make the most of bigger
display sizes. 13 DP2 seems to allow you to management which apps can embed your
actions, by way of android:knownActivityEmbeddingCerts
attributes on <utility> and <exercise>. And, it seems that you could
permit arbitrary apps to embed your exercise by way of android:allowUntrustedActivityEmbedding.

There’s now an EthernetNetworkSpecifier,
suggesting a continued push into less-mobile gadgets, like maybe TVs.

There’s now a Dumpable and DumpableContainer pair of interfaces,
for dumping stuff to a PrintWriter.

showNext() and showPrevious() on RemoteViews are actually deprecated
in favor of setDisplayedChild().

There’s a brand new LocaleConfig class,
with a damaged rationalization.

There’s a brand new isLowPowerStandbyEnabled()
technique on PowerManager, persevering with the Conflict on Background Processing. As a result of
when you could have 18 energy modes, including a nineteenth will assist. On the opposite finish of the
energy spectrum, now you can discover out if you’re plugged right into a dock,
although I now really need BATTERY_PLUGGED_WHARF and BATTERY_PLUGGED_PIER as effectively.

And it nonetheless appears as if modifications are afoot for android:sharedUserId, as
the brand new EXTRA_NEW_UID
will inform you about modifications to uids.