Android 13

Nur Özkaya
8 min readSep 15, 2022

Performance and battery

Foreground Services (FGS) Task Manager
Starting in Android 13 (API level 33), users can complete a workflow from the notification drawer to stop apps that have ongoing foreground services. This affordance is known as the Foreground Services (FGS) Task Manager. Apps must be able to handle this user-initiated stopping.

Handle user-initiated stopping of apps running foreground services
This list is labeled Active apps. Next to each app is a Stop button.
When the user presses the Stop button next to your app in the FGS Task Manager, then the following actions occur:

👾 The system removes your app from memory. Therefore, your entire app stops, not just the running foreground service.
👾 The system removes your app's activity back stack.
👾 Any media playback is stopped.
👾 The notification associated with the foreground service is removed.
👾 Your app isn't removed from history.
👾 Scheduled jobs are preserved.
👾 Alarms are preserved.
👾 The system doesn’t send your app any callbacks when the user presses the Stop button.

Battery Resource Utilization
Android 13 (API level 33) provides the following ways for the system to better manage device battery life:

👾 Updated rules on when the system places your app in the “restricted” App Standby Bucket.
👾 New limitations on the work that your app can do when the user places your app in the “restricted” state for background battery usage.

Privacy

Runtime permission for notifications
Android 13 (API level 33) introduces a runtime notification permission: POST_NOTIFICATIONS. This change helps users focus on the notifications that are most important to them.

Notifications related to media sessions and apps that self-manage phone calls are exempt from this behavior change.

Hide sensitive content from clipboard
If your app allows users to copy sensitive content, such as passwords or credit card information, to the clipboard, you must add a flag to ClipData’s ClipDescription before calling ClipboardManager#setPrimaryClip(). Adding this flag prevents sensitive content from appearing in the content preview.

Copied text preview without flagging sensitive content.
Copied text preview flagging sensitive content.

To flag sensitive content, add a boolean extra to the ClipDescription. All apps should do this, regardless of the targeted API level.

// When your app targets API level 33 or higher
clipData.apply {
description.extras = PersistableBundle().apply {
putBoolean(ClipDescription.EXTRA_IS_SENSITIVE, true)
}
}

// If your app targets a lower API level
clipData.apply {
description.extras = PersistableBundle().apply {
putBoolean("android.content.extra.IS_SENSITIVE", true)
}
}

Security

Intent filters block non-matching intents
When your app sends an intent to an exported component of another app that targets Android 13 or higher, that intent is delivered if and only if it matches an <intent-filter> element in the receiving app. Non-matching intents are blocked.

Similarly, if your app upgrades to Android 13 or higher, any intent sent from another app is delivered to an exported component of your app if and only if that intent matches a declared <intent-filter> element in your app.

User experience

Dismissible foreground service notifications
Starting in Android 13 (API level 33), users can dismiss the notification associated with a foreground service by default. To do so, users perform a swipe gesture on the notification. On previous versions of Android, the notification can’t be dismissed unless the foreground service is either stopped or removed from the foreground.

If you would like the notification to be non-dismissable by the user, pass true into the setOngoing() method when you create your notification using Notification.Builder.

Developer productivity and tools

Themed app icons
Starting with Android 13, you can opt in to themed app icons. With this feature, app icons in supported Android launchers are tinted to inherit the coloring of the user’s chosen wallpaper and other themes.

Opting in to themed app icons on Android 13

To support this feature, your app must provide both an adaptive icon and a monochromatic app icon, and point to the monochromatic app icon from the <adaptive-icon> element in the manifest. If a user has enabled themed app icons (in other words, turned on the Themed icons toggle in system settings), and the launcher supports this feature, the system uses the coloring of the user’s chosen wallpaper and theme to determine the tint color, which it then applies to the monochromatic app icon.

The home screen does NOT display the themed app icon — and instead displays the adaptive or standard app icon — in any of the following scenarios:

👾 If the user hasn’t enabled themed app icons
👾 If your app doesn’t provide a monochromatic app icon
👾 If the launcher doesn’t support themed app icons

Quick QR Code Scanner
The pandemic has made scanning QR codes an everyday occurrence for many of us, so quick access to a QR code scanner is handy. Pull down the notification shade in Android 13 and tap Edit (the pencil icon) to tweak your Quick Settings tiles. You can drag the QR Code Scanner onto your panel.

Per-app language preferences
In many cases, multilingual users set their system language to one language — such as English — but they want to select other languages for specific apps, such as Dutch, Chinese, or Hindi. To help apps provide a better experience for these users, Android 13 introduces the following features for apps that support multiple languages:

