summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2011-09-09 06:38:26 +0400
committerVishal Bhoj <vishal.bhoj@linaro.org>2011-09-09 09:23:26 +0400
commit20f65b810f78dd6a74ddef1aaf8e6cb5c69be9d8 (patch)
tree3cbff480fc838383ae8febb1711a9fdbfc8fa082
parentc73894456df5def97111cb33d2106b684b8b7959 (diff)
downloaduim-android.tar.gz
Aded Android.mk and modified uim.c to build and work on Androidandroid
-rw-r--r--Android.mk18
-rw-r--r--uim.c12
2 files changed, 28 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..f2cc98d
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,18 @@
+#Android makefile for uim
+ifeq ($(TARGET_BOARD_PLATFORM),omap4)
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= uim.c
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/
+
+LOCAL_MODULE_TAGS := eng
+
+LOCAL_MODULE := uim
+
+include $(BUILD_EXECUTABLE)
+
+endif
diff --git a/uim.c b/uim.c
index 3775dda..ba3b3c8 100644
--- a/uim.c
+++ b/uim.c
@@ -458,12 +458,13 @@ bdaddr_t *strtoba(const char *str)
/*****************************************************************************/
int main(int argc, char *argv[])
{
- int st_fd, err;
+ int st_fd, err,trials;
unsigned char install;
struct pollfd p;
UIM_START_FUNC();
err = 0;
+ trials = 5;
/* Parse the user input */
if ((argc > 2)) {
@@ -483,7 +484,14 @@ int main(int argc, char *argv[])
line_discipline = N_TI_WL;
- st_fd = open(INSTALL_SYSFS_ENTRY, O_RDONLY);
+ /* sysfs entry may get populated after service is started so we retry if it fails*/
+ while (trials > 0) {
+ st_fd = open(INSTALL_SYSFS_ENTRY, O_RDONLY);
+ if(st_fd > 0)
+ break;
+ usleep(500000);
+ --trials;
+ }
if (st_fd < 0) {
UIM_DBG("unable to open %s(%s)", INSTALL_SYSFS_ENTRY, strerror(errno));
return -1;