Modifiche al comportamento: tutte le app

La piattaforma Android 15 include modifiche al comportamento che potrebbero influire sulla tua app. Le seguenti modifiche al comportamento si applicano a tutte le app quando vengono eseguite su Android 15, indipendentemente da targetSdkVersion. Devi testare l'app e poi modificarla come necessario per supportarle correttamente, ove applicabile.

Assicurati di esaminare anche l'elenco delle modifiche al comportamento che interessano solo le app con target Android 15.

Funzionalità di base

Android 15 modifica o espande varie funzionalità di base del sistema Android.

Modifiche allo stato di arresto del pacchetto

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.

Supporto per le dimensioni pagina di 16 kB

In passato, Android supportava solo le dimensioni delle pagine in memoria da 4 kB, che sono le prestazioni della memoria di sistema ottimizzate per la quantità media di memoria totale In genere i dispositivi Android hanno avuto. A partire da Android 15, AOSP supporta dispositivi configurati per l'utilizzo di dimensioni pagina di 16 kB (16 kB) dispositivi). Se la tua app utilizza librerie NDK, direttamente o indirettamente tramite un SDK, dovrai ricreare l'app funzionano su questi dispositivi da 16 kB.

I produttori di dispositivi continuano a realizzare dispositivi con memoria fisica (RAM), molti di questi dispositivi adotteranno 16 kB (e alla fine aumentano) le dimensioni delle pagine per ottimizzare le prestazioni del dispositivo. Aggiunta in corso... per dispositivi con dimensione pagina di 16 kB consente di eseguire l'app su questi dispositivi e consente alla tua app di trarre vantaggio dalle prestazioni associate miglioramenti. Senza la ricompilazione, le app potrebbero non funzionare sui dispositivi da 16 kB quando vengono messe in produzione nelle release future di Android.

Per aiutarti ad aggiungere il supporto della tua app, abbiamo fornito indicazioni su come controllare se la tua app è interessata, come ricreare l'app (se applicabile) e come testare l'app in In un ambiente da 16 kB con emulatori (tra cui Android 15 immagini di sistema per l'emulatore Android).

Benefits and performance gains

Devices configured with 16 KB page sizes use slightly more memory on average, but also gain various performance improvements for both the system and apps:

  • Lower app launch times while the system is under memory pressure: 3.16% lower on average, with more significant improvements (up to 30%) for some apps that we tested
  • Reduced power draw during app launch: 4.56% reduction on average
  • Faster camera launch: 4.48% faster hot starts on average, and 6.60% faster cold starts on average
  • Improved system boot time: improved by 8% (approximately 950 milliseconds) on average

These improvements are based on our initial testing, and results on actual devices will likely differ. We'll provide additional analysis of potential gains for apps as we continue our testing.

Check if your app is impacted

Se la tua app utilizza codice nativo, devi ricostruirla con il supporto per i dispositivi da 16 KB. Se non sai con certezza se la tua app utilizza codice nativo, puoi utilizzare APK Analyzer per identificare se è presente codice nativo e poi controllare l'allineamento dei segmenti ELF per eventuali librerie condivise che trovi.

Se la tua app utilizza solo codice scritto nel linguaggio di programmazione Java o in Kotlin, incluse tutte le librerie o gli SDK, supporta già i dispositivi da 16 KB. Tuttavia, ti consigliamo di testare l'app in un ambiente di 16 KB per verificare che non ci siano regressioni impreviste nel comportamento dell'app.

Modifiche necessarie per il supporto dello spazio privato da parte di alcune app

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.

Carattere emoji basato su PNG rimosso

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.

È stata aumentata la versione minima dell'SDK target da 23 a 24

Android 15 si basa su le modifiche apportate in Android 14 ed estende questa ulteriormente la sicurezza. In Android 15, le app con un Impossibile installare targetSdkVersion inferiore a 24. La richiesta di app che soddisfino i livelli API moderni contribuisce a garantire una maggiore sicurezza e privacy.

Il malware spesso punta a livelli API più bassi per aggirare la sicurezza e la privacy che sono state introdotte nelle versioni successive di Android. Ad esempio: alcune app malware utilizzano un valore targetSdkVersion pari a 22 per evitare di essere soggette di autorizzazione di runtime introdotto nel 2015 da Android 6.0 Marshmallow (API livello 23). Questa modifica ad Android 15 rende più difficile evitare la sicurezza del malware e miglioramenti della privacy. Il tentativo di installare un'app che ha come target un livello API inferiore comporta un errore di installazione e in Logcat viene visualizzato un messaggio simile al seguente:

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

Sui dispositivi su cui viene eseguito l'upgrade ad Android 15, tutte le app con un targetSdkVersion inferiore ne rimangono installate più di 24.

Se devi testare un'app che ha come target un livello API precedente, utilizza il seguente comando ADB:

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

Sicurezza e privacy

Android 15 introduce misure efficaci per combattere le frodi con passcode una tantum (OTP) e per proteggere i contenuti sensibili dell'utente, concentrandosi sull'aumento della sicurezza del servizio di ascolto delle notifiche e delle protezioni per la condivisione schermo. I miglioramenti principali includono l'oscuramento delle OTP dalle notifiche accessibili ad app non attendibili, la disattivazione delle notifiche durante la condivisione schermo e la protezione delle attività delle app quando vengono pubblicate le OTP. Queste modifiche hanno lo scopo di proteggere i contenuti sensibili dell'utente da soggetti non autorizzati.

Gli sviluppatori devono tenere presente quanto segue per assicurarsi che le loro app siano compatibili con le modifiche di Android 15:

Oscuramento OTP

Android impedirà alle app non attendibili che implementano un NotificationListenerService di leggere i contenuti non oscurati delle notifiche in cui è stata rilevata una OTP. Le app attendibili, come le associazioni di gestori dei dispositivi complementari, sono esenti da queste limitazioni.

Protezione Condivisione schermo

  • I contenuti delle notifiche vengono nascosti durante le sessioni di condivisione dello schermo per preservare la privacy dell'utente. Se l'app implementa setPublicVersion(), Android mostra la versione pubblica della notifica che funge da notifica sostitutiva in contesti non sicuri. In caso contrario, i contenuti della notifica vengono oscurati senza alcun ulteriore contesto.
  • I contenuti sensibili, come l'inserimento della password, vengono nascosti agli spettatori remoti per impedire la divulgazione delle informazioni sensibili dell'utente.
  • Le attività delle app che pubblicano notifiche durante la condivisione schermo in cui è stato rilevato un codice OTP verranno nascoste. I contenuti dell'app vengono nascosti all'utente remoto quando l'app viene lanciata.
  • Oltre all'identificazione automatica dei campi sensibili da parte di Android, gli sviluppatori possono contrassegnare manualmente parti della propria app come sensibili utilizzando setContentSensitivity, che viene nascosta agli spettatori remoti durante la condivisione schermo.
  • Gli sviluppatori possono scegliere di attivare/disattivare l'opzione Disattiva protezioni condivisione schermo nelle Opzioni sviluppatore per essere esentati dalle protezioni della condivisione schermo a scopo di dimostrazione o test. Lo screen recorder di sistema predefinito è esente da queste modifiche, poiché le registrazioni rimangono sul dispositivo.

Fotocamera e contenuti multimediali

Android 15 apporta le seguenti modifiche al comportamento della fotocamera e dei contenuti multimediali per tutte le app.

La riproduzione audio diretta e di offload rende non valide le tracce audio dirette o di offload aperte in precedenza quando vengono raggiunti i limiti di risorse

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.)