Per-app languages in system settings

👾 System settings: A centralized location where users can select a preferred language for each app.

Your app must declare the android:localeConfig attribute in your app’s manifest to tell the system that it supports multiple languages.

👾 Additional APIs: These public APIs, such as the setApplicationLocales() and getApplicationLocales() methods in LocaleManager, let apps set a different language from the system language at runtime.

Apps that use custom in-app language pickers should use these APIs to ensure that users have a consistent user experience regardless of where they select their language preferences. The public APIs also help you reduce the amount of boilerplate code, they support split APKs, and they support Auto Backup for Apps to store app-level user language settings.

For backward compatibility with previous Android versions, equivalent APIs are also available in AndroidX. We recommend using the APIs added in Appcompat 1.6.0-beta01 or higher.

Apps that don’t support multiple languages are not impacted by these changes.

Improved text and language support
Android 13 includes several features text and language improvements that help you deliver a more polished experience;

🎃 Faster hyphenation
Hyphenation makes wrapped text easier to read and helps make your UI more adaptive. Starting in Android 13, hyphenation performance is optimized by as much as 200% so you can enable it in your TextView with almost no impact on rendering performance. To enable faster hyphenation, use the fullFast or normalFast frequencies in setHyphenationFrequency().

Color vector fonts
Starting in Android 13, the system includes rendering support for COLR version 1 (COLRv1) fonts and updates system emoji to the COLRv1 format. COLRv1 is a highly compact font format that renders quickly and crisply at any size.

COLRv1 vector emoji (left) and bitmap emoji (right)

For most apps, the system handles everything and COLRv1 just works. However, if your app implements its own text rendering and uses the system’s fonts, we recommend testing emoji rendering.

Quick Settings placement API
Quick Settings in the notification shade is a convenient way for users to change settings or take quick actions without leaving the context of an app. For apps that provide custom tiles, we’re making it easier for users to discover and add your tiles to Quick Settings. Using a new tile placement API, your app can now prompt the user to directly add your custom tile to the set of active Quick Settings tiles. A new system dialog lets the user add the tile in one step, without leaving your app, rather than having to go to Quick Settings to add the tile.

Clipboard preview
Starting in Android 13, the system displays a standard visual confirmation when content is added to the clipboard. The new confirmation does the following:

👾 Confirms the content was successfully copied.
👾 Provides a preview of the copied content.

This feature standardizes the various notifications shown by apps after copying and offers users more control over their clipboard.

New UI shown when content enters the clipboard.

Predictive back gesture
Android 13 introduces a predictive back gesture for Android devices such as phones, large screens, and foldables. Supporting this feature requires you to update your app.

Privacy and security

Photo picker
Android 13 (API level 33) and higher includes a photo picker experience. When your app launches the photo picker, users select specific images and videos to share with your app, such as profile pictures, instead of giving your app access to view the entire media library. This is the recommended way to access the user’s photos and videos.

The photo picker provides enhanced privacy for users because your app doesn’t need to declare any runtime permissions. In addition, the photo picker provides a built-in, standardized UI for apps, which creates a more consistent user experience.

New runtime permission for nearby Wi-Fi devices
Android 13 (API level 33) introduces a new runtime permission in the NEARBY_DEVICES permission group for apps that manage a device’s connections to nearby access points over Wi-Fi. These apps must declare the new permission, NEARBY_WIFI_DEVICES, when they call several different Wi-Fi APIs. In addition, as long as apps don’t derive physical location from the Wi-Fi APIs, they don’t need to declare the ACCESS_FINE_LOCATION permission when they target Android 13 or higher.

New permission to use exact alarms
If your app targets Android 13 or higher, you can use the USE_EXACT_ALARM permission, which is automatically granted to your app. In order for your app to use this permission, however, it must satisfy at least one of the following criteria:

👾 Your app is an alarm clock app or a timer app.
👾 Your app is a calendar app that shows notifications for upcoming events.

If your app sets exact alarms but doesn’t satisfy either case shown in the previous list, continue to declare the SCHEDULE_EXACT_ALARM permission instead, and be prepared for the situation where the user denies access to your app.

Developer downgradable permissions
Starting in Android 13, your app can revoke access to unused runtime permissions. This API allows your app to perform privacy-enhancing tasks such as the following:

👾 Remove unused permissions.
👾 Adhere to permissions best practices, which improves user trust. You may want to consider showing the users a dialog displaying the permissions you have proactively revoked.

Thank you for reading. Follow for more…

--

--