diff options
-rw-r--r-- | core/java/android/os/Trace.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java index edb3a641f107..4a37e0a70443 100644 --- a/core/java/android/os/Trace.java +++ b/core/java/android/os/Trace.java @@ -520,8 +520,20 @@ public final class Trace { * @param counterValue The counter value. */ public static void setCounter(@NonNull String counterName, long counterValue) { - if (isTagEnabled(TRACE_TAG_APP)) { - nativeTraceCounter(TRACE_TAG_APP, counterName, counterValue); + setCounter(TRACE_TAG_APP, counterName, counterValue); + } + + /** + * Writes trace message to indicate the value of a given counter under a given trace tag. + * + * @param traceTag The trace tag. + * @param counterName The counter name to appear in the trace. + * @param counterValue The counter value. + * @hide + */ + public static void setCounter(long traceTag, @NonNull String counterName, long counterValue) { + if (isTagEnabled(traceTag)) { + nativeTraceCounter(traceTag, counterName, counterValue); } } |