From 24a0c136876e4b77291408b710b09301a4e51dfa Mon Sep 17 00:00:00 2001 From: Olivier Gaillard Date: Wed, 22 Nov 2017 15:07:31 +0000 Subject: Add documentation to recommend naming convention for wake lock tags which help developers with debugging. Test: only comments updated Change-Id: If92730df384de15d3f7759e235104a3848321ffa --- core/java/android/os/PowerManager.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 068f5f7f51cc..01fe5bfee6c7 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -680,6 +680,26 @@ public final class PowerManager { * as the user moves between applications and doesn't require a special permission. *

* + *

+ * Recommended naming conventions for tags to make debugging easier: + *

+ *

+ * * @param levelAndFlags Combination of wake lock level and flag values defining * the requested behavior of the WakeLock. * @param tag Your class name (or other tag) for debugging purposes. @@ -1509,6 +1529,13 @@ public final class PowerManager { * cost of that work can be accounted to the application. *

* + *

+ * Make sure to follow the tag naming convention when using WorkSource + * to make it easier for app developers to understand wake locks + * attributed to them. See {@link PowerManager#newWakeLock(int, String)} + * documentation. + *

+ * * @param ws The work source, or null if none. */ public void setWorkSource(WorkSource ws) { -- cgit v1.2.3-59-g8ed1b