Rework the way diagnostic events are serialized to JSON, and deserialized:

- add a "type" field to distinguish between live and freeze frame data;
- make a DiagnosticJson class to contain the deserialized JSON;
- move logic to make a VehiclePropValue out of JSON into its own class (DiagnosticJsonReader / DiagnosticJson.Builder)
  This is useful/necessary because you need to know the number of vendor specific sensors if you're going to generate a valid
  VehiclePropValue for a real vehicle instead of a test case

Test: runtest -x packages/services/Car/tests/obd2_test/src/com/android/car/obd2/test/Obd2LiveFrameGeneratorTest.java
Change-Id: Ibc32fef65907137a36b33bf5ae983f27cff15e87
6 files changed