Cambios de comportamiento: todas las apps

La plataforma de Android 15 incluye cambios de comportamiento que podrían afectar tu app. Los siguientes cambios se aplican a todas las apps cuando se ejecutan en Android 15, independientemente de targetSdkVersion. Debes probar tu app y, luego, modificarla según corresponda para admitir estos cambios.

Asegúrate también de revisar la lista de cambios de comportamiento que solo afectan a las apps orientadas a Android 15.

Funcionalidad principal

Android 15 modifica o expande varias capacidades principales del sistema Android.

Cambios en el estado detenido del paquete

The intention of the package FLAG_STOPPED state (which users can engage in AOSP builds by long-pressing an app icon and selecting "Force Stop") has always been to keep apps in this state until the user explicitly removes the app from this state by directly launching the app or indirectly interacting with the app (through the sharesheet or a widget, selecting the app as live wallpaper, etc.). In Android 15, we've updated the behavior of the system to be aligned with this intended behavior. Apps should only be removed from the stopped state through direct or indirect user action.

To support the intended behavior, in addition to the existing restrictions, the system also cancels all pending intents when the app enters the stopped state on a device running Android 15. When the user's actions remove the app from the stopped state, the ACTION_BOOT_COMPLETED broadcast is delivered to the app providing an opportunity to re-register any pending intents.

You can call the new ApplicationStartInfo.wasForceStopped() method to confirm whether the app was put into the stopped state.

Compatibilidad con tamaños de página de 16 KB

从历史上看,Android 仅支持 4 KB 内存页面大小,这优化了系统内存性能,以适应 Android 设备通常拥有的平均总内存量。从 Android 15 开始,AOSP 支持配置为使用 16 KB 页面大小的设备(16 KB 设备)。如果您的应用直接或通过 SDK 间接使用任何 NDK 库,则需要重新构建应用,才能在这些 16 KB 设备上运行。

随着设备制造商不断制造出具有更大物理内存 (RAM) 的设备,许多此类设备将采用 16 KB(最终甚至更大)的页面大小来优化设备性能。添加对 16 KB 页面大小设备的支持,可让您的应用在这些设备上运行,并帮助您的应用受益于相关的性能改进。如果不重新编译,应用将无法在未来 Android 版本的 16 KB 设备上运行。

为帮助您为应用添加支持,我们提供了相关指南,介绍了如何检查应用是否受到影响、如何重新构建应用(如果适用),以及如何使用模拟器(包括 Android 模拟器的 Android 15 系统映像)在 16 KB 环境中测试应用

Benefits and performance gains

Los dispositivos configurados con tamaños de página de 16 KB usan un poco más de memoria en promedio, pero también obtienen varias mejoras de rendimiento para el sistema y las apps:

  • Tiempos de inicio de la app más bajos mientras el sistema está bajo presión de memoria: un 3.16% más bajo en promedio, con mejoras más significativas (hasta un 30%) para algunas apps que probamos
  • Menor consumo de energía durante el lanzamiento de la app: Reducción promedio del 4.56%
  • Inicio más rápido de la cámara: Inicios en caliente un 4.48% más rápidos en promedio y, en promedio, un 6.60% más rápidos en frío
  • Mejor tiempo de inicio del sistema: se mejoró en un 8% (aproximadamente 950 milisegundos) en promedio.

Estas mejoras se basan en nuestras pruebas iniciales, y es probable que los resultados en los dispositivos reales difieran. Proporcionaremos análisis adicionales de posibles ganancias para las apps a medida que continuemos con las pruebas.

Check if your app is impacted

Si tu app usa código nativo, debes recompilarla para que sea compatible con dispositivos de 16 KB. Si no sabes con seguridad si tu app usa código nativo, puedes usar el Analizador de APK para identificar si hay código nativo presente y, luego, verificar la alineación de los segmentos ELF de las bibliotecas compartidas que encuentres. Android Studio también proporciona funciones que te ayudan a detectar automáticamente problemas de alineación.

