Merge "Adding generation of ACTION_TOGGLE_RECENTS to shared lib" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-12 18:13:16 +00:00
committed by Android (Google) Code Review
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);
}
}