Profile Configuration.
[profile/tv/apps/native/screen-reader.git] / src / screen_reader_system.c
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Flora License, Version 1.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #define _GNU_SOURCE
18
19
20 #ifdef SCREEN_READER_MOBILE
21
22
23 #include <device/battery.h>
24 #include <device/display.h>
25 #include <device/callback.h>
26 #include <bluetooth.h>
27 #include <tapi_common.h>
28 #include <TelNetwork.h>
29 #include <vconf.h>
30 #include <wifi.h>
31 #include <notification.h>
32 #include <notification_list.h>
33
34 #include "screen_reader.h"
35 #include "screen_reader_tts.h"
36 #include "smart_notification.h"
37 #include "logger.h"
38
39 #define MAX_SIM_COUNT 2
40 #define DATE_TIME_BUFFER_SIZE 26
41
42 TapiHandle *tapi_handle[MAX_SIM_COUNT + 1] = {0, };
43
44 static void device_system_cb(device_callback_e type, void *value, void *user_data);
45
46
47 static void tapi_init(void)
48 {
49    int i = 0;
50    char **cp_list = tel_get_cp_name_list();
51
52    if (!cp_list)
53       {
54          ERROR("cp name list is null");
55          return;
56       }
57
58    DEBUG("TAPI INIT");
59    for(i = 0; cp_list[i]; ++i)
60       {
61          tapi_handle[i] = tel_init(cp_list[i]);
62          DEBUG("CP_LIST %d = %s", i, cp_list[i]);
63       }
64
65 }
66
67 /**
68  * @brief Initializer for smart notifications
69  *
70  */
71 void system_notifications_init(void)
72 {
73    DEBUG("******************** START ********************");
74    int ret = -1;
75
76    // BATTERY LOW/FULL
77    device_add_callback(DEVICE_CALLBACK_BATTERY_LEVEL, device_system_cb, NULL);
78    // BATTERY CHARGING/NOT-CHARGING
79    device_add_callback(DEVICE_CALLBACK_BATTERY_CHARGING, device_system_cb, NULL);
80    // SCREEN OFF/ON
81    device_add_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_system_cb, NULL);
82
83    ret = bt_initialize();
84    if (ret != BT_ERROR_NONE)
85       {
86          ERROR("ret == %d", ret);
87       }
88
89    ret =  wifi_initialize();
90    if (ret != WIFI_ERROR_NONE)
91       {
92          ERROR("ret == %d", ret);
93       }
94
95
96    tapi_init();
97
98    DEBUG(" ********************* END ********************* ");
99 }
100
101 /**
102  * @brief Initializer for smart notifications
103  *
104  */
105 void system_notifications_shutdown(void)
106 {
107    int ret = -1;
108
109    // BATTERY LOW/FULL
110    device_remove_callback(DEVICE_CALLBACK_BATTERY_LEVEL, device_system_cb);
111    // BATTERY CHARGING/NOT-CHARGING
112    device_remove_callback(DEVICE_CALLBACK_BATTERY_CHARGING, device_system_cb);
113    // SCREEN OFF/ON
114    device_remove_callback(DEVICE_CALLBACK_DISPLAY_STATE, device_system_cb);
115
116    ret = bt_deinitialize();
117    if (ret != BT_ERROR_NONE)
118       {
119          ERROR("ret == %d", ret);
120       }
121
122    ret = wifi_deinitialize();
123    if (ret != WIFI_ERROR_NONE)
124       {
125          ERROR("ret == %d", ret);
126          return;
127       }
128 }
129
130 /**
131  * @brief Device system callback handler
132  *
133  * @param type Device callback type
134  * @param value UNUSED
135  * @param user_data UNUSED
136  */
137 static void device_system_cb(device_callback_e type, void *value, void *user_data)
138 {
139    if(type == DEVICE_CALLBACK_BATTERY_LEVEL)
140       {
141          device_battery_level_e status;
142          if(device_battery_get_level_status(&status))
143             {
144                ERROR("Cannot get battery level status");
145                return;
146             }
147
148          if(status == DEVICE_BATTERY_LEVEL_LOW)
149             {
150                tts_speak(_("IDS_SYSTEM_BATTERY_LOW"), EINA_TRUE);
151             }
152          else if(status == DEVICE_BATTERY_LEVEL_CRITICAL)
153             {
154                tts_speak(_("IDS_SYSTEM_BATTERY_CRITICAL"), EINA_TRUE);
155             }
156          else if(status == DEVICE_BATTERY_LEVEL_FULL)
157             {
158                tts_speak(_("IDS_SYSTEM_BATTERY_FULL"), EINA_TRUE);
159             }
160       }
161    else if(type == DEVICE_CALLBACK_BATTERY_CHARGING)
162       {
163          bool charging;
164          if(device_battery_is_charging(&charging))
165             {
166                ERROR("Cannot check if battery is charging");
167                return;
168             }
169
170          if(charging)
171             {
172                tts_speak(_("IDS_SYSTEM_CHARGING"), EINA_FALSE);
173             }
174          else
175             {
176                tts_speak(_("IDS_SYSTEM_NOT_CHARGING"), EINA_FALSE);
177             }
178       }
179    else if(type == DEVICE_CALLBACK_DISPLAY_STATE)
180       {
181          display_state_e state;
182          if(device_display_get_state(&state))
183             {
184                ERROR("Cannot check if battery is charging");
185                return;
186             }
187
188          if(state == DISPLAY_STATE_NORMAL)
189             {
190                tts_speak(_("IDS_SYSTEM_SCREEN_ON"), EINA_FALSE);
191             }
192          else if(state == DISPLAY_STATE_SCREEN_OFF)
193             {
194                tts_speak(_("IDS_SYSTEM_SCREEN_OFF"), EINA_FALSE);
195             }
196       }
197 }
198
199 // ******************************** Indicator info ********************************** //
200
201 static int _read_text_get(char *key)
202 {
203    int read_text = 0;
204    int ret = -1;
205
206    ret = vconf_get_bool(key, &read_text);
207    if (ret != 0)
208       {
209          ERROR("ret == %d", ret);
210          return true;
211       }
212
213    return read_text;
214 }
215
216
217 void device_time_get(void)
218 {
219    char buffer[DATE_TIME_BUFFER_SIZE];
220    int disp_12_24 = VCONFKEY_TIME_FORMAT_12;
221    int ret = -1;
222    time_t rawtime = 0;
223    struct tm *timeinfo = NULL;
224
225    if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_TIME))
226       {
227          return;
228       }
229
230    time(&rawtime );
231    timeinfo = localtime ( &rawtime );
232    if (!timeinfo)
233       {
234          ERROR("localtime returns NULL");
235          return;
236       }
237
238    ret = vconf_get_int(VCONFKEY_REGIONFORMAT_TIME1224, &disp_12_24);
239    if (ret != 0)
240       {
241          ERROR("ret == %d", ret);
242       }
243
244    if (disp_12_24 == VCONFKEY_TIME_FORMAT_24)
245       {
246          strftime(buffer, DATE_TIME_BUFFER_SIZE, "Current time: %H %M",
247                   timeinfo);
248       }
249    else
250       {
251          strftime(buffer, DATE_TIME_BUFFER_SIZE, "Current time: %I %M %p",
252                   timeinfo);
253       }
254
255    DEBUG("Text to say: %s", buffer);
256    tts_speak(buffer, EINA_FALSE);
257 }
258
259
260 char *device_error_to_string(int e)
261 {
262    switch(e)
263       {
264       case DEVICE_ERROR_NONE:
265          return "DEVICE_ERROR_NONE";
266          break;
267
268       case DEVICE_ERROR_OPERATION_FAILED:
269          return "DEVICE_ERROR_OPERATION_FAILED";
270          break;
271
272       case DEVICE_ERROR_PERMISSION_DENIED:
273          return "DEVICE_ERROR_PERMISSION_DENIED";
274          break;
275
276       case DEVICE_ERROR_INVALID_PARAMETER:
277          return "DEVICE_ERROR_INVALID_PARAMETER";
278          break;
279
280       case DEVICE_ERROR_ALREADY_IN_PROGRESS:
281          return "DEVICE_ERROR_ALREADY_IN_PROGRESS";
282          break;
283
284       case DEVICE_ERROR_NOT_SUPPORTED:
285          return "DEVICE_ERROR_NOT_SUPPORTED";
286          break;
287
288       case DEVICE_ERROR_RESOURCE_BUSY:
289          return "DEVICE_ERROR_RESOURCE_BUSY";
290          break;
291
292       case DEVICE_ERROR_NOT_INITIALIZED:
293          return "DEVICE_ERROR_NOT_INITIALIZED";
294          break;
295
296       default:
297          return _("IDS_SYSTEM_NETWORK_SERVICE_UNKNOWN");
298          break;
299       }
300 }
301
302 void device_battery_get(void)
303 {
304    char *buffer = NULL;
305    char *charging_text = NULL;
306    int percent;
307    bool is_charging = false;
308    int ret = -1;
309
310    if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_BATTERY))
311       {
312          return;
313       }
314
315    ret = device_battery_is_charging(&is_charging);
316    if (ret != DEVICE_ERROR_NONE)
317       {
318          ERROR("ret == %s", device_error_to_string(ret));
319       }
320
321    if (is_charging)
322       {
323          charging_text = _("IDS_SYSTEM_BATTERY_INFO_CHARGING");
324       }
325    else
326       {
327          charging_text = "";
328       }
329
330    ret = device_battery_get_percent(&percent);
331    if (ret != DEVICE_ERROR_NONE)
332       {
333          ERROR("ret == %s", device_error_to_string(ret));
334          return;
335       }
336
337    if(percent == 100)
338       {
339          if (!asprintf(&buffer, "%s %s", charging_text, _("IDS_SYSTEM_BATTERY_FULLY_CHARGED_STR")))
340             {
341                ERROR("Buffer length == 0");
342                return;
343             }
344       }
345    else
346       {
347          if (!asprintf(&buffer, "%s %d %% %s", charging_text, percent, _("IDS_SYSTEM_BATTERY_INFO_BATTERY_STR")))
348             {
349                ERROR("Buffer length == 0");
350                return;
351             }
352
353       }
354
355    if (!buffer)
356       {
357          ERROR("buf == NULL");
358          return;
359       }
360
361    DEBUG("Text to say: %s", buffer);
362    tts_speak(buffer, EINA_FALSE);
363    free(buffer);
364 }
365
366
367 static void _signal_strength_sim_get(void)
368 {
369    int i = 0;
370    int val = 0;
371    int ret = -1;
372    int sim_card_count = 0;
373    Eina_Strbuf *str_buf = NULL;
374    char *buffer = NULL;
375    int service_type = TAPI_NETWORK_SERVICE_TYPE_UNKNOWN;
376    char *service_type_text = NULL;
377
378    str_buf = eina_strbuf_new();
379
380    for (i = 0; tapi_handle[i]; ++i)
381       {
382          ++sim_card_count;
383       }
384
385    for (i = 0; tapi_handle[i]; ++i)
386       {
387          ret = tel_get_property_int(tapi_handle[i], TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL, &val);
388          if (ret != TAPI_API_SUCCESS)
389             {
390                ERROR("Can not get %s",TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL);
391                val = 0;
392             }
393
394          if (sim_card_count > 1)
395             eina_strbuf_append_printf(str_buf, "%s %d %s %d; ", _("IDS_SYSTEM_SIGNAL_SIMCARD"), i + 1, _("IDS_SYSTEM_SIGNAL_STRENGTH"), val);
396          else
397             eina_strbuf_append_printf(str_buf, "%s %d; ", _("IDS_SYSTEM_SIGNAL_STRENGTH"), val);
398          DEBUG("sim: %d TAPI_PROP_NETWORK_SIGNALSTRENGTH_LEVEL %d", i, val);
399
400
401          ret = tel_get_property_int(tapi_handle[i], TAPI_PROP_NETWORK_SERVICE_TYPE, &service_type);
402          if (ret != TAPI_API_SUCCESS)
403             {
404                ERROR("Can not get %s",TAPI_PROP_NETWORK_SERVICE_TYPE);
405             }
406
407          switch(service_type)
408             {
409             case TAPI_NETWORK_SERVICE_TYPE_UNKNOWN:
410                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_UNKNOWN");
411                break;
412
413             case TAPI_NETWORK_SERVICE_TYPE_NO_SERVICE:
414                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_NO_SERVICE");
415                break;
416
417             case TAPI_NETWORK_SERVICE_TYPE_EMERGENCY:
418                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_EMERGENCY");
419                break;
420
421             case TAPI_NETWORK_SERVICE_TYPE_SEARCH:
422                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_SEARCHING");
423                break;
424
425             case TAPI_NETWORK_SERVICE_TYPE_2G:
426                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_2G");
427                break;
428
429             case TAPI_NETWORK_SERVICE_TYPE_2_5G:
430                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_25G");
431                break;
432
433             case TAPI_NETWORK_SERVICE_TYPE_2_5G_EDGE:
434                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_EDGE");
435                break;
436
437             case TAPI_NETWORK_SERVICE_TYPE_3G:
438                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_3G");
439                break;
440
441             case TAPI_NETWORK_SERVICE_TYPE_HSDPA:
442                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_HSDPA");
443                break;
444
445             case TAPI_NETWORK_SERVICE_TYPE_LTE:
446                service_type_text = _("IDS_SYSTEM_NETWORK_SERVICE_LTE");
447                break;
448             }
449
450          eina_strbuf_append_printf(str_buf, " Service type: %s.", service_type_text);
451       }
452
453    buffer = eina_strbuf_string_steal(str_buf);
454
455    DEBUG("Text to say: %s", buffer);
456    tts_speak(buffer, EINA_FALSE);
457
458    eina_strbuf_string_free(str_buf);
459    free(buffer);
460 }
461
462 static void _signal_strength_wifi_get(void)
463 {
464    int val = 0;
465    int ret = -1;
466    char *buffer = NULL;
467    char *wifi_text = NULL;
468    bool wifi_activated = false;
469    wifi_ap_h ap = NULL;
470
471    ret = wifi_is_activated(&wifi_activated);
472    if(ret != WIFI_ERROR_NONE)
473       {
474          ERROR("ret == %d", ret);
475          return;
476       }
477
478    if(wifi_activated)
479       {
480          ret = wifi_get_connected_ap(&ap);
481          if(ret != WIFI_ERROR_NONE)
482             {
483                ERROR("ret == %d", ret);
484                return;
485             }
486
487          if(!ap)
488             {
489                DEBUG("Text to say: %s %s",_("IDS_SYSTEM_NETWORK_TYPE_WIFI"), "Not connected");
490
491                if (!asprintf(&buffer, " %s, %s", _("IDS_SYSTEM_NETWORK_TYPE_WIFI"), "Not connected"))
492                   {
493                      ERROR("buffer length == 0");
494                      return;
495                   }
496
497                tts_speak(buffer, EINA_FALSE);
498                free(buffer);
499                return;
500             }
501
502          ret = wifi_ap_get_rssi(ap, &val);
503          if(ret != WIFI_ERROR_NONE)
504             {
505                ERROR("ret == %d", ret);
506                wifi_ap_destroy(ap);
507                return;
508             }
509
510          switch(val)
511             {
512             case 0:
513                wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_NO_SIGNAL");
514                break;
515
516             case 1:
517                wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_POOR");
518                break;
519
520             case 2:
521                wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_WEAK");
522                break;
523
524             case 3:
525                wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_MEDIUM");
526                break;
527
528             case 4:
529                wifi_text = _("IDS_SYSTEM_WIFI_SIGNAL_GOOD");
530                break;
531             }
532
533          if (!asprintf(&buffer, " %s, %s", _("IDS_SYSTEM_NETWORK_TYPE_WIFI"), wifi_text))
534             {
535                ERROR("buffer length == 0");
536                wifi_ap_destroy(ap);
537                return;
538             }
539
540          DEBUG("Text to say: %s", buffer);
541          tts_speak(buffer, EINA_FALSE);
542          free(buffer);
543          wifi_ap_destroy(ap);
544       }
545 }
546
547 void device_signal_strenght_get(void)
548 {
549    if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_SIGNAL_STRENGHT))
550       {
551          return;
552       }
553    _signal_strength_sim_get();
554    _signal_strength_wifi_get();
555 }
556
557 void device_missed_events_get(void)
558 {
559    notification_list_h list = NULL;
560    notification_list_h elem = NULL;
561    notification_h      noti = NULL;
562    int ret = -1;
563    char *noti_count_text = NULL;
564    int noti_count = 0;
565    int current_noti_count = 0;
566    char *buffer = NULL;
567
568    if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_MISSED_EVENTS))
569       {
570          return;
571       }
572
573    ret = notification_get_list(NOTIFICATION_TYPE_NONE, -1, &list);
574    if (ret != NOTIFICATION_ERROR_NONE)
575       {
576          ERROR("ret == %d", ret);
577          return;
578       }
579
580    elem = notification_list_get_head(list);
581
582    while(elem)
583       {
584          noti = notification_list_get_data(elem);
585          notification_get_text(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, &noti_count_text);
586
587
588          if(noti_count_text)
589             {
590                current_noti_count = atoi(noti_count_text);
591                if(current_noti_count > 0)
592                   {
593                      noti_count += current_noti_count;
594                   }
595                else
596                   {
597                      noti_count++;
598                   }
599             }
600          else
601             {
602                noti_count++;
603             }
604
605          elem = notification_list_get_next(elem);
606       }
607
608    if(noti_count == 0)
609       {
610          DEBUG(_("IDS_SYSTEM_NOTIFICATIONS_UNREAD_0"));
611          tts_speak(_("IDS_SYSTEM_NOTIFICATIONS_UNREAD_0"), EINA_FALSE);
612       }
613    else if(noti_count == 1)
614       {
615          DEBUG(_("IDS_SYSTEM_NOTIFICATIONS_UNREAD_1"));
616          tts_speak(_("IDS_SYSTEM_NOTIFICATIONS_UNREAD_1"), EINA_FALSE);
617       }
618    else
619       {
620          DEBUG("%d %s", noti_count, _("IDS_SYSTEM_NOTIFICATIONS_UNREAD_MANY"));
621
622          if (asprintf(&buffer, "%d %s", noti_count, _("IDS_SYSTEM_NOTIFICATIONS_UNREAD_MANY")))
623             {
624                ERROR("buffer length equals 0");
625             }
626
627          tts_speak(buffer, EINA_FALSE);
628          free(buffer);
629       }
630
631    ret = notification_free_list(list);
632    if(ret != NOTIFICATION_ERROR_NONE)
633    {
634            ERROR("ret == %d", ret);
635    }
636 }
637
638 void device_date_get(void)
639 {
640    char buffer[DATE_TIME_BUFFER_SIZE];
641    int date_format = SETTING_DATE_FORMAT_DD_MM_YYYY;
642    int ret = -1;
643    time_t rawtime = 0;
644    struct tm *timeinfo = NULL;
645
646    if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_DATE))
647       {
648          return;
649       }
650
651    time(&rawtime );
652    timeinfo = localtime ( &rawtime );
653    if (!timeinfo)
654       {
655          ERROR("localtime returns NULL");
656          return;
657       }
658
659    strftime(buffer, DATE_TIME_BUFFER_SIZE, "%Y:%m:%d %H:%M:%S", timeinfo);
660
661    ret = vconf_get_int(VCONFKEY_SETAPPL_DATE_FORMAT_INT, &date_format);
662    if (ret != 0)
663       {
664          ERROR("ret == %d", ret);
665       }
666
667    switch(date_format)
668       {
669       case SETTING_DATE_FORMAT_DD_MM_YYYY:
670          strftime(buffer, DATE_TIME_BUFFER_SIZE, "%d %B %Y", timeinfo);
671          break;
672
673       case SETTING_DATE_FORMAT_MM_DD_YYYY:
674          strftime(buffer, DATE_TIME_BUFFER_SIZE, "%B %d %Y", timeinfo);
675          break;
676
677       case SETTING_DATE_FORMAT_YYYY_MM_DD:
678          strftime(buffer, DATE_TIME_BUFFER_SIZE, "%Y %B %d", timeinfo);
679          break;
680
681       case SETTING_DATE_FORMAT_YYYY_DD_MM:
682          strftime(buffer, DATE_TIME_BUFFER_SIZE, "%Y %d %B", timeinfo);
683          break;
684       }
685
686    DEBUG("Text to say: %s", buffer);
687    tts_speak(buffer, EINA_FALSE);
688 }
689
690 static bool bonded_device_count_cb(bt_device_info_s *device_info, void *user_data)
691 {
692    int *device_count = (int *)user_data;
693
694    (*device_count)++;
695
696    return true;
697 }
698
699 static bool bonded_device_get_cb(bt_device_info_s *device_info, void *user_data)
700 {
701    char **device_name = (char **)user_data;
702
703    if(asprintf(device_name, "%s connected", device_info->remote_name))
704       {
705          ERROR("buffer length == 0");
706       }
707
708    return false;
709 }
710
711 void device_bluetooth_get(void)
712 {
713    char *buffer = NULL;
714    int device_count = 0;
715
716    if (!_read_text_get(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS_INDICATOR_INFORMATION_BLUETOOTH))
717       {
718          return;
719       }
720
721    bt_adapter_state_e adapter_state = BT_ADAPTER_DISABLED;
722    int ret = bt_adapter_get_state(&adapter_state);
723    if (ret != BT_ERROR_NONE)
724       {
725          ERROR("ret == %d", ret);
726          return;
727       }
728
729    if (adapter_state == BT_ADAPTER_DISABLED)
730       {
731          DEBUG("Text to say: %s", _("IDS_SYSTEM_BT_BLUETOOTH_OFF"));
732          tts_speak(_("IDS_SYSTEM_BT_BLUETOOTH_OFF"), EINA_FALSE);
733          return;
734       }
735    else
736       {
737          bt_adapter_foreach_bonded_device(bonded_device_count_cb, (void *)&device_count);
738
739          if(device_count == 0)
740             {
741                if (!asprintf(&buffer, _("IDS_SYSTEM_BT_NO_DEVICES_CONNECTED")))
742                   {
743                      ERROR("buffer length == 0");
744                   }
745             }
746          else if(device_count == 1)
747             {
748                bt_adapter_foreach_bonded_device(bonded_device_get_cb, &buffer);
749             }
750          else
751             {
752                if (asprintf(&buffer, "%d %s", device_count,
753                             _("IDS_SYSTEM_BT_DEVICES_CONNECTED_COUNT")))
754                   {
755                      ERROR("buffer length == 0");
756                   }
757             }
758
759          DEBUG("Text to say: %s", buffer);
760          tts_speak(buffer, EINA_FALSE);
761          free(buffer);
762       }
763 }
764
765 #endif