Merge "DO NOT MERGE ANYWHERE goldfish: adjust to the refactoring of qemu-pipe"
diff --git a/camera/Android.mk b/camera/Android.mk
index 80a4509..f747063 100644
--- a/camera/Android.mk
+++ b/camera/Android.mk
@@ -36,6 +36,7 @@
 
 emulator_camera_c_includes := external/jpeg \
 	frameworks/native/include/media/hardware \
+	system/core/qemu_pipe/include \
 	$(LOCAL_PATH)/../../goldfish-opengl/system/OpenglSystemCommon \
 	$(call include-path-for, camera)
 
@@ -70,6 +71,10 @@
 LOCAL_CFLAGS := ${emulator_camera_cflags}
 LOCAL_CLANG_CFLAGS += ${emulator_camera_clang_flags}
 
+LOCAL_STATIC_LIBRARIES := \
+    libqemu_pipe \
+    libbase
+
 LOCAL_SHARED_LIBRARIES := ${emulator_camera_shared_libraries}
 LOCAL_C_INCLUDES += ${emulator_camera_c_includes}
 LOCAL_SRC_FILES := ${emulator_camera_src}
@@ -91,6 +96,10 @@
 LOCAL_MODULE_RELATIVE_PATH := ${emulator_camera_module_relative_path}
 LOCAL_CFLAGS := ${emulator_camera_cflags}
 LOCAL_CLANG_CFLAGS += ${emulator_camera_clang_flags}
+LOCAL_STATIC_LIBRARIES := \
+    libqemu_pipe \
+    libbase
+
 
 LOCAL_SHARED_LIBRARIES := ${emulator_camera_shared_libraries}
 LOCAL_C_INCLUDES += ${emulator_camera_c_includes}
