input: add enum type DEVICE_INPUT_TYPE_ALL handling 42/286942/2
authorYunhee Seo <yuni.seo@samsung.com>
Tue, 17 Jan 2023 06:50:17 +0000 (15:50 +0900)
committeryunhee seo <yuni.seo@samsung.com>
Tue, 17 Jan 2023 06:53:56 +0000 (06:53 +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>
src/input-internal.c

index fb15c83223ba046f676f99240501fbd96c844b1d..059ed4e87a2a32b899206d4c8c0821f1a4cc0f93 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;
        }