Merge "Emulator: start logcat -Q as logd user instead of root"
am: 6fc52b4ef9

Change-Id: I295dbb08f6595a1c4a255c5e20106c449e00b773
diff --git a/camera/Android.mk b/camera/Android.mk
index f747063..80a4509 100644
--- a/camera/Android.mk
+++ b/camera/Android.mk
@@ -36,7 +36,6 @@
 
 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)
 
@@ -71,10 +70,6 @@
 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}
@@ -96,10 +91,6 @@
 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 be19550..15c9d00 100755
--- a/camera/QemuClient.cpp
+++ b/camera/QemuClient.cpp
@@ -34,7 +34,7 @@
 #endif  // LOG_QUERIES
 
 #define QEMU_PIPE_DEBUG  LOGQ
-#include <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 
 namespace android {
 
diff --git a/fingerprint/Android.mk b/fingerprint/Android.mk
index ceb7d30..f4b76c9 100644
--- a/fingerprint/Android.mk
+++ b/fingerprint/Android.mk
@@ -20,8 +20,6 @@
 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)
 
@@ -29,9 +27,7 @@
 
 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 97aaf98..278b431 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 <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 
 #include <errno.h>
 #include <endian.h>
diff --git a/gps/Android.mk b/gps/Android.mk
index ad13da7..0abf1fb 100644
--- a/gps/Android.mk
+++ b/gps/Android.mk
@@ -25,9 +25,6 @@
 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
@@ -42,9 +39,6 @@
 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 d0a0fc1..6f077d3 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 <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 
 /* the name of the qemu-controlled pipe */
 #define  QEMU_CHANNEL_NAME  "pipe:qemud:gps"
diff --git a/input/goldfish_rotary.idc b/input/goldfish_rotary.idc
new file mode 100644
index 0000000..a8434bc
--- /dev/null
+++ b/input/goldfish_rotary.idc
@@ -0,0 +1,8 @@
+# Device configuration for a rotary input device.
+device.type = rotaryEncoder
+
+# Should be (number of ticks in full rotation) / (2 PI).
+# Here, chosen arbirarily to be 360 / (2 PI)
+device.res = 57.295
+
+device.scalingFactor = 0.0138
diff --git a/lights/Android.mk b/lights/Android.mk
index 4be3e9c..fa783a9 100644
--- a/lights/Android.mk
+++ b/lights/Android.mk
@@ -18,9 +18,6 @@
 # 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 4bda8cd..3628588 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 <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 
 #include <hardware/lights.h>
 #include <errno.h>
diff --git a/power/Android.mk b/power/Android.mk
index 0acfb8b..0273f04 100644
--- a/power/Android.mk
+++ b/power/Android.mk
@@ -23,8 +23,6 @@
 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 aa531a2..86c3ffd 100644
--- a/power/power_qemu.c
+++ b/power/power_qemu.c
@@ -19,7 +19,7 @@
 
 #include <hardware/hardware.h>
 #include <hardware/power.h>
-#include <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 #include <fcntl.h>
 #include <errno.h>
 
diff --git a/qemu-props/Android.mk b/qemu-props/Android.mk
index 5ff3449..78ab1d5 100644
--- a/qemu-props/Android.mk
+++ b/qemu-props/Android.mk
@@ -24,8 +24,5 @@
 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 c24da2a..0b3ea11 100644
--- a/qemu-props/qemu-props.c
+++ b/qemu-props/qemu-props.c
@@ -34,7 +34,7 @@
 #endif
 
 #include <cutils/properties.h>
-#include <qemu_pipe.h>
+#include <system/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 f66f9e9..4b935a7 100644
--- a/sensors/Android.mk
+++ b/sensors/Android.mk
@@ -22,9 +22,6 @@
 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
@@ -37,9 +34,6 @@
 
 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 c2e65e2..7175a44 100644
--- a/sensors/sensors_qemu.c
+++ b/sensors/sensors_qemu.c
@@ -45,7 +45,7 @@
 
 #define  E(...)  ALOGE(__VA_ARGS__)
 
-#include <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 
 /** SENSOR IDS AND NAMES
  **/
diff --git a/ueventd.ranchu.rc b/ueventd.ranchu.rc
index 13bc33e..50d6c53 100644
--- a/ueventd.ranchu.rc
+++ b/ueventd.ranchu.rc
@@ -3,3 +3,4 @@
 /dev/goldfish_pipe        0666   system     system
 /dev/ttyS*                0666   system     system
 /proc                     0666   system     system
+/dev/goldfish_sync        0666   system     system
diff --git a/vibrator/Android.mk b/vibrator/Android.mk
index 8b2ce6f..7253cbc 100644
--- a/vibrator/Android.mk
+++ b/vibrator/Android.mk
@@ -21,9 +21,6 @@
 # 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 cf68da1..59085f7 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 <qemu_pipe.h>
+#include <system/qemu_pipe.h>
 
 static int sendit(unsigned int timeout_ms)
 {