diff options
| author | 2023-09-22 14:13:22 +0000 | |
|---|---|---|
| committer | 2023-09-25 13:21:22 +0000 | |
| commit | df50d86df111375a95cbc23638ebc02cb91dee23 (patch) | |
| tree | 1f73e22ae3e32a172afbd24d74b9843a4482cb89 | |
| parent | 0d8faee42dccaabac5a14bbd8f3d1d8c4224fc8f (diff) | |
Adding tracing to VoteStorage updates
Bug: b/297933745
Test: maunal testing, see comment 11
Change-Id: I7f19e092f9f747e89e36bc756606b380953cea93
| -rw-r--r-- | services/core/java/com/android/server/display/mode/VotesStorage.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/display/mode/VotesStorage.java b/services/core/java/com/android/server/display/mode/VotesStorage.java index dadcebe8d8a1..bdd2ab7d63b4 100644 --- a/services/core/java/com/android/server/display/mode/VotesStorage.java +++ b/services/core/java/com/android/server/display/mode/VotesStorage.java @@ -18,6 +18,7 @@ package com.android.server.display.mode; import android.annotation.NonNull; import android.annotation.Nullable; +import android.os.Trace; import android.util.Slog; import android.util.SparseArray; @@ -104,6 +105,9 @@ class VotesStorage { votes.remove(priority); } } + Trace.traceCounter(Trace.TRACE_TAG_POWER, + TAG + "." + displayId + ":" + Vote.priorityToString(priority), + getMaxPhysicalRefreshRate(vote)); if (mLoggingEnabled) { Slog.i(TAG, "Updated votes for display=" + displayId + " votes=" + votes); } @@ -146,6 +150,15 @@ class VotesStorage { } } + private int getMaxPhysicalRefreshRate(@Nullable Vote vote) { + if (vote == null) { + return -1; + } else if (vote.refreshRateRanges.physical.max == Float.POSITIVE_INFINITY) { + return 1000; // for visualisation, otherwise e.g. -1 -> 60 will be unnoticeable + } + return (int) vote.refreshRateRanges.physical.max; + } + interface Listener { void onChanged(); } |