Like earlier releases, Android 13 includes behavior changes that may affect your app. The following behavior changes apply exclusively to apps that are targeting Android 13 or higher. If your app is targeting Android 13 or higher, you should modify your app to support these behaviors properly, where applicable.
Обязательно ознакомьтесь также со списком изменений в поведении, затрагивающих все приложения, работающие на Android 13 .
Конфиденциальность
Разрешение на отправку уведомлений влияет на внешний вид службы переднего плана.
If the user denies the notification permission , they don't see notices related to foreground services in the notification drawer . However, users still see notices related to foreground services in the Task Manager , regardless of whether the notification permission is granted.
Новое разрешение во время выполнения для находящихся поблизости устройств Wi-Fi.
В более ранних версиях Android пользователю необходимо было предоставить вашему приложению разрешение ACCESS_FINE_LOCATION для выполнения ряда распространенных сценариев использования Wi-Fi.
Because it's difficult for users to associate location permissions with Wi-Fi functionality, Android 13 (API level 33) introduces a runtime permission in the NEARBY_DEVICES permission group for apps that manage a device's connections to nearby access points over Wi-Fi. This permission, NEARBY_WIFI_DEVICES , fulfills Wi-Fi use cases such as the following:
- Находите или подключайтесь к находящимся поблизости устройствам, таким как принтеры или устройства для трансляции мультимедиа. Такой рабочий процесс позволяет вашему приложению выполнять подобные задачи:
- Получайте информацию от точки доступа внеполосным способом, например, через BLE.
- Находите и подключайтесь к устройствам через Wi-Fi Aware и используйте локальную точку доступа.
- Находите устройства и подключайтесь к ним через Wi-Fi Direct.
- Установите соединение с известным SSID, например, с устройством в автомобиле или системе умного дома.
- Создайте точку доступа, доступную только для местных пользователей.
- Радиус действия — до ближайших устройств, поддерживающих Wi-Fi.
As long as your app doesn't derive physical location information from the Wi-Fi APIs, request NEARBY_WIFI_DEVICES instead of ACCESS_FINE_LOCATION when you target Android 13 or higher and use Wi-Fi APIs. When you declare the NEARBY_WIFI_DEVICES permission, strongly assert that your app never derives physical location information from Wi-Fi APIs. To do so, set the android:usesPermissionFlags attribute to neverForLocation . This process is similar to the one you do in Android 12 (API level 31) and higher when you assert that Bluetooth device information is never used for location .
Узнайте больше о том, как запросить разрешение на доступ к находящимся поблизости устройствам Wi-Fi .
Детальные разрешения на доступ к медиаконтенту
READ_MEDIA_AUDIO . If your app targets Android 13 or higher and needs to access media files that other apps have created , you must request one or more of the following granular media permissions instead of the READ_EXTERNAL_STORAGE permission:
| Тип медиа | Разрешение на запрос |
|---|---|
| Изображения и фотографии | READ_MEDIA_IMAGES |
| Видео | READ_MEDIA_VIDEO |
| Аудиофайлы | READ_MEDIA_AUDIO |
Прежде чем получить доступ к медиафайлам другого приложения, убедитесь, что пользователь предоставил вашему приложению соответствующие детальные разрешения на доступ к медиафайлам.
На рисунке 1 показано приложение, запрашивающее разрешение READ_MEDIA_AUDIO .
Если одновременно запросить разрешение READ_MEDIA_IMAGES и разрешение READ_MEDIA_VIDEO , отобразится только одно диалоговое окно с запросом системных разрешений.
If your app was previously granted the READ_EXTERNAL_STORAGE permission, then any requested READ_MEDIA_* permissions are granted automatically when upgrading. You can use the following ADB command to review upgraded permissions:
adb shell cmd appops get --uid PACKAGE_NAME
Для использования датчиков тела в фоновом режиме требуется новое разрешение.
Android 13 introduces the concept of "while in use" access for body sensors, such as heart rate, temperature, and blood oxygen percentage. This access model is very similar to the one that the system introduced for location in Android 10 (API level 29) .
If your app targets Android 13 and requires access to body sensor information while running in the background, you must declare the new BODY_SENSORS_BACKGROUND permission in addition to the existing BODY_SENSORS permission.
Производительность и батарея
Использование ресурсов батареи
If the user places your app in the "restricted" state for background battery usage while your app targets Android 13, the system doesn't deliver the BOOT_COMPLETED broadcast or the LOCKED_BOOT_COMPLETED broadcast until the app is started for other reasons.
пользовательский опыт
Элементы управления воспроизведением мультимедиа, полученные из PlaybackState
For apps targeting Android 13 (API level 33) and higher, the system derives media controls from PlaybackState actions. This allows the system to show a richer set of controls that are technically consistent between phones and tablet devices, and also align with how media controls are rendered on other Android platforms such as Android Auto and Android TV.
На рисунке 2 показан пример того, как это выглядит на телефоне и планшете соответственно.

