A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Limiti per gli intent a schermo intero
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per impedire il phishing di credenziali e lo spam pubblicitario, a partire da Android 14,
l'autorizzazione predefinita USE_FULL_SCREEN_INTENT
per l'invio di notifiche a schermo intero può essere concessa solo alle app che
forniscono funzionalità di chiamata e sveglia.
Per tutte le app installate su Android 14, l'autorizzazione
USE_FULL_SCREEN_INTENT
è attiva per impostazione predefinita. Al momento dell'installazione, Google Play Store revoca l'autorizzazione per intent a schermo intero (FSI) per le app che non dispongono di funzionalità di chiamata o sveglia.
Per le app installate su smartphone con versioni di Android 13 o precedenti, l'autorizzazione USE_FULL_SCREEN_INTENT
rimane attiva per impostazione predefinita.
Autorizzazione dell'utente
Con Android 14, le app possono utilizzare NotificationManager#canUseFullScreenIntent()
per verificare se possono inviare notifiche a schermo intero. Per ottenere l'autorizzazione dell'utente per
inviare notifiche a schermo intero, le app utilizzano ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
per avviare l'impostazione Gestisci intent a schermo intero come mostrato nella Figura 1:
Figura 1. Interfaccia utente per consentire alle app di inviare intent a schermo intero.
L'impostazione Gestisci gli intent a schermo intero si trova nel menu Impostazioni, nella sezione Accesso speciale alle app. Con questa interfaccia utente, gli utenti possono revocare questa autorizzazione, se necessario.
Requisiti OEM
In Android 14, le autorizzazioni FSI per le app sono attivate per impostazione predefinita. Gli OEM devono specificare quali app sono idonee per le autorizzazioni FSI. Gli OEM devono assicurarsi che gli store di terze parti configurino gli stati di concessione iniziali delle autorizzazioni FSI per le loro app utilizzando PackageInstaller.SessionParams
, in particolare con i parametri PERMISSION_STATE_DEFAULT
, PERMISSION_STATE_DENIED
e PERMISSION_STATE_GRANTED
.
Convalida
Utilizza il test CTS Verifier in NotificationFullScreenIntentVerifierActivity.java
e il test CTS in NotificationManagerTest.java
per convalidare i limiti FSI.
Test manuali
Per verificare manualmente i limiti di FSI nella tua app:
- Dichiara
USE_FULL_SCREEN_INTENT
nel file AndroidManifest.xml
dell'app.
- Utilizza
ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
per gestire le impostazioni per attivare o disattivare la funzionalità.
- Sullo smartphone di test, attiva/disattiva manualmente l'autorizzazione utente per le notifiche a schermo intero come mostrato nella Figura 1.
- Invia una notifica FSI.
- Convalida l'aspetto della notifica a schermo intero per le seguenti combinazioni di modalità di visualizzazione e autorizzazione FSI:
Autorizzazione per i servizi finanziari
|
Schermo sbloccato
|
Schermata bloccata
|
Fuori schermo
|
Display sempre attivo (AOD)
|
Concessi dall'utente
|
Notifica in evidenza persistente (HUN) con pulsanti a pillola
|
Avvia FSI
|
Avvia FSI
|
Avvia FSI
|
Rifiutato dall'utente
|
HUN con pulsanti a pillola per 60 secondi
|
HUN con pulsanti a pillola viene visualizzato per primo nell'elenco per 60 secondi
|
La modalità AOD si attiva e mostra la schermata Home con i pulsanti a pillola per 60 secondi
|
HUN con pulsanti a pillola per 60 secondi
|
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# Full-screen intent limits\n\nTo prevent ad spam and credential phishing, starting with Android 14,\nthe default [`USE_FULL_SCREEN_INTENT`](https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT)\npermission to send full-screen notifications can be granted only to apps that\nprovide calling and alarm functionalities.\n\nFor all apps being installed on Android 14, the\n[`USE_FULL_SCREEN_INTENT`](https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT)\npermission is enabled by default. Upon installation, the Google Play Store\nrevokes the full-screen intent (FSI) permission for apps that do not have\ncalling or alarm functionalities.\n\nFor apps installed on phones running versions\nAndroid 13 or lower, the\n[`USE_FULL_SCREEN_INTENT`](https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT)\npermission remains enabled by default.\n\nUser permission\n---------------\n\nWith Android 14, apps can use [`NotificationManager#canUseFullScreenIntent()`](https://developer.android.com/reference/android/app/NotificationManager#canUseFullScreenIntent())\nto check if they can send full-screen notifications. To get user permission to\nsend full-screen notifications, apps use [`ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT`](https://developer.android.com/reference/android/provider/Settings#ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT)\nto launch the **Manage full screen intents** setting as shown in Figure 1:\n\n**Figure 1.** UI for enabling apps to send full-screen intents.\n\nThe **Manage full screen intents** setting is in the **Settings** menu under\n**Special App Access**. With this UI, users can revoke this permission if needed.\n\nOEM requirements\n----------------\n\nIn Android 14, FSI permissions for apps are enabled by\ndefault. OEMs must specify which apps qualify for FSI permissions. OEMs must\nensure that third-party app stores set the initial grant states of FSI\npermissions for their apps using\n[`PackageInstaller.SessionParams`](https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams),\nspecifically with the [`PERMISSION_STATE_DEFAULT`](https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams#PERMISSION_STATE_DEFAULT), [`PERMISSION_STATE_DENIED`](https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams#PERMISSION_STATE_DENIED), and [`PERMISSION_STATE_GRANTED`](https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams#PERMISSION_STATE_GRANTED)\nparameters.\n\nValidation\n----------\n\nUse the CTS Verifier test in [`NotificationFullScreenIntentVerifierActivity.java`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/apps/CtsVerifier/src/com/android/cts/verifier/notifications/NotificationFullScreenIntentVerifierActivity.java),\nand the CTS test in [`NotificationManagerTest.java`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/tests/app/src/android/app/cts/NotificationManagerTest.java;drc=ed156b1d4a7d91675dba1adb9191a92cf439dab0;l=148)\nto validate the FSI limits.\n\n### Manual tests\n\nFollow these steps to manually test FSI limits on your app:\n\n1. Declare [`USE_FULL_SCREEN_INTENT`](https://developer.android.com/reference/android/Manifest.permission#USE_FULL_SCREEN_INTENT) in your app's `AndroidManifest.xml` file.\n2. Use [`ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT`](https://developer.android.com/reference/android/provider/Settings#ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT) to manage settings to turn FSI on or off.\n3. On your test phone, manually toggle the user permission for full-screen notifications as shown in Figure 1.\n4. Send an FSI notification.\n5. Validate the appearance of the full-screen notification for the following combinations of FSI permission and display modes:\n\n|--------------------|----------------------------------------------------------|----------------------------------------------------------|---------------------------------------------------|-------------------------------|\n| **FSI permission** | **Unlocked screen** | **Locked screen** | **Off screen** | **Always-on display (AOD)** |\n| Granted by user | Persistent heads-up notification (HUN) with pill buttons | Launch FSI | Launch FSI | Launch FSI |\n| Denied by user | HUN with pill buttons for 60s | HUN with pill buttons shows up first in the list for 60s | AOD turns on, shows HUN with pill buttons for 60s | HUN with pill buttons for 60s |"]]