diff --git a/Android.mk b/Android.mk index 1f97ed0..670ba0c 100644 --- a/Android.mk +++ b/Android.mk @@ -40,7 +40,16 @@ LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) -BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_LDPI_RECOVERY BOARD_MDPI_RECOVERY BOARD_HDPI_RECOVERY BOARD_XHDPI_RECOVERY BOARD_UMS_LUNFILE BOARD_RECOVERY_ALWAYS_WIPES BOARD_RECOVERY_HANDLES_MOUNT BOARD_USE_CUSTOM_FONT +ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),) + BOARD_RECOVERY_CHAR_WIDTH := $(shell echo $(BOARD_USE_CUSTOM_RECOVERY_FONT) | cut -d _ -f 2 | cut -d . -f 1 | cut -d x -f 1) + BOARD_RECOVERY_CHAR_HEIGHT := $(shell echo $(BOARD_USE_CUSTOM_RECOVERY_FONT) | cut -d _ -f 2 | cut -d . -f 1 | cut -d x -f 2) +else + BOARD_RECOVERY_CHAR_WIDTH := 10 + BOARD_RECOVERY_CHAR_HEIGHT := 18 +endif +LOCAL_CFLAGS += -DBOARD_RECOVERY_CHAR_WIDTH=$(BOARD_RECOVERY_CHAR_WIDTH) -DBOARD_RECOVERY_CHAR_HEIGHT=$(BOARD_RECOVERY_CHAR_HEIGHT) + +BOARD_RECOVERY_DEFINES := BOARD_HAS_NO_SELECT_BUTTON BOARD_HAS_SMALL_RECOVERY BOARD_UMS_LUNFILE BOARD_RECOVERY_ALWAYS_WIPES BOARD_RECOVERY_HANDLES_MOUNT $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ $(if $($(board_define)), \ diff --git a/minui/Android.mk b/minui/Android.mk index 68cbe29..4d8ae62 100644 --- a/minui/Android.mk +++ b/minui/Android.mk @@ -21,20 +21,8 @@ ifeq ($(TARGET_RECOVERY_PIXEL_FORMAT),"BGRA_8888") LOCAL_CFLAGS += -DRECOVERY_BGRA endif -ifeq ($(BOARD_XHDPI_RECOVERY),true) - LOCAL_CFLAGS += -DBOARD_XHDPI_RECOVERY -endif -ifeq ($(BOARD_HDPI_RECOVERY),true) - LOCAL_CFLAGS += -DBOARD_HDPI_RECOVERY -endif -ifeq ($(BOARD_MDPI_RECOVERY),true) - LOCAL_CFLAGS += -DBOARD_MDPI_RECOVERY -endif -ifeq ($(BOARD_LDPI_RECOVERY),true) - LOCAL_CFLAGS += -DBOARD_LDPI_RECOVERY -endif -ifeq ($(BOARD_USE_CUSTOM_FONT),true) - LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_FONT +ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),) + LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT) endif include $(BUILD_STATIC_LIBRARY) diff --git a/minui/events.c b/minui/events.c index 2918afa..a619df6 100644 --- a/minui/events.c +++ b/minui/events.c @@ -23,6 +23,7 @@ #include #include "minui.h" +#include "cutils/log.h" #define MAX_DEVICES 16 #define MAX_MISC_FDS 16 @@ -69,7 +70,7 @@ int ev_init(ev_callback input_cb, void *data) /* TODO: add ability to specify event masks. For now, just assume * that only EV_KEY and EV_REL event types are ever needed. */ - if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_REL, ev_bits)) { + if (!test_bit(EV_KEY, ev_bits) && !test_bit(EV_REL, ev_bits) && !test_bit(EV_ABS, ev_bits)) { close(fd); continue; } diff --git a/minui/graphics.c b/minui/graphics.c index d3473db..3183cd1 100644 --- a/minui/graphics.c +++ b/minui/graphics.c @@ -30,26 +30,10 @@ #include -#if defined(BOARD_XHDPI_RECOVERY) - #ifdef BOARD_USE_CUSTOM_FONT - #include "roboto_15x24.h" - #else - #include "font_10x18.h" // only use the big font if we want custom - #endif -#elif defined(BOARD_HDPI_RECOVERY) - #ifdef BOARD_USE_CUSTOM_FONT - #include "roboto_10x18.h" - #else - #include "font_10x18.h" - #endif -#elif defined(BOARD_LDPI_RECOVERY) - #include "font_7x16.h" +#ifdef BOARD_USE_CUSTOM_RECOVERY_FONT +#include BOARD_USE_CUSTOM_RECOVERY_FONT #else - #ifdef BOARD_USE_CUSTOM_FONT - #include "roboto_10x18.h" - #else - #include "font_10x18.h" - #endif +#include "font_10x18.h" #endif #include "minui.h" diff --git a/ui.c b/ui.c index c048948..6db4ef7 100644 --- a/ui.c +++ b/ui.c @@ -47,24 +47,8 @@ static int gShowBackButton = 0; #define MENU_MAX_COLS 64 #define MENU_MAX_ROWS 250 -#if defined(BOARD_XHDPI_RECOVERY) - #ifdef BOARD_USE_CUSTOM_FONT // only use big font if we want custom - #define CHAR_WIDTH 15 - #define CHAR_HEIGHT 24 - #else - #define CHAR_WIDTH 10 - #define CHAR_HEIGHT 18 - #endif -#elif defined(BOARD_HDPI_RECOVERY) - #define CHAR_WIDTH 10 - #define CHAR_HEIGHT 18 -#elif defined(BOARD_LDPI_RECOVERY) - #define CHAR_WIDTH 7 - #define CHAR_HEIGHT 16 -#else - #define CHAR_WIDTH 10 - #define CHAR_HEIGHT 18 -#endif +#define CHAR_WIDTH BOARD_RECOVERY_CHAR_WIDTH +#define CHAR_HEIGHT BOARD_RECOVERY_CHAR_HEIGHT #define UI_WAIT_KEY_TIMEOUT_SEC 3600