media: deliver report to host

Bug: 20507129
Change-Id: Ieb35d5a76f36ecafd0b56e6a85136f9c9369fb37
diff --git a/tests/tests/media/src/android/media/cts/VideoDecoderPerfTest.java b/tests/tests/media/src/android/media/cts/VideoDecoderPerfTest.java
index 45fdb13..5937253 100644
--- a/tests/tests/media/src/android/media/cts/VideoDecoderPerfTest.java
+++ b/tests/tests/media/src/android/media/cts/VideoDecoderPerfTest.java
@@ -32,7 +32,6 @@
 import android.util.Log;
 import android.view.Surface;
 
-import com.android.cts.util.ReportLog;
 import com.android.cts.util.ResultType;
 import com.android.cts.util.ResultUnit;
 
@@ -52,12 +51,19 @@
     private static final String VIDEO_MPEG4 = MediaFormat.MIMETYPE_VIDEO_MPEG4;
 
     private Resources mResources;
-    private DeviceReportLog mReportLog = new DeviceReportLog();
+    private DeviceReportLog mReportLog;
 
     @Override
     protected void setUp() throws Exception {
         super.setUp();
         mResources = mContext.getResources();
+        mReportLog = new DeviceReportLog();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        mReportLog.deliverReportToHost(getInstrumentation());
+        super.tearDown();
     }
 
     private static String[] getDecoderName(String mime) {
@@ -97,6 +103,8 @@
                 Log.d(TAG, "round #" + i + " decode to buffer");
                 doDecode(name, video, TOTAL_FRAMES, null);
             }
+            // use 0 for summary line, detail for each test config is in the report.
+            mReportLog.printSummary("average fps", 0, ResultType.HIGHER_BETTER, ResultUnit.FPS);
         }
     }
 
@@ -222,9 +230,6 @@
         String message = "average fps for " + testConfig;
         double fps = (double)outputNum / ((finish - start) / 1000.0);
         mReportLog.printValue(message, fps, ResultType.HIGHER_BETTER, ResultUnit.FPS);
-
-        message = "frame time diff for " + testConfig + ": " + Arrays.toString(frameTimeDiff);
-        mReportLog.printValue(message, 0, ResultType.NEUTRAL, ResultUnit.NONE);
     }
 
     public void testH264320x240() throws Exception {