metrics: Add an option to metrics_client to dump the logs cache.

The format of the metrics dump is rudimentary just yet. Here is an example:

  Metrics from /data/misc/metrics/uma-events

  name: hello     type: USER_ACTION
  name: world     type: USER_ACTION

This required the following changes:
* Added -d option to metrics_client
* Refactored file handling in SerializationUtils
 - Factored out file opening and log parsing into helper methods
 - Added ReadMetricsFromFile which is read-only so does not truncate the file

Change-Id: I6032d74242c79c678ec42a14e78fccc54e7af455
3 files changed