diff --git a/camera/QemuClient.cpp b/camera/QemuClient.cpp
index 15c9d00..be19550 100755
--- a/camera/QemuClient.cpp
+++ b/camera/QemuClient.cpp
@@ -34,7 +34,7 @@
 #endif  // LOG_QUERIES
 
 #define QEMU_PIPE_DEBUG  LOGQ
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 
 namespace android {
 
diff --git a/fingerprint/Android.mk b/fingerprint/Android.mk
index f4b76c9..ceb7d30 100644
--- a/fingerprint/Android.mk
+++ b/fingerprint/Android.mk
@@ -20,6 +20,8 @@
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_SRC_FILES := fingerprint.c
 LOCAL_SHARED_LIBRARIES := liblog
+LOCAL_C_INCLUDES := system/core/qemu_pipe
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -27,7 +29,9 @@
 
 LOCAL_MODULE := fingerprint.ranchu
 LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_C_INCLUDES := system/core/qemu_pipe
 LOCAL_SRC_FILES := fingerprint.c
 LOCAL_SHARED_LIBRARIES := liblog
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/fingerprint/fingerprint.c b/fingerprint/fingerprint.c
index 278b431..97aaf98 100644
--- a/fingerprint/fingerprint.c
+++ b/fingerprint/fingerprint.c
@@ -30,7 +30,7 @@
 #include <cutils/log.h>
 #include <hardware/hardware.h>
 #include <hardware/fingerprint.h>
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 
 #include <errno.h>
 #include <endian.h>
diff --git a/gps/Android.mk b/gps/Android.mk
index 0abf1fb..ad13da7 100644
--- a/gps/Android.mk
+++ b/gps/Android.mk
@@ -25,6 +25,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 LOCAL_CFLAGS += -DQEMU_HARDWARE
 LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware
 LOCAL_SRC_FILES := gps_qemu.c
@@ -39,6 +42,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 LOCAL_CFLAGS += -DQEMU_HARDWARE
 LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware
 LOCAL_SRC_FILES := gps_qemu.c
diff --git a/gps/gps_qemu.c b/gps/gps_qemu.c
index 6f077d3..d0a0fc1 100644
--- a/gps/gps_qemu.c
+++ b/gps/gps_qemu.c
@@ -34,7 +34,7 @@
 #include <cutils/log.h>
 #include <cutils/sockets.h>
 #include <hardware/gps.h>
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 
 /* the name of the qemu-controlled pipe */
 #define  QEMU_CHANNEL_NAME  "pipe:qemud:gps"
diff --git a/lights/Android.mk b/lights/Android.mk
index fa783a9..4be3e9c 100644
--- a/lights/Android.mk
+++ b/lights/Android.mk
@@ -18,6 +18,9 @@
 # hw/<LIGHTS_HARDWARE_MODULE_ID>.<ro.hardware>.so
 include $(CLEAR_VARS)
 LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 LOCAL_SHARED_LIBRARIES := liblog libcutils
 LOCAL_SRC_FILES := lights_qemu.c
 LOCAL_MODULE := lights.goldfish
diff --git a/lights/lights_qemu.c b/lights/lights_qemu.c
index 3628588..4bda8cd 100644
--- a/lights/lights_qemu.c
+++ b/lights/lights_qemu.c
@@ -42,7 +42,7 @@
 #include <cutils/log.h>
 
 #define DEBUG_QEMU_PIPE D
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 
 #include <hardware/lights.h>
 #include <errno.h>
diff --git a/power/Android.mk b/power/Android.mk
index 0273f04..0acfb8b 100644
--- a/power/Android.mk
+++ b/power/Android.mk
@@ -23,6 +23,8 @@
 LOCAL_CFLAGS += -DQEMU_HARDWARE
 LOCAL_SHARED_LIBRARIES := liblog libcutils
 LOCAL_SRC_FILES := power_qemu.c
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
 LOCAL_MODULE := power.goldfish
 LOCAL_MODULE_TAGS := optional
 include $(BUILD_SHARED_LIBRARY)
diff --git a/power/power_qemu.c b/power/power_qemu.c
index 86c3ffd..aa531a2 100644
--- a/power/power_qemu.c
+++ b/power/power_qemu.c
@@ -19,7 +19,7 @@
 
 #include <hardware/hardware.h>
 #include <hardware/power.h>
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 #include <fcntl.h>
 #include <errno.h>
 
diff --git a/qemu-props/Android.mk b/qemu-props/Android.mk
index 78ab1d5..5ff3449 100644
--- a/qemu-props/Android.mk
+++ b/qemu-props/Android.mk
@@ -24,5 +24,8 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE    := qemu-props
 LOCAL_SRC_FILES := qemu-props.c
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 LOCAL_SHARED_LIBRARIES := libcutils liblog
 include $(BUILD_EXECUTABLE)
diff --git a/qemu-props/qemu-props.c b/qemu-props/qemu-props.c
index 0b3ea11..c24da2a 100644
--- a/qemu-props/qemu-props.c
+++ b/qemu-props/qemu-props.c
@@ -34,7 +34,7 @@
 #endif
 
 #include <cutils/properties.h>
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 #include <unistd.h>
 
 /* Name of the qemud service we want to connect to.
diff --git a/sensors/Android.mk b/sensors/Android.mk
index 4b935a7..f66f9e9 100644
--- a/sensors/Android.mk
+++ b/sensors/Android.mk
@@ -22,6 +22,9 @@
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_SHARED_LIBRARIES := liblog libcutils
 LOCAL_SRC_FILES := sensors_qemu.c
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 ifeq ($(TARGET_PRODUCT),vbox_x86)
 LOCAL_MODULE := sensors.vbox_x86
 else
@@ -34,6 +37,9 @@
 
 LOCAL_MODULE_RELATIVE_PATH := hw
 LOCAL_SHARED_LIBRARIES := liblog libcutils
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 LOCAL_SRC_FILES := sensors_qemu.c
 LOCAL_MODULE := sensors.ranchu
 
diff --git a/sensors/sensors_qemu.c b/sensors/sensors_qemu.c
index 7175a44..c2e65e2 100644
--- a/sensors/sensors_qemu.c
+++ b/sensors/sensors_qemu.c
@@ -45,7 +45,7 @@
 
 #define  E(...)  ALOGE(__VA_ARGS__)
 
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 
 /** SENSOR IDS AND NAMES
  **/
diff --git a/vibrator/Android.mk b/vibrator/Android.mk
index 7253cbc..8b2ce6f 100644
--- a/vibrator/Android.mk
+++ b/vibrator/Android.mk
@@ -21,6 +21,9 @@
 # HAL module implemenation stored in
 # hw/<VIBRATOR_HARDWARE_MODULE_ID>.goldfish.so
 LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_C_INCLUDES := system/core/qemu_pipe/include
+LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase
+
 LOCAL_SRC_FILES := vibrator_qemu.c
 LOCAL_SHARED_LIBRARIES := liblog libhardware
 LOCAL_MODULE_TAGS := optional
diff --git a/vibrator/vibrator_qemu.c b/vibrator/vibrator_qemu.c
index 59085f7..cf68da1 100644
--- a/vibrator/vibrator_qemu.c
+++ b/vibrator/vibrator_qemu.c
@@ -22,7 +22,7 @@
 #define QEMU_HARDWARE
 #include <hardware/hardware.h>
 #include <hardware/vibrator.h>
-#include <system/qemu_pipe.h>
+#include <qemu_pipe.h>
 
 static int sendit(unsigned int timeout_ms)
 {