minuitwrp: use a whitelist for the input device instead of a hardcoded ignore list

* use a whitelist for the input device to listen on, every other will be ignored

Change-Id: I1296a45ec3d5ca0bca2a9e2601b0710e2c030fde
This commit is contained in:
Flemmard
2014-01-10 09:14:44 +01:00
committed by Ethan Yonker
parent 75b6f66ed8
commit f4674619a2
2 changed files with 12 additions and 0 deletions

View File

@@ -81,6 +81,11 @@ endif
ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
endif
ifneq ($(TW_WHITELIST_INPUT),)
LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT)
endif
LOCAL_SHARED_LIBRARIES += libz libc libcutils libjpeg
LOCAL_STATIC_LIBRARIES += libpng libpixelflinger_static
LOCAL_MODULE_TAGS := eng

View File

@@ -167,11 +167,18 @@ static int vk_init(struct ev *e)
printf("Event object: %s\n", e->deviceName);
#endif
#ifdef WHITELIST_INPUT
if (strcmp(e->deviceName, EXPAND(WHITELIST_INPUT)) != 0)
{
e->ignored = 1;
}
#else
// Blacklist these "input" devices
if (strcmp(e->deviceName, "bma250") == 0 || strcmp(e->deviceName, "bma150") == 0 || strcmp(e->deviceName, "accelerometer") == 0)
{
e->ignored = 1;
}
#endif
strcat(vk_path, e->deviceName);