Code drop from //branches/cupcake/...@124589
diff --git a/simulator/wrapsim/Android.mk b/simulator/wrapsim/Android.mk
index 7ac8359..ca9a592 100644
--- a/simulator/wrapsim/Android.mk
+++ b/simulator/wrapsim/Android.mk
@@ -4,6 +4,7 @@
# Build instructions for simulator LD_PRELOAD wrapper.
#
ifneq ($(TARGET_ARCH),arm)
+ifeq ($(TARGET_SIMULATOR),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
@@ -29,10 +30,13 @@
# Relying on other Android libraries is probably a bad idea, since any
# library or system calls they make could lead to recursive behavior.
-#
-#LOCAL_SHARED_LIBRARIES +=
+LOCAL_LDLIBS += -lpthread -ldl
-LOCAL_LDLIBS += -lpthread -ldl -lesd
+ifeq ($(BUILD_SIM_WITHOUT_AUDIO),true)
+LOCAL_CFLAGS += -DBUILD_SIM_WITHOUT_AUDIO=1
+else
+LOCAL_LDLIBS += -lesd
+endif
include $(BUILD_SHARED_LIBRARY)
@@ -49,5 +53,6 @@
LOCAL_MODULE := launch-wrapper
include $(BUILD_EXECUTABLE)
+endif # ifeq ($(TARGET_SIMULATOR),true)
endif
# ifneq ($(TARGET_ARCH),arm)
diff --git a/simulator/wrapsim/DevAudio.c b/simulator/wrapsim/DevAudio.c
index 0f52b81..752ee65 100644
--- a/simulator/wrapsim/DevAudio.c
+++ b/simulator/wrapsim/DevAudio.c
@@ -30,6 +30,9 @@
*/
static int configureInitialState(const char* pathName, AudioState* audioState)
{
+#if BUILD_SIM_WITHOUT_AUDIO
+ return 0;
+#else
esd_player_info_t *pi;
audioState->fd = -1;
audioState->sourceId = -1;
@@ -62,6 +65,7 @@
}
printf("Couldn't open audio device. Faking it.\n");
return 0;
+#endif
}
/*
@@ -71,6 +75,9 @@
*/
static ssize_t writeAudio(FakeDev* dev, int fd, const void* buf, size_t count)
{
+#if BUILD_SIM_WITHOUT_AUDIO
+ return 0;
+#else
AudioState *state = (AudioState*)dev->state;
if (state->fd >= 0)
return _ws_write(state->fd, buf, count);
@@ -78,6 +85,7 @@
// fake timing
usleep(count * 10000 / 441 * 4);
return count;
+#endif
}
/*
@@ -93,11 +101,15 @@
*/
static int closeAudio(FakeDev* dev, int fd)
{
+#if BUILD_SIM_WITHOUT_AUDIO
+ return 0;
+#else
AudioState *state = (AudioState*)dev->state;
close(state->fd);
free(state);
dev->state = NULL;
return 0;
+#endif
}
/*
diff --git a/simulator/wrapsim/DevFb.c b/simulator/wrapsim/DevFb.c
index 42a9d9a..c54403e 100644
--- a/simulator/wrapsim/DevFb.c
+++ b/simulator/wrapsim/DevFb.c
@@ -63,7 +63,7 @@
fbState->vinfo.blue.length = 5;
fbState->vinfo.width = 51; // physical dimension, used for dpi
- fbState->vinfo.height = 38;
+ fbState->vinfo.height = 76;
fbState->vinfo.pixclock = 103092;
fbState->vinfo.upper_margin = 3;