From 06effe44cadedac12d0ad77a57311a7a8615f911 Mon Sep 17 00:00:00 2001 From: Yunhee Seo Date: Tue, 17 Jan 2023 15:50:17 +0900 Subject: [PATCH] input: add enum type DEVICE_INPUT_TYPE_ALL handling To avoid get DEVICE_INPUT_TYPE_ALL from device_input_get_default_device api because this type cannot have default input device also, add checking DEVICE_INPUT_TYPE_ALL to input_is_supported_input_type which was omitted Change-Id: I6b20a76fcde9b67097a3cb5606f71fa747483550 Signed-off-by: Yunhee Seo --- src/input-internal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/input-internal.c b/src/input-internal.c index fb15c83..059ed4e 100644 --- a/src/input-internal.c +++ b/src/input-internal.c @@ -34,6 +34,7 @@ static bool input_is_supported_input_type(device_input_type_e input_device_type) { switch (input_device_type) { case DEVICE_INPUT_TYPE_UNKNOWN: + case DEVICE_INPUT_TYPE_ALL: case DEVICE_INPUT_TYPE_MOUSE: case DEVICE_INPUT_TYPE_KEYBOARD: case DEVICE_INPUT_TYPE_CUSTOM_KNOB: @@ -53,7 +54,7 @@ int device_input_get_default_device(device_input_type_e input_device_type, int * return DEVICE_ERROR_INVALID_PARAMETER; } - if (!input_device_id) { + if (!input_device_id || input_device_type == DEVICE_INPUT_TYPE_ALL) { _E("Invalid parameters"); return DEVICE_ERROR_INVALID_PARAMETER; } -- 2.7.4