From: sooyeon.kim Date: Fri, 11 Sep 2020 08:08:31 +0000 (+0900) Subject: Add a checker of screen reader in tts_prepare() X-Git-Tag: submit/tizen/20201005.111827~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f99e7d39fd5a4f411af74f2b04a58f1d7635657f;p=platform%2Fcore%2Fuifw%2Ftts.git Add a checker of screen reader in tts_prepare() Change-Id: I81cec68c66ea2e2daf0b81cce69c583a5d305970 Signed-off-by: sooyeon.kim (cherry picked from commit 727a0aea05ec1a044278cfcc81aa3aac0f2e1e5d) --- diff --git a/client/tts.c b/client/tts.c index f8f18625..f90c4708 100644 --- a/client/tts.c +++ b/client/tts.c @@ -1183,6 +1183,22 @@ static Eina_Bool __send_hello(void *data) return EINA_FALSE; } + /* check screen reader */ + int ret = -1; + if (TTS_MODE_SCREEN_READER == client->mode) { + ret = __tts_recheck_screen_reader(); + if (0 != ret) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get screen reader vconf(%d)", ret); + } else { + if (false == g_screen_reader) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Screen reader option is NOT available. Do not request to prepare"); + client->hello_timer = NULL; + g_prepare_timer = NULL; + return EINA_FALSE; + } + } + } + SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid); bool is_launched = __is_engine_launched(g_engine_appid); @@ -1203,7 +1219,7 @@ static Eina_Bool __send_hello(void *data) } /* Send hello */ - int ret = tts_dbus_request_hello(client->uid); + ret = tts_dbus_request_hello(client->uid); if (0 != ret) { SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to request hello !!"); //LCOV_EXCL_LINE } else { @@ -1258,6 +1274,21 @@ int tts_prepare(tts_h tts) return TTS_ERROR_INVALID_STATE; } + int ret = -1; + if (false == g_screen_reader && TTS_MODE_SCREEN_READER == client->mode) { + /* check screen reader option one more time */ + ret = __tts_recheck_screen_reader(); + if (0 != ret) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get screen reader vconf(%d)", ret); + return TTS_ERROR_INVALID_STATE; + } else { + if (false == g_screen_reader) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Screen reader option is NOT available."); + return TTS_ERROR_INVALID_STATE; + } + } + } + SLOG(LOG_ERROR, TAG_TTSC, "[INFO] tts_h(%p), tts_client(%p), uid(%d)", tts, client, client->uid); if (NULL == client->hello_timer) {