EmulatedFakeCamera2: Implement basic dump()

Bug: 6243944
Change-Id: I84696ea79f8c36d34c2cccdac259c9baba048c1f
diff --git a/tools/emulator/system/camera/EmulatedFakeCamera2.cpp b/tools/emulator/system/camera/EmulatedFakeCamera2.cpp
index 31ac8ea..e1c6010 100644
--- a/tools/emulator/system/camera/EmulatedFakeCamera2.cpp
+++ b/tools/emulator/system/camera/EmulatedFakeCamera2.cpp
@@ -455,6 +455,20 @@
 /** Shutdown and debug methods */
 
 int EmulatedFakeCamera2::dump(int fd) {
+    String8 result;
+
+    result.appendFormat("    Camera HAL device: EmulatedFakeCamera2\n");
+    result.appendFormat("      Streams:\n");
+    for (size_t i = 0; i < mStreams.size(); i++) {
+        int id = mStreams.keyAt(i);
+        const Stream& s = mStreams.valueAt(i);
+        result.appendFormat(
+            "         Stream %d: %d x %d, format 0x%x, stride %d\n",
+            id, s.width, s.height, s.format, s.stride);
+    }
+
+    write(fd, result.string(), result.size());
+
     return NO_ERROR;
 }
 
diff --git a/tools/emulator/system/camera/EmulatedFakeCamera2.h b/tools/emulator/system/camera/EmulatedFakeCamera2.h
index 34d1b12..9a0b676 100644
--- a/tools/emulator/system/camera/EmulatedFakeCamera2.h
+++ b/tools/emulator/system/camera/EmulatedFakeCamera2.h
@@ -29,6 +29,8 @@
 #include "fake-pipeline2/JpegCompressor.h"
 #include <utils/Condition.h>
 #include <utils/KeyedVector.h>
+#include <utils/String8.h>
+#include <utils/String16.h>
 #include <utils/Thread.h>
 
 namespace android {
diff --git a/tools/emulator/system/camera/fake-pipeline2/Base.h b/tools/emulator/system/camera/fake-pipeline2/Base.h
index f6ee5db..7f6be16 100644
--- a/tools/emulator/system/camera/fake-pipeline2/Base.h
+++ b/tools/emulator/system/camera/fake-pipeline2/Base.h
@@ -41,7 +41,6 @@
 typedef Vector<StreamBuffer> Buffers;
 
 struct Stream {
-    uint32_t id;
     const camera2_stream_ops_t *ops;
     uint32_t width, height;
     uint32_t format;