Prior to Android 13, the system displayed up to five actions from the MediaStyle notification in the order in which they were added . In compact mode—for example, in the collapsed quick settings—up to three actions specified with setShowActionsInCompactView() were shown.
Starting with Android 13, the system displays up to five action buttons based on the PlaybackState as described in the following table. In compact mode, only the first three action slots will be displayed. For apps that don't target Android 13 or those that don't include a PlaybackState , the system will display controls based on the Action list added to the MediaStyle notification as described in the previous paragraph.
| Слот | Действие | Критерии |
|---|---|---|
| 1 | Играть | Текущее состояние объекта PlaybackState может быть одним из следующих:
|
| Загрузочный вращающийся индикатор | Текущее состояние объекта PlaybackState может быть одним из следующих:
| |
| Пауза | Текущее состояние объекта PlaybackState не соответствует ни одному из вышеперечисленных вариантов. | |
| 2 | Предыдущий | Действия PlaybackState включают ACTION_SKIP_TO_PREVIOUS . |
| Обычай | Действия PlaybackState не включают ACTION_SKIP_TO_PREVIOUS , а пользовательские действия PlaybackState включают пользовательское действие, которое еще не было выполнено. | |
| Пустой | Дополнительные параметры PlaybackState включают логическое значение true для ключа SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV . | |
| 3 | Следующий | Действия PlaybackState включают ACTION_SKIP_TO_NEXT . |
| Обычай | Действия PlaybackState не включают ACTION_SKIP_TO_NEXT , а пользовательские действия PlaybackState включают пользовательское действие, которое еще не было выполнено. | |
| Пустой | Дополнительные параметры PlaybackState включают логическое значение true для ключа SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_NEXT . | |
| 4 | Обычай | К пользовательским действиям PlaybackState относится действие, которое еще не было выполнено. |
| 5 | Обычай | К пользовательским действиям PlaybackState относится действие, которое еще не было выполнено. |
Пользовательские действия размещаются в том порядке, в котором они были добавлены в PlaybackState .
Цветовая тема приложения автоматически применяется к содержимому WebView.
Для приложений, ориентированных на Android 13 (уровень API 33) или выше, метод setForceDark() устарел, и его вызов ничего не изменит.
Instead, WebView now always sets the media query prefers-color-scheme according to the app's theme attribute, isLightTheme . In other words, if isLightTheme is true or not specified, prefers-color-scheme is light ; otherwise, it is dark . This behavior means that the web content's light or dark style is applied automatically to match the app's theme if the content supports it.
For most apps, the new behavior should apply the appropriate app styles automatically, however you should test your app to check for any cases where you might've been manually controlling dark mode settings.
If you still need to customize your app's color theme behavior, use the setAlgorithmicDarkeningAllowed() method instead. For backward compatibility with previous Android versions, we recommend using the equivalent setAlgorithmicDarkeningAllowed() method in AndroidX.
Для получения более подробной информации о том, какое поведение приложения вы можете ожидать в зависимости от параметра targetSdkVersion и настроек темы, обратитесь к документации по этому методу.
Подключение
Методы BluetoothAdapter#enable() и BluetoothAdapter#disable() устарели.
Для приложений, ориентированных на Android 13 (уровень API 33) или выше, методы BluetoothAdapter#enable() и BluetoothAdapter#disable() устарели и всегда возвращают false .
Следующие типы приложений не подпадают под действие этих изменений:
- Приложения владельца устройства
- Приложения владельца профиля
- Системные приложения
Сервисы Google Play
Для использования рекламного идентификатора требуется разрешение.
Приложения, использующие рекламный идентификатор сервисов Google Play и ориентированные на Android 13 (уровень API 33) и выше, должны указать обычное разрешение AD_ID в файле манифеста приложения следующим образом:
<manifest ...>
<!-- Required only if your app targets Android 13 or higher. -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<application ...>
...
</application>
</manifest>
Если ваше приложение не указывает это разрешение при использовании Android 13 или выше, рекламный идентификатор автоматически удаляется и заменяется строкой нулей.
If your app uses SDKs that declare the AD_ID permission in the library's manifest, then the permission is merged with your app's manifest file by default. In this case, you don't need to declare the permission in your app's manfiest file.
Для получения более подробной информации см. раздел «Идентификатор рекламы» в справке Play Console.
Обновлены ограничения, не относящиеся к SDK.
Android 13 includes updated lists of restricted non-SDK interfaces based on collaboration with Android developers and the latest internal testing. Whenever possible, we make sure that public alternatives are available before we restrict non-SDK interfaces.
If your app does not target Android 13, some of these changes might not immediately affect you. However, while you can currently use some non-SDK interfaces ( depending on your app's target API level ), using any non-SDK method or field always carries a high risk of breaking your app.
If you are unsure if your app uses non-SDK interfaces, you can test your app to find out. If your app relies on non-SDK interfaces, you should begin planning a migration to SDK alternatives. Nevertheless, we understand that some apps have valid use cases for using non-SDK interfaces. If you cannot find an alternative to using a non-SDK interface for a feature in your app, you should request a new public API .
To learn more about the changes in this release of Android, see Updates to non-SDK interface restrictions in Android 13 . To learn more about non-SDK interfaces generally, see Restrictions on non-SDK interfaces .