Adding generation of ACTION_TOGGLE_RECENTS to shared lib

Bug: 72967764
Test: atest google/perf/app-transition/sysui-latency-test, watch for 1_*
entries in output

Change-Id: I0bfaa46df4f3167687099742cb3063e88dab30ae
This commit is contained in:
Vadim Tryshev
2018-03-09 11:08:53 -08:00
parent a42585c349
commit 2f4d2af93a
2 changed files with 45 additions and 2 deletions

View File

@@ -147,8 +147,17 @@ public class LatencyTracker {
}
mStartRtc.delete(action);
Trace.asyncTraceEnd(Trace.TRACE_TAG_APP, NAMES[action], 0);
long duration = endRtc - startRtc;
logAction(action, (int)(endRtc - startRtc));
}
/**
* Logs an action that has started and ended. This needs to be called from the main thread.
*
* @param action The action to end. One of the ACTION_* values.
* @param duration The duration of the action in ms.
*/
public static void logAction(int action, int duration) {
Log.i(TAG, "action=" + action + " latency=" + duration);
EventLog.writeEvent(EventLogTags.SYSUI_LATENCY, action, (int) duration);
EventLog.writeEvent(EventLogTags.SYSUI_LATENCY, action, duration);
}
}