背景モード
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アンビエント モードは、Google TV と Android TV に組み込まれているスクリーンセーバーです。静止画像を長時間表示しないようにすることが目的です。これは、画面焼き付きの影響を受けやすい OLED などのディスプレイ技術にとって重要です。
ユーザーが操作しなかった状態が 10 分間続くと、OS によってデバイスがアンビエント モードになります。ユーザーが操作しなかった時間がさらに経過すると(デバイスの省電力設定で定義されます)、OS は省電力モードに入り、ディスプレイの電源がオフになります。映画の視聴中など、ユーザーが操作していないにもかかわらず、メディア再生アプリによってデバイスが常に画面表示モードにならない場合があります。
ユーザーが常に画面表示モードに移行してから 30 分以内にデバイスを操作すると、常に画面表示モードに移行したときにアクティブだったアプリが復元されます。ユーザーがアンビエント モードに入った後 30 分以上経過してからデバイスを操作すると、ホーム画面に戻ります。ユーザーが省電力モード中に電源ボタンを使用してデバイスを起動すると、ホーム画面が表示されます。または、ユーザーが特定のアプリボタン(YouTube など)を使用して、省エネモードでデバイスを起動した場合、そのアプリに直接移動します。
動画の再生
動画再生では、ユーザーが開始した再生中にデバイスがアンビエント モードにならないようにすることが重要です。これにより、途切れることのない視聴体験を提供できます。ただし、再生が停止または一時停止されたときに、デバイスがアンビエント モードに移行することをアプリが妨げてはなりません。
オーディオの再生
音声再生の場合、静止画像以外の独自のスクリーンセーバーを実装していない限り、アプリは再生中に背景モードを妨げてはなりません。アンビエント モードが有効になっている間は、音声の再生が続行されます。
Android での音声再生では、部分的な wake lock が暗黙的に保持されます。これにより、デバイスがアンビエント モードに移行することはありませんが、その後の省電力モードへの移行はブロックされます。そのため、デバイスがアンビエント モードになっても再生は続行されますが、再生が中断されないようにデバイスはスリープ状態になりません。
アンビエント モードの防止
OS がデバイスをアンビエント モードに移行しないようにすることは可能ですが、アンビエント モードの要件に従って使用する必要があります。アプリ デベロッパーは、デバイスが省エネモードに入るのを防ぐことはできません。
アプリは、Window
にフラグを設定することで、画面がオフになるのを防ぐことができます。
Kotlin
requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
Java
requireActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
このフラグが設定されている間、アンビエント モードは無効になります。再度有効にするには、フラグをクリアする必要があります。
Kotlin
requireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
Java
requireActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 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-07-27 UTC。"],[],[],null,["# Ambient Mode is a screensaver built into Google TV and Android TV. Its purpose\nis to avoid displaying static images for extended periods. This is important\nfor display technologies, such as OLED, which may be susceptible to screen burn.\n\nThe OS will put the device into Ambient Mode after 10 minutes of user\ninactivity. After a further period of user inactivity (defined by the device\nEnergy Saver setting) the OS will enter Energy Saver mode,\npowering the display off. Media playback apps may prevent the device\nfrom entering Ambient Mode, despite the user not interacting with it, for\nexample, while watching a movie.\n\nIf the user interacts with the device within 30 minutes of entering Ambient\nMode, the app that was active when Ambient Mode was entered will be restored.\nIf the user interacts with the device more than 30 minutes after entering\nAmbient Mode, they will be returned to the Home screen.\nWhen the user starts the device using the power button while it's in Energy\nSaver mode, they will be taken to the Home screen. Alternatively, if the user\nstarts the device while it's in Energy Saver mode using specific app buttons\n(for example, YouTube) they will be taken directly to that app.\n| **Note:** It is important to ensure that your app meets [the Ambient Mode requirements](/docs/quality-guidelines/tv-app-quality#ambient-mode) when submitting it to Google Play.\n\nVideo playback\n--------------\n\nFor video playback, it's important to [prevent the device entering Ambient Mode\nduring user-initiated playback](/docs/quality-guidelines/tv-app-quality#TV-BU)\nto provide an uninterrupted viewing experience. However, apps should *not*\nprevent devices from entering Ambient Mode when playback is stopped or paused.\n\nAudio playback\n--------------\n\nFor audio playback, apps\n[should not prevent Ambient Mode during playback](/docs/quality-guidelines/tv-app-quality#TV-BA)\nunless they implement their own screensaver with non-static imagery.\nAudio playback will continue while Ambient Mode is active.\n\nAudio playback on Android will implicitly hold a\n[partial wake lock](/reference/android/os/PowerManager#PARTIAL_WAKE_LOCK).\nThis will *not* prevent the device from entering Ambient Mode, but *will*\nprevent the subsequent transition to Energy Saver mode. Playback will therefore\ncontinue even after the device enters Ambient Mode, but the device will be\nprevented from going to sleep to allow uninterrupted playback.\n\nPreventing Ambient Mode\n-----------------------\n\nIt is possible to prevent the OS from putting the device into Ambient Mode, but\nthis must be used in accordance with\n[Ambient Mode requirements](/docs/quality-guidelines/tv-app-quality#ambient-mode).\nApp developers cannot prevent the device from entering\nEnergy Saver mode.\n\nApps can prevent the screen from turning off by setting a flag on the\n[`Window`](/reference/android/view/Window): \n\n### Kotlin\n\n```kotlin\nrequireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)\n```\n\n### Java\n\n```java\nrequireActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n```\n\nAmbient Mode will be disabled while this flag is set. To re-enable it you must\nclear the flag: \n\n### Kotlin\n\n```kotlin\nrequireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)\n```\n\n### Java\n\n```java\nrequireActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n```\n| **Note:** You must only prevent the device from entering Ambient Mode for user-initiated playback sessions. If your app is [automatically playing video or animations](/docs/quality-guidelines/tv-app-quality#TV-BY), you must *not* set the [`FLAG_KEEP_SCREEN_ON`](/reference/android/view/WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON) flag."]]