A plataforma Android 15 inclui mudanças de comportamento que podem afetar seu app.
As mudanças a seguir se aplicam a todos os apps quando executados no Android 15,
independente da targetSdkVersion
. Teste o app e modifique-o conforme
necessário para que ele ofereça suporte a essas mudanças.
Consulte também a lista de mudanças de comportamento que afetam apenas os apps destinados ao Android 15.
Principal recurso
O Android 15 modifica ou expande vários recursos principais do sistema Android.
Mudanças no estado parado do pacote
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.
Suporte a tamanhos de página de 16 KB
Historicamente, o Android só ofereceu suporte a tamanhos de página de memória de 4 KB, o que otimizou o desempenho da memória do sistema para a quantidade média de memória total que os dispositivos Android normalmente tinham. A partir do Android 15, o AOSP oferece suporte a dispositivos configurados para usar um tamanho de página de 16 KB (dispositivos de 16 KB). Se o app usar alguma biblioteca do NDK, seja direta ou indiretamente por um SDK, será necessário recriar o app para que ele funcione nesses dispositivos de 16 KB.
À medida que os fabricantes de dispositivos continuam criando dispositivos com quantidades maiores de memória física (RAM), muitos deles vão adotar tamanhos de página de 16 KB (e eventualmente maiores) para otimizar o desempenho do dispositivo. Ao adicionar suporte para dispositivos com tamanho de página de 16 KB, você permite que o app seja executado nesses dispositivos e aproveite as melhorias de desempenho associadas. Sem recompilação, os apps não vão funcionar em dispositivos de 16 KB em versões futuras do Android.
Para ajudar você a adicionar suporte ao app, fornecemos orientações sobre como verificar se o app foi afetado, como recompilar o app (se aplicável) e como testar o app em um ambiente de 16 KB usando emuladores (incluindo imagens do sistema Android 15 para o Android Emulator).
Benefits and performance gains
Os dispositivos configurados com tamanhos de página de 16 KB usam um pouco mais de memória em média, mas também têm várias melhorias de desempenho para o sistema e os apps:
- Tempos de inicialização do app mais rápidos enquanto o sistema está sob pressão de memória: 3,16% mais baixos em média, com melhorias mais significativas (até 30%) em alguns apps testados.
- Redução do consumo de energia durante o lançamento do app: redução média de 4,56%
- Lançamento mais rápido da câmera: 4,48% mais rápido em média e 6,60% mais rápido em média
- Tempo de inicialização do sistema melhorado: melhoria de 8% (aproximadamente 950 milissegundos) em média
Essas melhorias são baseadas nos testes iniciais, e os resultados em dispositivos reais provavelmente serão diferentes. Forneceremos análises adicionais de ganhos em potencial para apps à medida que continuarmos nossos testes.
Check if your app is impacted
Se o app usar código nativo, recompile o app com suporte para dispositivos de 16 KB. Se você não tiver certeza se o app usa código nativo, use o APK Analyzer para identificar se há código nativo e verifique o alinhamento dos segmentos ELF de bibliotecas compartilhadas encontradas. O Android Studio também oferece recursos que ajudam a detectar automaticamente problemas de alinhamento.
Se o app usa apenas código escrito na linguagem de programação Java ou Kotlin, incluindo bibliotecas ou SDKs, ele já oferece suporte a dispositivos de 16 KB. No entanto, recomendamos que você teste o app em um ambiente de 16 KB para verificar se não há regressões inesperadas no comportamento do app.
Mudanças necessárias para alguns apps funcionarem no espaço privado
私密空间是 Android 15 中推出的一项新功能,可让用户在设备上创建一个单独的空间,在额外的身份验证层保护下,防止敏感应用遭到窥探。由于私密空间中的应用具有受限的公开范围,因此某些类型的应用需要执行额外的步骤,才能查看和与用户私密空间中的应用互动。
所有应用
由于私密空间中的应用会保存在单独的用户资料中(类似于工作资料),因此应用不应假定其任何未位于主资料中的已安装副本都位于工作资料中。如果您的应用包含与工作资料应用相关的逻辑,并且做出了上述假设,则需要调整此逻辑。
医疗应用
当用户锁定私密空间时,私密空间中的所有应用都会停止运行,并且这些应用无法执行前台或后台活动,包括显示通知。此行为可能会严重影响安装在私密空间中的医疗应用的使用和功能。
私密空间设置体验会向用户发出警告,告知私密空间不适合需要执行关键前台或后台活动的应用,例如显示医疗应用发送的通知。不过,应用无法确定自己是否在私密空间中使用,因此无法在这种情况下向用户显示警告。
因此,如果您开发的是医疗应用,请检查此功能可能会对您的应用产生哪些影响,并采取适当的措施(例如告知用户不要在私密空间中安装您的应用),以免中断关键的应用功能。
启动器应用
如果您开发的是启动器应用,则必须执行以下操作,才能看到私密空间中的应用:
- 您的应用必须被指定为设备的默认启动器应用,即具有
ROLE_HOME
角色。 - 您的应用必须在应用的清单文件中声明
ACCESS_HIDDEN_PROFILES
普通权限。
声明 ACCESS_HIDDEN_PROFILES
权限的启动器应用必须处理以下私密空间用例:
- 您的应用必须为安装在私密空间中的应用提供单独的启动器容器。使用
getLauncherUserInfo()
方法确定要处理的用户个人资料类型。 - 用户必须能够隐藏和显示私密空间容器。
- 用户必须能够锁定和解锁私密空间容器。使用
requestQuietModeEnabled()
方法锁定(通过传递true
)或解锁(通过传递false
)私密空间。 在锁定状态下,私密空间容器中的任何应用都应不可见,也无法通过搜索等机制被发现。您的应用应为
ACTION_PROFILE_AVAILABLE
和ACTION_PROFILE_UNAVAILABLE
广播注册接收器,并在私密空间容器的锁定或解锁状态发生变化时更新应用中的界面。这两种状态的广播都包含EXTRA_USER
,您的应用可以使用该常量来引用不公开个人资料的用户。您还可以使用
isQuietModeEnabled()
方法检查私密空间个人资料是否已锁定。
应用商店应用
私密空间包含一个“安装应用”按钮,用于启动隐式 intent 以将应用安装到用户的私密空间。为了让应用能够接收此隐式 intent,请在应用的清单文件中声明一个 <intent-filter>
,并将 <category>
设为 CATEGORY_APP_MARKET
。
Fonte de emoji baseada em PNG removida
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.
Aumentamos a versão mínima do SDK de destino de 23 para 24.
Android 15 基于
在 Android 14 中进行的更改,并扩展了
安全性。在 Android 15 中,
无法安装低于 24 的 targetSdkVersion
。
要求应用符合现代 API 级别有助于确保更好的安全性和
保护隐私。
恶意软件通常会以较低的 API 级别为目标平台,以绕过安全和隐私
更高的 Android 版本中引入的保护机制。例如,有些恶意软件应用使用 targetSdkVersion
22,以避免受到 Android 6.0 Marshmallow(API 级别 23)在 2015 年引入的运行时权限模型的约束。这项 Android 15 变更使恶意软件更难以规避安全和隐私权方面的改进限制。尝试安装以较低 API 级别为目标平台的应用将导致安装失败,并且 Logcat 中会显示如下所示的消息:
INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 24, but found 7
在升级到 Android 15 的设备上,targetSdkVersion
级别较低的任何应用
安装在 Google Play 上
如果您需要测试以旧版 API 级别为目标平台的应用,请使用以下 ADB 命令:
adb install --bypass-low-target-sdk-block FILENAME.apk
Segurança e privacidade
Android 15 introduces robust measures to combat one-time passcode (OTP) fraud and to protect the user's sensitive content, focusing on hardening the Notification Listener Service and screenshare protections. Key enhancements include redacting OTPs from notifications accessible to untrusted apps, hiding notifications during screenshare, and securing app activities when OTPs are posted. These changes aim to keep the user's sensitive content safe from unauthorized actors.
Developers need to be aware of the following to ensure their apps are compatible with the changes in Android 15:
OTP Redaction
Android will stop untrusted apps that implement a
NotificationListenerService
from reading unredacted content
from notifications where an OTP has been detected. Trusted apps such as
companion device manager associations are exempt from these restrictions.
Screenshare Protection
- Notification content is hidden during screen sharing sessions to preserve
the user's privacy. If the app implements
setPublicVersion()
, Android shows the public version of the notification which serves as a replacement notification in insecure contexts. Otherwise, the notification content is redacted without any further context. - Sensitive content like password input is hidden from remote viewers to prevent revealing the user's sensitive information.
- Activities from apps that post notifications during screenshare where an OTP has been detected will be hidden. App content is hidden from the remote viewer when launched.
- Beyond Android's automatic identification of sensitive fields, developers
can manually mark parts of their app as sensitive using
setContentSensitivity
, which is hidden from remote viewers during screenshare. - Developers can choose to toggle the Disable screen share protections option under Developer Options to be exempted from the screenshare protections for demo or testing purposes. The default system screen recorder is exempted from these changes, since the recordings remain on-device.
Câmera e mídia
O Android 15 faz as seguintes mudanças no comportamento de mídia e câmera para todos os apps.
A reprodução direta e de descarga de áudio invalida as faixas de áudio diretas ou de descarga abertas anteriormente quando os limites de recursos são atingidos.
在 Android 15 之前,如果某个应用在另一个应用播放音频且达到资源限制时请求直接或分流音频播放,该应用将无法打开新的 AudioTrack
。
从 Android 15 开始,当应用请求直接播放或分流播放且达到资源限制时,系统会使任何当前打开的 AudioTrack
对象失效,以防止执行新轨道请求。
(直接音轨和分流音轨通常会打开,以播放压缩音频格式。播放直接音频的常见用例包括通过 HDMI 将编码的音频流式传输到电视。分流轨道通常用于在具有硬件 DSP 加速的移动设备上播放压缩音频。)
Experiência do usuário e interface do sistema
O Android 15 inclui algumas mudanças que visam criar uma experiência do usuário mais consistente e intuitiva.
Animações de volta preditiva ativadas para apps que ativaram a opção
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 byFragmentManager
or by the Navigation component instead.
Widgets desativados quando o usuário força a interrupção de um 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.
O ícone da barra de status de projeção de mídia alerta os usuários sobre compartilhamento, transmissão e gravação de tela
As explorações de projeção de tela expõem dados privados do usuário, como informações financeiras, porque os usuários não percebem que a tela do dispositivo está sendo compartilhada.
Para apps executados em dispositivos com o Android 15 QPR1 ou mais recente, um ícone grande e visível na barra de status alerta os usuários sobre qualquer projeção de tela em andamento. Os usuários podem tocar no ícone para impedir que a tela seja compartilhada, transmitida ou gravada. Além disso, a projeção da tela é interrompida automaticamente quando a tela do dispositivo é bloqueada.

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.
Restrições de acesso à rede em segundo plano
在 Android 15 中,如果应用在有效的进程生命周期之外启动网络请求,则会收到异常。通常是 UnknownHostException
或其他与套接字相关的 IOException
。在有效生命周期之外发生的网络请求通常是因为应用在不再活跃后,不知不觉地继续发出网络请求。
为缓解此异常,请使用生命周期感知型组件,确保您的网络请求具有生命周期感知功能,并在离开有效的进程生命周期时取消。如果您非常重视即使用户离开应用也要发出网络请求,请考虑使用 WorkManager 调度网络请求,或使用前台服务继续执行对用户可见的任务。
Suspensões de uso
A cada versão, algumas APIs específicas do Android podem se tornar obsoletas ou precisarem ser refatoradas para fornecer uma melhor experiência aos desenvolvedores ou oferecer compatibilidade com as novas funcionalidades da plataforma. Nesses casos, descontinuamos oficialmente as APIs obsoletas e direcionamos os desenvolvedores para APIs alternativas.
Descontinuação significa que encerramos o suporte oficial para as APIs, mas elas continuarão disponíveis para os desenvolvedores. Para saber mais sobre as descontinuações importantes nesta versão do Android, consulte a página de descontinuações.