Esperienza utente e interfaccia utente di sistema

Android 15 include alcune modifiche volte a creare un'esperienza utente più coerente e intuitiva.

Animazioni Indietro predittive attivate per le app che hanno attivato la funzionalità

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.

Widget disattivati quando l'utente forza l'interruzione di un'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.

Il chip della barra di stato della proiezione multimediale avvisa gli utenti della condivisione dello schermo, della trasmissione e della registrazione

Screen projection exploits expose private user data such as financial information because users don't realize their device screen is being shared.

For apps running on devices with Android 15 QPR1 or higher, a status bar chip that is large and prominent alerts users to any in‑progress screen projection. Users can tap the chip to stop their screen from being shared, cast, or recorded. Also, screen projection automatically stops when the device screen is locked.

Chip barra delle app per condivisione schermo, trasmissione e registrazione.

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.

Limitazioni di accesso alla rete in background

In Android 15, apps that start a network request outside of a valid process lifecycle receive an exception. Typically, an UnknownHostException or other socket-related IOException. Network requests that happen outside of a valid lifecycle are usually due to apps unknowingly continuing a network request even after the app is no longer active.

To mitigate this exception, ensure your network requests are lifecycle aware and cancelled upon leaving a valid process lifecycle by using lifecycle aware components. If it is important that the network request should happen even when the user leaves the application, consider scheduling the network request using WorkManager or continue a user visible task using Foreground Service.

Ritiri

Con ogni release, API Android specifiche potrebbero diventare obsolete o dover essere ristrutturate per offrire un'esperienza migliore per gli sviluppatori o supportare nuove funzionalità della piattaforma. In questi casi, ritiriamo ufficialmente le API obsolete e indirizzamo gli sviluppatori ad API alternative da utilizzare.

Con ritiro si intende che abbiamo interrotto il supporto ufficiale delle API, che tuttavia continueranno a essere disponibili per gli sviluppatori. Per scoprire di più sui ritiri significativi in questa release di Android, consulta la pagina relativa ai ritiri.