部分的な wake lock は PowerManager API のメカニズムです。これにより、デベロッパーはデバイスのディスプレイがオフになった後も(システム タイムアウトが原因であっても、ユーザーが電源ボタンを押したことが原因であっても)CPU を動作させ続けられます。アプリで部分的な wake lock を取得するには、PARTIAL_WAKE_LOCK フラグを指定して acquire() を呼び出します。または、wake lock を取得する他の API を使用します。部分的な wake lock を過度に使用すると、デバイスが省電力状態にならないため、デバイスの電池が消耗します。部分的な wake lock は必要なときにのみ使用し、不要になったらすぐに解放する必要があります。
アプリで部分的な wake lock が過度に使用されている場合は、このページのガイダンスを使用して問題を診断し、解決できます。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# Excessive partial wake locks (beta)\n\nPartial wake locks are a mechanism in the [`PowerManager`](/reference/android/os/PowerManager) API that lets\ndevelopers keep the CPU running after a device's display turns off (whether due\nto system timeout or the user pressing the power button). Your app acquires a\npartial wake lock by calling [`acquire()`](/reference/android/os/PowerManager.WakeLock#acquire()) with the [`PARTIAL_WAKE_LOCK`](/reference/android/os/PowerManager#PARTIAL_WAKE_LOCK)\nflag, or by using [other APIs that acquire wake locks](/develop/background-work/background-tasks/awake/wakelock/identify-wls).\nExcessive use of partial wake locks drains the device's battery because it\nprevents the device from entering lower power states. Partial wake locks should\nbe used only when necessary and released as soon as no longer needed.\n\nIf your app uses partial wake locks excessively, you can use the guidance in\nthis page to diagnose and fix the problem.\n\nYour feedback is a crucial part of improving our documentation. Please give us\nyour feedback using the following link:\n\n\n[Give feedback](https://docs.google.com/forms/d/e/1FAIpQLScYkStao0zVsmPay22DGqYEMJSf2Rk3SE3LnPc1lcmLjN1AiQ/viewform?usp=dialog)\n\nDetect the problem\n------------------\n\nAndroid vitals can help you find out when your app's use of partial wake locks\nis excessive.\n\n### Android vitals\n\nAndroid vitals can help improve your app's performance by [alerting you via the\nPlay Console](https://support.google.com/googleplay/android-developer/answer/9844486?) when your app's use of partial wake locks is\nexcessive.\n| **Note:** Tracking of excessive partial wake locks is **currently in beta**. The threshold numbers, relevant app states, and exceptions for behavior that has end-user benefit, are all subject to change. The beta metric does not currently make your app less discoverable on Google Play. Once the metric is out of beta, excessive partial wake lock use may impact app discoverability on Play.\n\nAndroid vitals reports partial wake lock use as **excessive** when **all of the\npartial wake locks**, added together, run for 3 or more hours in 24-hour\nperiod.\n\nAndroid vitals tracks time only if the wake lock is held when the app **is in\nthe background** and **does not have a foreground service**.\n\nAndroid vitals gives some exemptions to partial wake lock usage in scenarios\nwhere there is a clear user benefit of the partial wake lock, and there's no\nbetter way to achieve that result without the partial wake lock. In those cases,\nAndroid vitals might not count the partial wake lock time against the 3-hour\nlimit. For example, if an app is playing audio for the user, there's a clear\nbenefit to keeping the device awake and there's no way to play the audio without\nkeeping the device awake. In that case, the partial wake lock time is not\ncounted against the Android vitals.\n\nIf excessive partial wake locks occur in more than 5% of app sessions across all\ndevices in a 28-day period, it can affect your app's visibility on Play once the\nmetric is out of beta.\n\nOnce you're aware that your app has excessive partial wake locks,\nyour next step is to address the issue.\n\nFix the problem\n---------------\n\nBecause wake locks can drain the device battery, you shouldn't use wake\nlocks if there's an alternative. The\n[Choose the right API to keep the device awake](/develop/background-work/background-tasks/awake)\ndocumentation can help you find the best solution for your app.\n\nIf you do need to use a wake lock, [follow wake lock best practices](/develop/background-work/background-tasks/awake/wakelock/best-practices)\nto make sure your wake locks don't hurt device efficiency. In particular,\nmake sure every device you acquire is released, and release the lock as quickly\nas possible.\n\nAfter fixing the problem in code, you can verify your fixes by using [local\nwake lock debugging tools](/develop/background-work/background-tasks/awake/wakelock/debug-locally).\n\nSee also\n--------\n\n- [Stuck partial wake locks](/topic/performance/vitals/excessive-wakelock)\n- [Wake lock documentation](/develop/background-work/background-tasks/awake/wakelock)\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Frozen frames](/topic/performance/vitals/render#frozen-frames)\n- [Run benchmarks in Continuous Integration](/topic/performance/benchmarking/benchmarking-in-ci)\n- [Create and measure Baseline Profiles without Macrobenchmark](/topic/performance/baselineprofiles/manually-create-measure)"]]