input: add enum type DEVICE_INPUT_TYPE_ALL handling 73/286973/1
authorYunhee Seo <yuni.seo@samsung.com>
Tue, 17 Jan 2023 06:50:17 +0000 (15:50 +0900)
committeryunhee seo <yuni.seo@samsung.com>
Wed, 18 Jan 2023 02:03:11 +0000 (02:03 +0000)
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 <yuni.seo@samsung.com>
(cherry picked from commit 06effe44cadedac12d0ad77a57311a7a8615f911)

src/input-internal.c

index fb15c83..059ed4e 100644 (file)
@@ -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;
        }