2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
全画面インテントの制限
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
広告スパムと認証情報フィッシングを回避するため、Android 14 以降では、全画面通知を送信するデフォルトの USE_FULL_SCREEN_INTENT
権限を付与できる対象が、通話機能とアラーム機能があるアプリに制限されています。
Android 14 にインストールされているすべてのアプリは、USE_FULL_SCREEN_INTENT
権限がデフォルトで有効になっています。インストール時に Google Play ストアは通話機能とアラーム機能がないアプリの全画面インテント(FSI)権限を取り消します。
Android 13 以前のバージョンを搭載したスマートフォンにインストールされているアプリの場合、USE_FULL_SCREEN_INTENT
権限は引き続きデフォルトで有効になっています。
ユーザー権限
Android 14 では、アプリで NotificationManager#canUseFullScreenIntent()
を使用して、全画面通知を送信できるかどうかを確認できます。全画面通知を送信するユーザー権限を取得するには、図 1 に示すとおり、アプリで ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
を使用して、[全画面インテントの管理] 設定を起動します。
図 1. アプリが全画面インテントを送信できるようにする UI
[全画面インテントの管理] 設定は [特別なアプリアクセス] の下の [設定] メニューにあります。この UI を使って、ユーザーは必要に応じてこの権限を取り消せます。
OEM の要件
Android 14 では、アプリの FSI 権限はデフォルトで有効になっています。OEM は FSI 権限の資格があるアプリを指定する必要があります。OEM はサードパーティのアプリストアがアプリの FSI 権限の初期付与ステータスを PackageInstaller.SessionParams
を使って、具体的には PERMISSION_STATE_DEFAULT
、PERMISSION_STATE_DENIED
、PERMISSION_STATE_GRANTED
パラメータを使って設定していることを確認する必要があります。
検証
NotificationFullScreenIntentVerifierActivity.java
の CTS 検証ツールテストと NotificationManagerTest.java
の CTS テストを使用して、FSI 制限を検証します。
手動テスト
次のステップに沿って、手動でアプリの FSI 制限をテストします。
- アプリの
AndroidManifest.xml
ファイルで USE_FULL_SCREEN_INTENT
を宣言します。
ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT
を使用して、FSI をオンまたはオフにする設定を管理します。
- テスト用スマートフォンで、図 1 のように全画面通知のユーザー権限を手動で切り替えます。
- FSI 通知を送信します。
- FSI 権限と表示モードの次の組み合わせで、全画面通知の表示を確認します。
FSI 権限
|
ロック解除された画面
|
ロック画面
|
画面オフ
|
常に表示状態のディスプレイ(AOD)
|
ユーザーによる許可
|
丸形のボタンが付いたヘッドアップ通知(HUN)が表示され続ける
|
FSI の起動
|
FSI の起動
|
FSI の起動
|
ユーザーによる却下
|
丸形ボタンが付いた HUN が 60 秒表示される
|
丸形ボタンが付いた HUN がリストの最初に 60 秒表示される
|
AOD がオンになり、丸形ボタンが付いた HUN が 60 秒表示される
|
丸形ボタンが付いた HUN が 60 秒表示される
|
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 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 |"]]