2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
電源管理
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
バッテリー駆動時間は常にユーザーの関心事です。バッテリーを長持ちさせるために、Android は充電器に接続されていないときのアプリとデバイスの動作を最適化するための新しい機能を継続的に追加しています。
Android は、バッテリーを長持ちさせるために次のような機能を備えています。
-
アプリの制限。プラットフォームは、バッテリー駆動時間に悪影響を及ぼすアプリを知らせることができます。ユーザーは、そのようなアプリがリソースを消費しないように制限することを選択できます。デフォルトでは、アプリのバックグラウンド制限はありません。
- アプリ スタンバイ。プラットフォームは、使用していないアプリをアプリ スタンバイ モードにして、一時的にネットワーク アクセスを制限し、それらのアプリの同期とジョブを保留できます。
-
Doze。ユーザーがデバイスを長時間自発的に使用していない(画面がオフでデバイスが移動していない)場合、プラットフォームはディープ スリープ状態(通常のオペレーションを定期的に再開する状態)になります。さらに、Android 7.0 以降では、画面がオフでデバイスが移動している状態でも、Doze によって最適化の一部がトリガーされます。
- USB のバックアップと復元時の電力転送を制限します。USB のバックアップまたは復元を行う場合は、
UsbPort
クラスの enableLimitPowerTransfer
メソッドを true
に設定して充電を無効にし、電力供給を制限してください。電力が制限されていることを確認するには、UsbPortStatus
クラスの isPowerTransferLimited
メソッドを呼び出します。isPowerTransferLimited
が true
の場合、Android デバイスは消費電力をシンクとして 0(またはハードウェアで許容される最小値)に減らし、ソース電流を 0 に制限します。ソース電源の制限は、両方のポート パートナーが USB Power Delivery(PD)の仕様をサポートしている場合にのみ適用できます。電力使用量をデフォルトの状態に戻すには、enableLimitPowerTransfer
を false
に設定します。USB ケーブルが取り外された場合も、デフォルトの状態が返されます。
-
除外。一般的に、プリロードされているシステムアプリとクラウド メッセージ サービスは、デフォルトでアプリ スタンバイと Doze から除外されます。アプリ デベロッパーは、インテントを使用して、これらの設定をアプリに適用できます。ユーザーは、設定メニューで、アプリ スタンバイと Doze の省電力モードから除外するアプリを選択できます。
-
トラッカー。アプリのバックグラウンド動作トラッカーは、アプリのフォアグラウンドとバックグラウンドのバッテリー使用量をモニタリングし、アプリが一部のポリシーに違反しているかどうかを判断します。
アプリを除外する
アプリを Doze またはアプリ スタンバイの適用対象から除外できます。次のユースケースで、除外が必要になる場合があります。
- Firebase Cloud Messaging(FCM)以外のクラウド メッセージング プラットフォームを使用するデバイス メーカー
- FCM 以外のクラウド メッセージング プラットフォームを使用する携帯通信会社
- FCM 以外のクラウド メッセージング プラットフォームを使用するサードパーティ アプリ
警告: テストと最適化を回避するためにアプリを除外しないでください。不必要にアプリを除外すると、Doze とアプリ スタンバイのメリットが損なわれ、ユーザー エクスペリエンスが低下することがあります。プラットフォームによる電力消費の有益な制御が損なわれる可能性があるため、アプリの除外は最小限に留めることを強くおすすめします。除外したアプリの電力消費が多すぎるとユーザーが感じた場合、満足度とエクスペリエンスが低下し、アプリに対する否定的なレビューやカスタマー サポートへの問い合わせにつながる可能性があります。したがって、クラウド メッセージ ングサービスまたはそれと類似する機能を備えたアプリだけを除外し、サードパーティ アプリは除外しないことを強くおすすめします。
デフォルトで除外されるアプリの一覧は、[設定] > [アプリと通知] > [特別なアプリアクセス] > [バッテリーの最適化] で確認できます。このリストは、Doze モードとアプリ スタンバイ モードの両方からアプリを除外するために使用します。ユーザー対して透明性を高めるために、除外しているすべてのアプリを設定メニューに表示する必要があります。
ユーザーは、[設定] > [アプリと通知] > [APP-NAME] > [バッテリー] > [バッテリーの最適化] でアプリを手動で除外し、次にアプリを選択して最適化をオフ(またはオン)にできます。ただし、ユーザーは、システム イメージでデフォルトで除外されているアプリやサービスの例外ステータスは変更できません。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。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,["# Power management\n\nBattery life is a perennial user concern. To extend battery life, Android\ncontinually adds new features to help the platform optimize the off-charger\nbehavior of apps and devices.\n\nAndroid includes the following battery life enhancements:\n\n- [App restrictions](/docs/core/power/app_mgmt#app-restrictions). The platform can suggest apps that negatively affect battery life, so that users can choose to restrict those apps from consuming resources. Apps aren't background restricted by default.\n- [App standby](/docs/core/power/app_mgmt#app-standby). The platform can place unused apps in App standby mode, temporarily restricting network access and deferring syncs and jobs for those apps.\n- [Doze](/docs/core/power/platform_mgmt#doze). The platform can enter a state of deep sleep (periodically resuming normal operations) if users haven't actively used their device (screen off and stationary) for extended periods of time. Android 7.0 and higher also enables Doze to trigger a lighter set of optimizations when users turn off the device screen yet continue to move around.\n- Limiting power transfer during USB backup and restore. When performing a USB backup or restore, set the `UsbPort` class's `enableLimitPowerTransfer` method to `true` to disable charging and limit the sourcing power. To verify that power is limited, call `UsbPortStatus` class's `isPowerTransferLimited` method. When `isPowerTransferLimited` is `true`, the Android device reduces the power draw as a sink to 0 (or the lowest possible value allowed by hardware) and limits the source current to 0. Limiting source power can be enforced only when both port partners support USB power delivery (PD) specification. To return power usage to the defatult state, set `enableLimitPowerTransfer` to `false`. The default state is also returned when the USB cable is disconnected.\n- [Exemptions](#exempt-apps). Preloaded system apps and cloud messaging services are typically exempted from App standby and Doze by default. App developers can use intents to apply these settings to their apps. Users can exempt apps from App standby and Doze power-saving modes in the Settings menu.\n- [Trackers](/docs/core/power/trackers). App background behavior trackers monitor apps' foreground and background battery usage to determine if the apps violate some policy.\n\nExempt apps\n-----------\n\nYou can exempt apps from being subject to Doze or App standby.\nExemptions may be needed in the following use cases:\n\n- Device manufacturers using a cloud messaging platform other than [Firebase\n cloud messaging (FCM)](https://firebase.google.com/docs/cloud-messaging/)\n- Carrier using non-FCM cloud messaging platform\n- Third-party app using non-FCM cloud messaging platform\n\n**Warning:** Don't exempt apps to avoid testing\nand optimizing. Unnecessary exemptions undermine the benefits of Doze and App\nstandby and can compromise the user experience, so we strongly suggest\nminimizing such exemptions as they allow apps to defeat beneficial\ncontrols the platform has over power use. If users become unhappy about the\npower consumption of these apps, it can lead to frustration, bad experiences\n(and negative reviews for the app), and customer support questions. For these\nreasons, we strongly recommend that you don't exempt third-party apps\nand instead exempt only cloud messaging services or apps with similar\nfunctions.\n\nApps exempted by default are listed in **Settings \\\u003e App \\&\nNotifications \\\u003e Special app access \\\u003e Battery Optimization** . This list is\nused for exempting the app from both Doze and App standby modes. To provide\ntransparency to the user, the Settings menu **MUST** show all\nexempted apps.\n\nUsers can manually exempt apps using **Settings \\\u003e App \\& Notifications \\\u003e\n\u003cvar translate=\"no\"\u003eAPP-NAME\u003c/var\u003e \\\u003e Battery \\\u003e Battery Optimization** and then selecting the\napp to turn off (or back on) optimization. However, users can't change the except status of any\napp or service that is exempted by default in the system image."]]