Si tu app solo usa código escrito en el lenguaje de programación Java o en Kotlin, incluidas todas las bibliotecas o SDKs, ya es compatible con dispositivos de 16 KB. Sin embargo, te recomendamos que pruebes tu app en un entorno de 16 KB para verificar que no haya regresiones inesperadas en el comportamiento de la app.

Cambios necesarios para que algunas apps admitan el espacio privado

Private space is a new feature in Android 15 that lets users create a separate space on their device where they can keep sensitive apps away from prying eyes, under an additional layer of authentication. Because apps in the private space have restricted visibility, some types of apps need to take additional steps to be able to see and interact with apps in a user's private space.

All apps

Because apps in the private space are kept in a separate user profile, similar to work profiles, apps shouldn't assume that any installed copies of their app that aren't in the main profile are in the work profile. If your app has logic related to work profile apps that make this assumption, you'll need to adjust this logic.

Medical apps

When a user locks the private space, all apps in the private space are stopped, and those apps can't perform foreground or background activities, including showing notifications. This behavior might critically impact the use and function of medical apps installed in the private space.

The private space setup experience warns users that the private space is not suitable for apps that need to perform critical foreground or background activities, such as showing notifications from medical apps. However, apps can't determine whether or not they're being used in the private space, so they can't show a warning to the user for this case.

For these reasons, if you develop a medical app, review how this feature might impact your app and take appropriate actions—such as informing your users not to install your app in the private space—to avoid disrupting critical app capabilities.

Launcher apps

If you develop a launcher app, you must do the following before apps in the private space will be visible:

  1. Your app must be assigned as the default launcher app for the device—that is, possessing the ROLE_HOME role.
  2. Your app must declare the ACCESS_HIDDEN_PROFILES normal permission in your app's manifest file.

Launcher apps that declare the ACCESS_HIDDEN_PROFILES permission must handle the following private space use cases:

  1. Your app must have a separate launcher container for apps installed in the private space. Use the getLauncherUserInfo() method to determine which type of user profile is being handled.
  2. The user must be able to hide and show the private space container.
  3. The user must be able to lock and unlock the private space container. Use the requestQuietModeEnabled() method to lock (by passing true) or unlock (by passing false) the private space.
  4. While locked, no apps in the private space container should be visible or discoverable through mechanisms such as search. Your app should register a receiver for the ACTION_PROFILE_AVAILABLE and ACTION_PROFILE_UNAVAILABLE broadcasts and update the UI in your app when the locked or unlocked state of the private space container changes. Both of these broadcasts include EXTRA_USER, which your app can use to refer to the private profile user.

    You can also use the isQuietModeEnabled() method to check whether the private space profile is locked or not.

App store apps

The private space includes an "Install Apps" button that launches an implicit intent to install apps into the user's private space. In order for your app to receive this implicit intent, declare an <intent-filter> in your app's manifest file with a <category> of CATEGORY_APP_MARKET.

Se quitó la fuente de emojis basada en PNG

The legacy, PNG-based emoji font file (NotoColorEmojiLegacy.ttf) has been removed, leaving just the vector-based file. Beginning with Android 13 (API level 33), the emoji font file used by the system emoji renderer changed from a PNG-based file to a vector based file. The system retained the legacy font file in Android 13 and 14 for compatibility reasons, so that apps with their own font renderers could continue to use the legacy font file until they were able to upgrade.

To check if your app is affected, search your app's code for references to the NotoColorEmojiLegacy.ttf file.

You can choose to adapt your app in a number of ways:

  • Use platform APIs for text rendering. You can render text to a bitmap-backed Canvas and use that to get a raw image if necessary.
  • Add COLRv1 font support to your app. The FreeType open source library supports COLRv1 in version 2.13.0 and higher.
  • As a last resort, you can bundle the legacy emoji font file (NotoColorEmoji.ttf) into your APK, although in that case your app will be missing the latest emoji updates. For more information, see the Noto Emoji GitHub project page.

