static bool g_voicetyping_mode = false;
+extern bool g_support_voicetyping;
+
extern sclu32 _context_layout;
extern sclu32 _context_layout_variation;
if (_context_layout == ISE_LAYOUT_STYLE_EMAIL ||
_context_layout == ISE_LAYOUT_STYLE_PASSWORD) {
#ifdef SUPPORT_VOICETYPING
- LOGD("voicetyping mode");
- g_voicetyping_mode = true;
+ if (g_support_voicetyping) {
+ LOGD("voicetyping mode");
+ g_voicetyping_mode = true;
- ret = VoiceTyping::getInstance()->set_locale("ko-KR");
- if (ret != SAMSUNG_AI_VOICETYPING_ERROR_NONE) {
- LOGE("Failed to set locale (%d)", ret);
- }
+ ret = VoiceTyping::getInstance()->set_locale("ko-KR");
+ if (ret != SAMSUNG_AI_VOICETYPING_ERROR_NONE) {
+ LOGE("Failed to set locale (%d)", ret);
+ }
- VoiceTyping::getInstance()->set_result_cb(vt_result_cb, NULL);
- if (ret != SAMSUNG_AI_VOICETYPING_ERROR_NONE) {
- LOGE("Failed to set result callback (%d)", ret);
- }
+ VoiceTyping::getInstance()->set_result_cb(vt_result_cb, NULL);
+ if (ret != SAMSUNG_AI_VOICETYPING_ERROR_NONE) {
+ LOGE("Failed to set result callback (%d)", ret);
+ }
- VoiceTyping::getInstance()->set_state_changed_cb(vt_state_changed_cb, voicedata);
+ VoiceTyping::getInstance()->set_state_changed_cb(vt_state_changed_cb, voicedata);
- samsung_ai_voicetyping_state_e state = SAMSUNG_AI_VOICETYPING_STATE_NONE;
- VoiceTyping::getInstance()->get_state(&state);
- if (SAMSUNG_AI_VOICETYPING_STATE_READY == state) {
- VoiceTyping::getInstance()->start();
+ samsung_ai_voicetyping_state_e state = SAMSUNG_AI_VOICETYPING_STATE_NONE;
+ VoiceTyping::getInstance()->get_state(&state);
+ if (SAMSUNG_AI_VOICETYPING_STATE_READY == state) {
+ VoiceTyping::getInstance()->start();
+ }
}
+ else
+ g_voicetyping_mode = false;
#else
LOGD("non voice typing mode");
#endif
#endif
int g_imdata_state = 0;
+bool g_support_voicetyping = false;
extern emoticon_group_t current_emoticon_group;
extern std::vector <int> emoticon_list_recent;
}
#ifdef SUPPORT_VOICETYPING
- VoiceTyping::getInstance()->init(vt_connection_status_changed_cb, NULL);
+ if (VoiceTyping::getInstance()->init(vt_connection_status_changed_cb, NULL) == SAMSUNG_AI_VOICETYPING_ERROR_NONE)
+ g_support_voicetyping = true;
#endif
init_recent_used_punctuation();
case SAMSUNG_AI_VOICETYPING_ERROR_NONE:
LOGD("[VT] Succeed to initialize voice typing");
break;
- case SAMSUNG_AI_VOICETYPING_ERROR_PERMISSION_DENIED:
- LOGE("[VT] permission denied");
- break;
case SAMSUNG_AI_VOICETYPING_ERROR_NOT_SUPPORTED:
LOGE("[VT] Not support");
break;
+ case SAMSUNG_AI_VOICETYPING_ERROR_INVALID_PARAMETER:
+ LOGE("[VT] Invalid parameter");
+ break;
+ case SAMSUNG_AI_VOICETYPING_ERROR_PERMISSION_DENIED:
+ LOGE("[VT] Permission denied");
+ break;
+ case SAMSUNG_AI_VOICETYPING_ERROR_SERVICE_UNAVAILABLE:
+ LOGE("[VT] Service unavilable");
+ break;
+ case SAMSUNG_AI_VOICETYPING_ERROR_OUT_OF_MEMORY:
+ LOGE("[VT] Out of memory");
+ break;
+ case SAMSUNG_AI_VOICETYPING_ERROR_OPERATION_FAILED:
+ LOGE("[VT] Operation failed");
+ break;
default:
LOGE("[VT] Failed to initialize voice typing. error: %d", ret);
break;