Implement behavior of new APIs
[platform/core/uifw/tts.git] / server / ttse.c
index a04fc84..e9b8c36 100755 (executable)
@@ -248,8 +248,17 @@ int ttse_get_activated_mode(int* activated_mode)
                return TTSE_ERROR_INVALID_PARAMETER;
        }
 
-       // TODO: Implement function
-       return TTSE_ERROR_NONE;
+       if (g_is_terminated) {
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Service engine is terminated.");
+               return TTSE_ERROR_INVALID_STATE;
+       }
+
+       int ret = ttsd_get_activated_mode(activated_mode);
+       if (TTSD_ERROR_NONE != ret) {
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to get activated mode. ret(%d/%s)", ret, get_error_message(ret));
+       }
+
+       return ret;
 }
 
 int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback)
@@ -259,6 +268,15 @@ int ttse_set_activated_mode_changed_cb(ttse_activated_mode_changed_cb callback)
                return TTSE_ERROR_INVALID_PARAMETER;
        }
 
-       // TODO: Implement function
-       return TTSE_ERROR_NONE;
+       if (g_is_terminated) {
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Service engine is terminated.");
+               return TTSE_ERROR_INVALID_STATE;
+       }
+
+       int ret = ttsd_set_activated_mode_changed_cb(callback);
+       if (TTSD_ERROR_NONE != ret) {
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to set activated mode changed cb. ret(%d/%s)", ret, get_error_message(ret));
+       }
+
+       return ret;
 }