Se aumentó la versión mínima del SDK de destino de 23 a 24

Android 15 builds on the the changes that were made in Android 14 and extends this security further. In Android 15, apps with a targetSdkVersion lower than 24 can't be installed. Requiring apps to meet modern API levels helps to ensure better security and privacy.

Malware often targets lower API levels in order to bypass security and privacy protections that have been introduced in higher Android versions. For example, some malware apps use a targetSdkVersion of 22 to avoid being subjected to the runtime permission model introduced in 2015 by Android 6.0 Marshmallow (API level 23). This Android 15 change makes it harder for malware to avoid security and privacy improvements. Attempting to install an app targeting a lower API level results in an installation failure, with a message like the following one appearing in Logcat:

INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 24, but found 7

On devices upgrading to Android 15, any apps with a targetSdkVersion lower than 24 remain installed.

If you need to test an app targeting an older API level, use the following ADB command:

adb install --bypass-low-target-sdk-block FILENAME.apk

Seguridad y privacidad

Android 15 presenta medidas sólidas para combatir el fraude de contraseña de un solo uso (OTP) y proteger el contenido sensible del usuario, enfocándose en endurecer el servicio de objeto de escucha de notificaciones y las protecciones de uso compartido de pantalla. Entre las mejoras clave, se incluyen la ocultación de las OTP de las notificaciones a las que pueden acceder apps no confiables, la ocultación de las notificaciones durante la función de compartir pantalla y la protección de las actividades de la app cuando se publican OTP. El objetivo de estos cambios es proteger el contenido sensible del usuario de personas no autorizadas.

Los desarrolladores deben tener en cuenta lo siguiente para asegurarse de que sus apps sean compatibles con los cambios en Android 15:

Ocultación de OTP

Android impedirá que las apps no confiables que implementen un NotificationListenerService lean contenido sin censura de las notificaciones en las que se detectó una OTP. Las apps de confianza, como las asociaciones de administradores de dispositivos complementarios, están exentas de estas restricciones.

Protección de Compartir pantalla

  • El contenido de las notificaciones se oculta durante las sesiones de uso compartido de pantalla para preservar la privacidad del usuario. Si la app implementa setPublicVersion(), Android muestra la versión pública de la notificación, que sirve como notificación de reemplazo en contextos no seguros. De lo contrario, el contenido de la notificación se oculta sin ningún otro contexto.
  • El contenido sensible, como la entrada de contraseñas, se oculta a los usuarios remotos para evitar que se revele la información sensible del usuario.
  • Se ocultarán las actividades de las apps que publiquen notificaciones durante la función de Compartir pantalla en la que se haya detectado una OTP. El contenido de la app se oculta al visor remoto cuando se inicia.
  • Además de la identificación automática de campos sensibles de Android, los desarrolladores pueden marcar manualmente partes de su app como sensibles con setContentSensitivity, que se oculta a los usuarios remotos durante la función de compartir pantalla.
  • Los desarrolladores pueden activar o desactivar la opción Inhabilitar protecciones cuando compartes pantalla en Opciones para desarrolladores para quedar exentos de las protecciones de uso compartido de pantalla con fines de demostración o pruebas. La grabadora de pantalla predeterminada del sistema está exenta de estos cambios, ya que las grabaciones permanecen en el dispositivo.

Cámara y contenido multimedia

Android 15 realiza los siguientes cambios en el comportamiento de la cámara y los medios para todas las apps.

La reproducción de audio directa y la descarga invalidan las pistas de audio directas o descargadas que se abrieron anteriormente cuando se alcanzan los límites de recursos.

Before Android 15, if an app requested direct or offload audio playback while another app was playing audio and the resource limits were reached, the app would fail to open a new AudioTrack.

Beginning with Android 15, when an app requests direct or offload playback and the resource limits are reached, the system invalidates any currently open AudioTrack objects which prevent fulfilling the new track request.

