@Test public void testZeroLogging() { CameraMetrics zeroMetrics = new CameraMetrics(); ReporterEvent event = new ReporterEvent(); mCameraMetricsReporter.reportTo(zeroMetrics, event); assertThat(event.eventMap.isEmpty()).isTrue(); }
@Override public void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event) { if (metrics.cameraOpenTimeMs != 0) { event.add(CAMERA_OPEN_TIME_MS, metrics.cameraOpenTimeMs); } if (metrics.cameraPreviewTimeMs != 0) { event.add(CAMERA_PREVIEW_TIME_MS, metrics.cameraPreviewTimeMs); } }
CameraMetricsReporter implements SystemMetricsReporter<CameraMetrics> { @Override public void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event) { if (metrics.cameraOpenTimeMs != 0) { event.add(CAMERA_OPEN_TIME_MS, metrics.cameraOpenTimeMs); } if (metrics.cameraPreviewTimeMs != 0) { event.add(CAMERA_PREVIEW_TIME_MS, metrics.cameraPreviewTimeMs); } } }
CameraMetricsReporter implements SystemMetricsReporter<CameraMetrics> { @Override public void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event) { if (metrics.cameraOpenTimeMs != 0) { event.add(CAMERA_OPEN_TIME_MS, metrics.cameraOpenTimeMs); } if (metrics.cameraPreviewTimeMs != 0) { event.add(CAMERA_PREVIEW_TIME_MS, metrics.cameraPreviewTimeMs); } }  }
CameraMetricsReporter implements SystemMetricsReporter<CameraMetrics> { @Override public void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event) { if (metrics.cameraOpenTimeMs != 0) { event.add(CAMERA_OPEN_TIME_MS, metrics.cameraOpenTimeMs); } if (metrics.cameraPreviewTimeMs != 0) { event.add(CAMERA_PREVIEW_TIME_MS, metrics.cameraPreviewTimeMs); } }  @Override void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event); }
CameraMetricsReporter implements SystemMetricsReporter<CameraMetrics> { @Override public void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event) { if (metrics.cameraOpenTimeMs != 0) { event.add(CAMERA_OPEN_TIME_MS, metrics.cameraOpenTimeMs); } if (metrics.cameraPreviewTimeMs != 0) { event.add(CAMERA_PREVIEW_TIME_MS, metrics.cameraPreviewTimeMs); } }  @Override void reportTo(CameraMetrics metrics, SystemMetricsReporter.Event event); static final String CAMERA_OPEN_TIME_MS; static final String CAMERA_PREVIEW_TIME_MS; }