Merge "Give a clear error message if we can't start the server." am: b6d3f28287 am: 1496863091
am: 07db226264

Change-Id: Ic2244ee02ca83ccdffcfbefac49797c2e4f7d459
diff --git a/Android.mk b/Android.mk
index 1f6f194..6ed01fa 100644
--- a/Android.mk
+++ b/Android.mk
@@ -135,7 +135,7 @@
 
 # Even though we're building a static library (and thus there's no link step for
 # this to take effect), this adds the includes to our path.
-LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase
+LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libqemu_pipe libbase
 
 LOCAL_WHOLE_STATIC_LIBRARIES := libadbd_usb
 
@@ -369,6 +369,7 @@
     libadbd \
     libavb_user \
     libbase \
+    libqemu_pipe \
     libbootloader_message \
     libfs_mgr \
     libfec \
diff --git a/framebuffer_service.cpp b/framebuffer_service.cpp
index 7baad8b..6c3a225 100644
--- a/framebuffer_service.cpp
+++ b/framebuffer_service.cpp
@@ -37,10 +37,11 @@
 */
 /* This version number defines the format of the fbinfo struct.
    It must match versioning in ddms where this data is consumed. */
-#define DDMS_RAWIMAGE_VERSION 1
+#define DDMS_RAWIMAGE_VERSION 2
 struct fbinfo {
     unsigned int version;
     unsigned int bpp;
+    unsigned int colorSpace;
     unsigned int size;
     unsigned int width;
     unsigned int height;
@@ -60,7 +61,7 @@
     unsigned int i, bsize;
     char buf[640];
     int fd_screencap;
-    int w, h, f;
+    int w, h, f, c;
     int fds[2];
     pid_t pid;
 
@@ -82,12 +83,14 @@
     adb_close(fds[1]);
     fd_screencap = fds[0];
 
-    /* read w, h & format */
+    /* read w, h, format & color space */
     if(!ReadFdExactly(fd_screencap, &w, 4)) goto done;
     if(!ReadFdExactly(fd_screencap, &h, 4)) goto done;
     if(!ReadFdExactly(fd_screencap, &f, 4)) goto done;
+    if(!ReadFdExactly(fd_screencap, &c, 4)) goto done;
 
     fbinfo.version = DDMS_RAWIMAGE_VERSION;
+    fbinfo.colorSpace = c;
     /* see hardware/hardware.h */
     switch (f) {
         case 1: /* RGBA_8888 */
diff --git a/transport_local.cpp b/transport_local.cpp
index 6cedd92..9cd378c 100644
--- a/transport_local.cpp
+++ b/transport_local.cpp
@@ -288,7 +288,7 @@
 #define open    adb_open
 #define read    adb_read
 #define write   adb_write
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 #undef open
 #undef read
 #undef write