(Direct and offload audio tracks are typically opened for playback of compressed audio formats. Common use-cases for playing direct audio include streaming encoded audio over HDMI to a TV. Offload tracks are typically used to play compressed audio on a mobile device with hardware DSP acceleration.)

Experiencia del usuario y la IU del sistema

Android 15 incluye algunos cambios que tienen como objetivo crear una experiencia del usuario más coherente e intuitiva.

Se habilitaron las animaciones de retroceso predictivo para las apps que habilitaron la función.

Beginning in Android 15, the developer option for predictive back animations has been removed. System animations such as back-to-home, cross-task, and cross-activity now appear for apps that have opted in to the predictive back gesture either entirely or at an activity level. If your app is affected, take the following actions:

  • Ensure that your app has been properly migrated to use the predictive back gesture.
  • Ensure that your fragment transitions work with predictive back navigation.
  • Migrate away from animation and framework transitions and use animator and androidx transitions instead.
  • Migrate away from back stacks that FragmentManager doesn't know about. Use back stacks managed by FragmentManager or by the Navigation component instead.

Se inhabilitan los widgets cuando el usuario fuerza la detención de una app

If a user force-stops an app on a device running Android 15, the system temporarily disables all the app's widgets. The widgets are grayed out, and the user cannot interact with them. This is because beginning with Android 15, the system cancels all an app's pending intents when the app is force-stopped.

The system re-enables those widgets the next time the user launches the app.

For more information, see Changes to package stopped state.

El chip de la barra de estado de proyección de medios alerta a los usuarios sobre el uso compartido, la transmisión y la grabación de la pantalla

Los exploits de proyección de pantalla exponen datos privados del usuario, como información financiera, porque los usuarios no se dan cuenta de que se está compartiendo la pantalla de su dispositivo.

En el caso de las apps que se ejecutan en dispositivos con Android 15 QPR1 o versiones posteriores, un chip de la barra de estado grande y destacado alerta a los usuarios sobre cualquier proyección de pantalla en curso. Los usuarios pueden presionar el chip para evitar que se comparta, transmita o grabe su pantalla. Además, la proyección de pantalla se detiene automáticamente cuando se bloquea la pantalla del dispositivo.

用于屏幕共享、投屏和录制的状态栏条状标签。

Check if your app is impacted

By default, your app includes the status bar chip and automatically suspends screen projection when the lock screen activates.

To learn more about how to test your app for these use cases, see Status bar chip and auto stop.

Restricciones de acceso a la red en segundo plano

En Android 15, las apps que inician una solicitud de red fuera de un ciclo de vida del proceso válido reciben una excepción. Por lo general, un UnknownHostException o algún otro IOException relacionado con el zócalo. Por lo general, las solicitudes de red que se producen fuera de un ciclo de vida válido se deben a que las apps continúan una solicitud de red sin saberlo, incluso después de que la app ya no está activa.

Para mitigar esta excepción, asegúrate de que tus solicitudes de red sean conscientes del ciclo de vida y se cancelen cuando salgan de un ciclo de vida de proceso válido con componentes conscientes del ciclo de vida. Si es importante que la solicitud de red se realice incluso cuando el usuario salga de la aplicación, considera programar la solicitud de red con WorkManager o continuar una tarea visible para el usuario con el servicio en primer plano.

Bajas

Con cada actualización, es posible que las APIs específicas de Android queden obsoletas o deban refactorizarse a fin de ofrecerles una mejor experiencia a los desarrolladores o admitir nuevas funciones de la plataforma. En estos casos, damos de baja oficialmente las APIs obsoletas y les indicamos a los desarrolladores las APIs alternativas que pueden usar en su lugar.

Baja significa que finalizamos la asistencia oficial para las APIs, pero estas seguirán disponibles para los desarrolladores. Para obtener más información sobre las bajas destacadas en esta versión de Android, consulta la página de bajas.