Support various MIME type to caller
[platform/core/uifw/inputdelegator.git] / src / w-input-selector.cpp
index ed22ea2..e22274d 100755 (executable)
@@ -1113,10 +1113,31 @@ void _app_service(app_control_h service, void* user_data)
        char **input_type_array = NULL;
        int input_type_array_len = -1;
        bool is_extra_data_array = false;
+       char *mime_type = NULL;
 
        app_control_clone(&(app_data->source_app_control), service);
        app_data->reply_type = REPLY_APP_NORMAL;
 
+       ret = app_control_get_mime(service, &mime_type);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               LOGD("Fail to get mime type : %d", ret);
+       } else {
+               if (mime_type) {
+                       LOGD("mime type = %s", mime_type);
+                       if (!strncmp(mime_type, "image/", strlen("image/"))) {
+
+                       } else if(!strncmp(mime_type, "audio/", strlen("audio/"))) {
+                               app_data->app_type = APP_TYPE_STT;
+                               _stt_clicked_cb((void *)app_data, NULL, NULL);
+                               if (mime_type)
+                                       free(mime_type);
+                               goto ACTIVATE;
+                       }
+               }
+       }
+       if (mime_type)
+               free(mime_type);
+
        if (_TV || _MOBILE) {
                app_data->app_type = APP_TYPE_KEYBOARD;
                input_keyboard_init(service);