platform/core/uifw/tts.git
23 months agoAdd TC for checking prepare 19/284619/3
Suyeon Hwang [Tue, 22 Nov 2022 01:12:38 +0000 (10:12 +0900)]
Add TC for checking prepare

- Contents:
This patch adds new TC for check whether tts_prepare() properly succeed
after tts_unprepare().

Change-Id: I3766898d06f33c18a07c80a201e125de94789325
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
23 months agoAssure that client always registers the callback in sync prepare 94/284594/3
Suyeon Hwang [Mon, 21 Nov 2022 10:37:27 +0000 (19:37 +0900)]
Assure that client always registers the callback in sync prepare

- Issue:
Sometimes, the message receive callback registration is skipped even if
the connection is normal.

- Solution:
The client lib always checks the 'register_callback_invoked' flag, but
this flag may not be set properly some cases even if client tries to
prepare synchronously. Thus, this patch removes the flag checking code
from synchronous prepare logic. The synchronous prepare should insure
the invocation of all protocol, so through this patch, the all step of
preparation will be invoked.

Change-Id: If89f4065f139ec032bedddebf6a9927c74f100e7
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
23 months agoUpdate version (1.70.13) 30/284430/1
Suyeon Hwang [Thu, 17 Nov 2022 01:08:32 +0000 (10:08 +0900)]
Update version (1.70.13)

Change-Id: Ic76ca3b081b7a38de6b3d0912b3cbea1997cfa71
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
23 months agoAdd mutex for set repeat text 75/284375/1
Suyeon Hwang [Wed, 16 Nov 2022 11:11:19 +0000 (20:11 +0900)]
Add mutex for set repeat text

- Issue:
Sometimes, invalid access occurs if app tries to add text in multi
thread enviroment.

- Solution:
App can add text frequently. And also, app can add text in multi thread
enviroment. However, the text_repeat property of client is not safe in
multi thread enviroment. Thus, this patch adds mutex lock for protect
text_repeat from race condition. Through this patch, app can be add text
safely in multi thread.

Change-Id: Iffcce54fcbc34436bf9f4d7ec7aadf571f05889b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove logs making delay of IPC 99/283899/2
Suyeon Hwang [Mon, 7 Nov 2022 04:47:24 +0000 (13:47 +0900)]
Remove logs making delay of IPC

- Issue:
Sometimes, the IPC request from client is delayed.

- Solution:
By the priority of the process, app manager APIs can be delayed. Thus,
this patch removes some logs that needs to invoke app manager APIs.
Through this patch, the IPC requests will be invoked directly without
any delay.

Change-Id: I19feed1a444364da4f54a729b72ab562a5ea2865
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoDelete timer handle for service state changed notification 74/280674/4
Suyeon Hwang [Fri, 2 Sep 2022 05:05:40 +0000 (14:05 +0900)]
Delete timer handle for service state changed notification

- Issue:
The timer handle for service state changed notification is not deleted
if ttsd_finalize() is invoked before that the timer is handled.

- Solution:
This patch makes ttsd_finalize() delete the timer handle. And also, the
memory which stores the state change information should be deleted with
deleting the timer, because the memory is allocated for this timer
behavior.

Change-Id: I7a429c8ab5fb89237ba38c2b1c44c9d606ef01dd
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoSend callback message to clients which set callback 73/280673/4
Suyeon Hwang [Fri, 2 Sep 2022 02:11:14 +0000 (11:11 +0900)]
Send callback message to clients which set callback

- Requirements:
Server wants to send required IPC message when service state is changed.

- Solution:
Through previous commit, callback registration information was added.
Using this new information, server can decide whether the client require
to receive service state changed event. This patch adds checker for
deciding whether client regists callback.

Change-Id: I3ea1cc9e61626f393dc49a9bceff6c4b05a4a77c
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd callback set information into prepare interface 72/280672/4
Suyeon Hwang [Thu, 1 Sep 2022 11:25:30 +0000 (20:25 +0900)]
Add callback set information into prepare interface

- Requirement:
Server wants to information about whether the client set the service
state changed callback.

- Solution:
Service state is frequently changed, so IPC for notification of service
state change is invoked so many times for all client. However, most of
the client did not register the callback, so many resource can be
wasted by this unvaluable invocation. To reduce wasted resources, this
patch adds callback registration information into IPC interface.
Through this new information server can send valid  notification without
waste.

Change-Id: I8a70b694854eefa9c1f2e58726cb6f4c54ba2f65
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoClean up unnecessary header files 21/283721/2
Suyeon Hwang [Wed, 2 Nov 2022 06:59:36 +0000 (15:59 +0900)]
Clean up unnecessary header files

Change-Id: If88d1be2aef5989c2e5859750f9a97e2a273fae5
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoFix static anlysis issues 69/282969/3
Suyeon Hwang [Fri, 14 Oct 2022 02:58:40 +0000 (11:58 +0900)]
Fix static anlysis issues

- Contents:
This patch includes these changes:
  - Remove equality check of floating point values.
  - Remove TOC-TOU problem.
  - Make blocks for code in switch-case statements.
  - Remove arguments from void parameter function.

Change-Id: I119d15f3a600a9cf51e5b9150a69530f782cd04b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoChange sound_server_ready to focus_server_ready 11/283511/1
sooyeon [Fri, 28 Oct 2022 01:44:09 +0000 (10:44 +0900)]
Change sound_server_ready to focus_server_ready

Change-Id: I120f3efc7514c71ee294e8267a6b1c683bc13850
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoMerge changes I439a2879,Iaef6463d into tizen
Jihoon Kim [Tue, 18 Oct 2022 06:39:37 +0000 (06:39 +0000)]
Merge changes I439a2879,Iaef6463d into tizen

* changes:
  Remove trailing whitespaces
  Fix typo issue in tts_setting document

2 years agoRemove trailing whitespaces 05/283105/1
Jihoon Kim [Tue, 18 Oct 2022 06:31:22 +0000 (15:31 +0900)]
Remove trailing whitespaces

Change-Id: I439a2879de0c3f4dde3f21b47483798d0fa52cb4
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
2 years agoFix typo issue in tts_setting document 03/283103/1
Jihoon Kim [Tue, 18 Oct 2022 06:21:13 +0000 (15:21 +0900)]
Fix typo issue in tts_setting document

Change-Id: Iaef6463d77ebe7a742c9e7cd3c4ffd1a148f4413
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
2 years agoUpdate version (1.70.12) 59/282959/1
Suyeon Hwang [Thu, 13 Oct 2022 09:27:16 +0000 (18:27 +0900)]
Update version (1.70.12)

Change-Id: I0cf661a275ac86b49f0cbd6240fff581a17d694f
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoSet engine id from vconf value when default config is set 14/282914/4
Suyeon Hwang [Thu, 13 Oct 2022 07:45:49 +0000 (16:45 +0900)]
Set engine id from vconf value when default config is set

- Issue:
When default configuration is loaded, invalid engine id can be set.

- Solution:
Default configuration stores fixed engine id, so the engine id can be
not installed in the image. Thus, this patch changes the logic for
loading default configuration. Through this patch, vconf value is used
default engine id when default configuration is loaded.

Change-Id: Ifa37d1eceb5df126b69ac7455aea0dc0e12005fa
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRollback of changing engine-info directories and file mod 28/282528/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/hotfix/20221116.110226 accepted/tizen/unified/20221006.065321 accepted/tizen/unified/20221006.065358 tizen_7.0_m2_release
sooyeon [Wed, 5 Oct 2022 05:40:36 +0000 (14:40 +0900)]
Rollback of changing engine-info directories and file mod

Change-Id: If455a705207a310818345fa121d159b907998d62
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoUpdate version (1.70.11) 11/281811/1 accepted/tizen/unified/20220923.125139
wn.jang [Thu, 22 Sep 2022 05:40:11 +0000 (14:40 +0900)]
Update version (1.70.11)

Change-Id: Ib203747a3b2b43bd1acd8efefcc1d9be5a2997be

2 years agoCheck whether pointer is NULL or not, before use 01/281801/1
wn.jang [Thu, 22 Sep 2022 05:09:54 +0000 (14:09 +0900)]
Check whether pointer is NULL or not, before use

Change-Id: I498b36afbee0247b6c5add8ca7b976df2211ed1a

2 years agoMerge "Fix defect that is detected by static analysis tool" into tizen accepted/tizen/unified/20220922.114004
Wonnam Jang [Wed, 21 Sep 2022 10:53:29 +0000 (10:53 +0000)]
Merge "Fix defect that is detected by static analysis tool" into tizen

2 years agoFix defect that is detected by static analysis tool 55/281755/3
wn.jang [Wed, 21 Sep 2022 10:36:35 +0000 (19:36 +0900)]
Fix defect that is detected by static analysis tool

Cause: When calloc returns NULL, dereferencing a pointer might be nullptr data.

Solution: Check whether calloc is succeeded or not.

Change-Id: I72aa53d041d9cd5d358907f6d2f7ebcb140ab601

2 years agoUpdate version (1.70.10) 28/281728/1 accepted/tizen/unified/20220922.062106 accepted/tizen/unified/20220922.062730
sooyeon [Wed, 21 Sep 2022 06:28:52 +0000 (15:28 +0900)]
Update version (1.70.10)

Change-Id: Ib63dd440e20150cb584935382fcd9aa967630b22
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoChange engine-info directory and Change file mod 27/281727/1
sooyeon [Wed, 21 Sep 2022 05:52:13 +0000 (14:52 +0900)]
Change engine-info directory and Change file mod

Change-Id: Ie643075c6b2fd41044473ceab5f40e82b31e7446
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoMerge "Add dbus allow own for root users in dbus policy" into tizen
Sooyeon Kim [Mon, 19 Sep 2022 07:44:49 +0000 (07:44 +0000)]
Merge "Add dbus allow own for root users in dbus policy" into tizen

2 years agoMerge "Change directories of tts-config file and engine-info file" into tizen
Sooyeon Kim [Mon, 19 Sep 2022 05:05:55 +0000 (05:05 +0000)]
Merge "Change directories of tts-config file and engine-info file" into tizen

2 years agoSave configuratio change before auto language setting 97/280597/1
Suyeon Hwang [Thu, 1 Sep 2022 05:02:14 +0000 (14:02 +0900)]
Save configuratio change before auto language setting

- Issue:
Setting API did not save the change of auto voice enabling
configuration.

- Solution:
The configuration is stored in memory by tts_parser_set_config_info() and
stored in configuration file by other functions from tts_parser module.
However, in current logic for change auto voice configuration,
tts_config_mgr_set_auto_voice() function tries to store configuration
file without storing memory when the auto voice is true. This may cause
the situation that the memory and file are not matched.
So this patch makes the function store the configuration in memory
first.

Change-Id: I9602bcc9cbc3aad0e56fad068e159b144b0d1ab9
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoChange directories of tts-config file and engine-info file 60/280260/2
sooyeon [Fri, 26 Aug 2022 02:39:43 +0000 (11:39 +0900)]
Change directories of tts-config file and engine-info file

- Issue: In case of root daemon, it cannot access tts-config file and engine-info file,
        because they are installed in user directories respectively.

- Solution: We move tts-config file and engine-info file to global user data (/opt/usr/data)
           to make both root daemon and users access the files.

Change-Id: I7379846bbf54539eb3d81b3bb91e32b8103f94e5
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoMerge "Add logs to check whether TTS engine is launched or not" into tizen
Sooyeon Kim [Wed, 24 Aug 2022 01:36:37 +0000 (01:36 +0000)]
Merge "Add logs to check whether TTS engine is launched or not" into tizen

2 years agoUpdate version (1.70.9) 72/280072/2 accepted/tizen/unified/20220824.135613 submit/tizen/20220823.092009
Suyeon Hwang [Tue, 23 Aug 2022 07:02:56 +0000 (16:02 +0900)]
Update version (1.70.9)

Change-Id: I597731fe31f1778c17b8ac184497986a40dc656d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd unit tests for new API about service state 48/279848/5
Suyeon Hwang [Fri, 12 Aug 2022 02:52:09 +0000 (11:52 +0900)]
Add unit tests for new API about service state

This patch adds new unit tests based on gTest. Through this patch, you
can tests the behavior of new APIs.

Change-Id: I587f1d4a47ca467f6b7258e8729c34c22dcebbef
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge changes Ia966b28c,Ic20dce88,I10407b1e,I3fe6a38f into tizen
Suyeon Hwang [Tue, 23 Aug 2022 07:00:55 +0000 (07:00 +0000)]
Merge changes Ia966b28c,Ic20dce88,I10407b1e,I3fe6a38f into tizen

* changes:
  Implement service state changed event transfering
  Implement getter for service state
  Add interfaces for transfering service state
  Add new class for managing state of server

2 years agoAdd new flag variable for checking state 50/280050/2
Suyeon Hwang [Tue, 23 Aug 2022 02:30:17 +0000 (11:30 +0900)]
Add new flag variable for checking state

- Issue:
The engine did not call ttse_main(), but the engine library works like
that ttse_main() was already invoked.

- Solution:
The APIs provided by engine library checks g_is_terminate flag variable
for checking whether ttse_main() is invoked or not. However,
g_is_terminate variable is for checking whether ttse_terminate() is
invoked not for checking ttse_main() invocation. So even if the engine
does not call ttse_main(), the library could not know that ttse_main()
was not invoked yet. Thus, this patch adds new flag variable for
ttse_main() invocation.

Change-Id: I82e1df3abe2f685b19a6cd5a85c84c21d28d9624
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd logs to check whether TTS engine is launched or not 92/279992/1
sooyeon [Fri, 18 Mar 2022 17:03:51 +0000 (02:03 +0900)]
Add logs to check whether TTS engine is launched or not

Change-Id: I880fdb546a440334b0295d8ba80585e38d748a6b
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
(cherry picked from commit 8925dec19a67413070834ee9655bdc77633253bf)

2 years agoImplement service state changed event transfering 47/279847/2
Suyeon Hwang [Thu, 11 Aug 2022 10:35:43 +0000 (19:35 +0900)]
Implement service state changed event transfering

This patch implements service state changed event. Through this patch,
the client receives service state change information from server.

Change-Id: Ia966b28cc76c39ba0a535e1fd98edfcf04e3ceea
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoImplement getter for service state 46/279846/2
Suyeon Hwang [Thu, 11 Aug 2022 06:35:07 +0000 (15:35 +0900)]
Implement getter for service state

This patch implements the business logic for service state getter
functions. For thses, this patch uses interfaces introduced previous
commit.

Change-Id: Ic20dce885dbfde86fd9911dcb971d65c8d66629b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd interfaces for transfering service state 45/279845/2
Suyeon Hwang [Thu, 11 Aug 2022 06:04:07 +0000 (15:04 +0900)]
Add interfaces for transfering service state

- Requirement:
The client and server needs interface for requesting and transfering
service state, respectively.

- Solution:
This patch adds new interfaces for requesting and transfering service
state. These new interfaces includes both Dbus and TIDL.

Change-Id: I10407b1e7c0bed1cb377c83d27c29db09882fefd
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd new class for managing state of server 44/279844/2
Suyeon Hwang [Wed, 10 Aug 2022 12:11:22 +0000 (21:11 +0900)]
Add new class for managing state of server

- Requirement:
The TTS engine library needs to manage its state.

- Solution:
This patch adds new class StateManager which helps to manage state of
TTS service. Through this new class, the TTS engine library can easily
change the state and notify it.

Change-Id: I3fe6a38fcd9f55f8027b8ed1cdec8ca453cbe9a8
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd missed error description 87/279887/1
Suyeon Hwang [Fri, 19 Aug 2022 01:31:15 +0000 (10:31 +0900)]
Add missed error description

Change-Id: I8ca103f942fed8a63864caa7fb71db486b1387c5
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge "Add new APIs about service state information" into tizen accepted/tizen/unified/20220819.122443 submit/tizen/20220818.122451
Suyeon Hwang [Thu, 18 Aug 2022 08:31:08 +0000 (08:31 +0000)]
Merge "Add new APIs about service state information" into tizen

2 years agoAdd not supported error description and checker logic 03/279803/1
Suyeon Hwang [Thu, 18 Aug 2022 05:25:23 +0000 (14:25 +0900)]
Add not supported error description and checker logic

- Issue:
New APIs are related with the TTS feature, but there is no information
about the feature in description of APIs.

- Solution:
This patch adds description for feature not supported error. And also,
this patch implements feature checker logic. Through this patch, the
APIs will not working if the feature is not enabled and return not
supported error.

Change-Id: I4c92376db2f98562c8792bc9446cb7a77d8a4626
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd new APIs about service state information 23/279623/8
Suyeon Hwang [Wed, 10 Aug 2022 09:38:37 +0000 (18:38 +0900)]
Add new APIs about service state information

- Requirement:
An application needs state of TTS service in order to check whether the
TTS service is able to handle the request of the application.

- Solution:
This patch adds new APIs for checking state of TTS service. Through
these new APIs, applications which use TTS can check the state of TTS
service and handle the TTS request according to the state of TTS
service.

Change-Id: I7fbbf3f9e316b91468423c26c38452383498cf34
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoUpdate version (1.70.8) 27/279727/1 submit/tizen/20220817.095233 submit/tizen/20220818.012052
Suyeon Hwang [Wed, 17 Aug 2022 04:42:53 +0000 (13:42 +0900)]
Update version (1.70.8)

Change-Id: I89e6a033e5a697b5c673012afffe46f828e7f496
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoImplement behavior of new APIs 62/279162/5
Suyeon Hwang [Mon, 1 Aug 2022 08:35:07 +0000 (17:35 +0900)]
Implement behavior of new APIs

This patch is for implementing new APIs introduced from previous commit.

Change-Id: Iaa157ffd229bf39f2a20754dfb641ea943c2e532
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd new class for managing activated mode 61/279161/5
Suyeon Hwang [Thu, 28 Jul 2022 11:44:59 +0000 (20:44 +0900)]
Add new class for managing activated mode

- Requirement:
TTS server should manage current activated mode information. This
information for the service engine application to help decide behavior
of the application.

- Solution:
In order to store and manage currently activated mode information, this
patch adds new class. This new class only manages the currently
activated mode information, and other modules can get this information
through the methods of this class.

Change-Id: I13d47ebcf3b28c18583ac3dbe14302af0438bf94
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd new APIs about activated mode information 60/279160/4
Suyeon Hwang [Mon, 1 Aug 2022 07:42:25 +0000 (16:42 +0900)]
Add new APIs about activated mode information

- Requirement:
Engine application needs mode information that is currently activated by
connected clients.

- Solution:
This patch adds new APIs about mode informatino that is currently
activated by connected clients. These new APIs sends activated mode
information through a getter or registered callback function.

Change-Id: Ie2a2c4c49be23d05195519c34dbc6d98c61e0bad
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd dbus allow own for root users in dbus policy 15/279315/1
sooyeon [Fri, 5 Aug 2022 09:11:33 +0000 (18:11 +0900)]
Add dbus allow own for root users in dbus policy

Change-Id: I18ba4dbbfcee2e34efb6d8cc313584f453222b43
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoLoad engine when the first client is connected 31/279131/3
Suyeon Hwang [Mon, 1 Aug 2022 05:27:54 +0000 (14:27 +0900)]
Load engine when the first client is connected

- Issue:
Engine loads model when the engine is initializing, so engine always has
to load model, even if engine application does not need to load model in
some case.

- Solution:
To solve this problem, first, we need to change the timing for loading
engine. This is because engine has no information about clients when
engine is initialzing. Without any clients information, engine can not
decide whether the engine needs to load model or not.
This patch changes the timing for loading engine to when the first client
information is received. Through this patch, engine already has client
information when engine has to decide model loading.

Change-Id: Idfb67c1209dd17da2a1298ff5b82e4fec2cde18e
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge "Reduce log while waiting for comming synthesized pcm data" into tizen
Wonnam Jang [Tue, 2 Aug 2022 08:47:08 +0000 (08:47 +0000)]
Merge "Reduce log while waiting for comming synthesized pcm data" into tizen

2 years agoReduce log while waiting for comming synthesized pcm data 22/279122/2
wn.jang [Tue, 2 Aug 2022 08:30:40 +0000 (17:30 +0900)]
Reduce log while waiting for comming synthesized pcm data

Change-Id: If6b76a759512d133f5a780b43af63c830428b968

2 years agoRemove functions related with setting mode 17/279117/1
Suyeon Hwang [Fri, 29 Jul 2022 05:30:32 +0000 (14:30 +0900)]
Remove functions related with setting mode

- Issue:
Client mode information is already set in ttsd_server_initialize().

- Solution:
This patch removes functions that are releated with setting mode. These
functions are not neccessary anymore because mode information is already
set on ttsd_server_initialize().

Change-Id: Ic5f08edd9c98c4e5c34fd3d724de778f57e7991d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge setters and creater function about client 84/279084/2
Suyeon Hwang [Thu, 28 Jul 2022 12:00:05 +0000 (21:00 +0900)]
Merge setters and creater function about client

- Requirement:
Server want to store client mode and IPC method information when prepare
request from client is comming.

- Solution:
It is already possible to store client mode information using setter
functions. However, the mode and IPC method information will be decided
before that client requests prepare. So, using one function to store
these properties are more simple and comportable.
Thus, this patch adds new parameter into ttsd_server_initialize() and
ttsd_data_new_client(). Through this patch, the server can store client
mode and IPC method information during ttsd_data_new_client() invocation.

Change-Id: Ic9f3052a14d4133c6088088e36a827d261091ce1
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge "Fix IPC interface for preparing protocol" into tizen
Suyeon Hwang [Tue, 2 Aug 2022 04:28:41 +0000 (04:28 +0000)]
Merge "Fix IPC interface for preparing protocol" into tizen

2 years agoFix IPC interface for preparing protocol 76/279076/4
Suyeon Hwang [Fri, 29 Jul 2022 03:21:29 +0000 (12:21 +0900)]
Fix IPC interface for preparing protocol

- Requirement:
Client want to send mode information to server with hello message.

- Solution:
Actually, mode information is already set before calling tts_prepare()
function, so client should be able to send mode information within hello
message. However, current code sends mode information through another
IPC method.
This patch changes the hello message interface between server and
client. Through this patch, client can send mode information with hello
message at once.

Change-Id: Ie4c622b48507935d2ba35980fc2b44c4854bdeb8
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge "Add error type for converting string" into tizen
Wonnam Jang [Tue, 2 Aug 2022 01:27:38 +0000 (01:27 +0000)]
Merge "Add error type for converting string" into tizen

2 years agoSend 'NULL' string if there is no private data 52/279052/1
Suyeon Hwang [Mon, 1 Aug 2022 07:13:48 +0000 (16:13 +0900)]
Send 'NULL' string if there is no private data

- Issue:
When server sends null pointer through TIDL parameter, client may
receive unhanlded error.

- Solution:
This is because null pointer can occur invalid access on TIDL logic. To
prevent this situation, this patch sends 'NULL' string instead of null
pointer. Through this change, client always can access valid memory
pointer.

Change-Id: I2685ca0a836c360b3a784da804bbabfabb7df783
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoFix tidl error handling code 35/278935/3
Suyeon Hwang [Thu, 28 Jul 2022 07:52:38 +0000 (16:52 +0900)]
Fix tidl error handling code

- Issue:
TIDL functions always return -1 even if those are failed by various
reasons.

- Solution:
The code generated by tidlc uses 'set_last_result()' and 'get_last_result()'
function for handling exception. Thus, the caller of those code should
check the error code of 'get_last_result()' first. However, current code
only check return value of each functions.
This patch adds logic for check the error from 'get_last_result()'.
Through this change, framework can handle error from tidl code properly.

Change-Id: Ic075a95ebb64074797633f5973c8c4d5fe8d07e0
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRefactor feature check and handle creation code 22/278922/1
Suyeon Hwang [Fri, 15 Jul 2022 04:17:07 +0000 (13:17 +0900)]
Refactor feature check and handle creation code

Change-Id: Idc6d9c6de4ff23d30646a3797c615e75e54af411
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoUse condition check macro for line coverage 21/278921/1
Suyeon Hwang [Wed, 13 Jul 2022 10:38:18 +0000 (19:38 +0900)]
Use condition check macro for line coverage

- Issue:
It is tough to cover error handling code through unit test.

- Solution:
Actually, all conditional statement for checking error is invoked, but
the problem is that the code for when error occurs is not invoked. some
error handling codes are covered, but others are not covered only
through unit tests. So this patch changes conditional check code to
macro version. It still works as same as before, but the code is
compressed into one line, so all line is covered.

Change-Id: I268908220eb27258d19661b9907e83bffea008da
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoFix unit functions that are not invoked 20/278920/1
Suyeon Hwang [Wed, 13 Jul 2022 07:47:21 +0000 (16:47 +0900)]
Fix unit functions that are not invoked

- Issue:
Some internal functions are not invoked from business logic.

- Solution:
Some functions are predefined for future needs, but they are note called
yet. So, these functions decrease the line coverage. To solve this issue,
this patch removes those dead functions.
And also, this patch invokes a dead function. This function has purpose
and code that needs to invoke this function, but current code does not
use it. Through this patch, this function is invoked and covered by test
case.

Change-Id: I33b882525e99ca251644aedbe7b18cf938dc17ff
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoExclude un-testable codes from line coverage analysis 13/278913/1
Suyeon Hwang [Wed, 13 Jul 2022 07:24:34 +0000 (16:24 +0900)]
Exclude un-testable codes from line coverage analysis

- Issue:
Some codes can not be tested in automatic test enviroment. Those code
are effected by the behavior of engine or configuration.

- Solution:
This patch excludes some codes that are not tested by automatic test
enviroment from line coverage analysis. To excludes those codes, this
patch adds special comments that indicate that codes are excluded from
line coverage analysis.

Change-Id: I6201bbd7b341dcede7400565a6b106f5d1228cd6
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd test cases for uncovered APIs 49/278849/3
Suyeon Hwang [Wed, 13 Jul 2022 06:28:41 +0000 (15:28 +0900)]
Add test cases for uncovered APIs

- Issue:
Some APIs are not checked by line coverage analysis.

- Solution:
This patch adds new test cases for uncovered APIs. Through this change,
uncovered APIs are now checked in line coverage analysis.

Change-Id: Iab6cded7402a461c3da42bac0d41e5327d6a0904
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd error type for converting string 61/278861/1
wn.jang [Wed, 27 Jul 2022 04:55:49 +0000 (13:55 +0900)]
Add error type for converting string

Change-Id: I9b336cfe47b9dcf0f33cd7e886195cbea09220fa

2 years agoExclude un-testable files and fix test launch option 24/277724/2
Suyeon Hwang [Tue, 12 Jul 2022 11:25:39 +0000 (20:25 +0900)]
Exclude un-testable files and fix test launch option

- Issue:
Line coverage result by automatic checker is not good.

- Solution:
This patch excludes some files that are not target for testing user APIs. This
repository is for TTS framework code, so there are code for not only client but
also server and settings. Those code are not invoked or refered when the test
case of user APIs run, so we exclude those files from line coverage checking
through this patch.
And also, this patch adds launch option for testing. This is because for
checking the test result using journal log.

Change-Id: I23efa18a51a01040b29e9283f82cf27fe016c72f
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoAdd metadata key 15/278715/3 accepted/tizen/unified/20220728.044817 submit/tizen/20220726.013402 submit/tizen/20220727.082100
ulgal-park [Mon, 25 Jul 2022 08:48:57 +0000 (17:48 +0900)]
Add metadata key

Change-Id: I637be805d6fd917c045b444b135545d06273caf8

2 years agoMake variables shared between threads atomic 44/277444/2
Suyeon Hwang [Thu, 7 Jul 2022 05:59:58 +0000 (14:59 +0900)]
Make variables shared between threads atomic

- Issue:
Some variables that are shared between threads are defined with 'volatile'
keyword for preventing race condition. However 'volatile' can not assure
preventing race condition.

- Solution:
'volatile' just prevents compiler optimization, not prevent race
condition between threads. To assure thread safety, we should use atomic
variable.
This patch fixes the definition of those variable into atomic variables.
Through this patch, each variables will be created as atomic variables
and these atomic varaibles can prevent race condition during multi
threads enviroment.

Change-Id: I71f254a62d7ac848fedeffc91c40e4271f7af25d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoUpdate version to 1.70.7 50/278650/1 accepted/tizen/unified/20220726.012210 submit/tizen/20220725.004550
wn.jang [Sun, 24 Jul 2022 23:03:12 +0000 (08:03 +0900)]
Update version to 1.70.7

Change-Id: I94519ffd8013d740112746098880e1669f7e178e

2 years agoAdd static keyword into global variables 56/277756/1
Suyeon Hwang [Wed, 13 Jul 2022 02:20:01 +0000 (11:20 +0900)]
Add static keyword into global variables

- Issue:
Some global variables can be accessed by other files, because those are
not hided from others. It can allow malicious access.

- Solution:
This patch adds static keyword into global variables that are used only
in the file.

Change-Id: I85a0563027fc94dcd9d31eb508b37f237678b0e0
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoExclude code of unittests from SAM analysis 54/277754/1
Suyeon Hwang [Wed, 13 Jul 2022 01:54:52 +0000 (10:54 +0900)]
Exclude code of unittests from SAM analysis

- Issue:
When we get SAM score using automation enviroment, the DC score is
effected by unittest code.

- Solution:
This patch excludes files for test code from SAM analysis. Through this
change, the SAM score is calculated only refering implementation.

Change-Id: I9dd67868727db0c257c9d83896441dc42337a018
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoExtract common code as functions for reducing duplicated code 58/277358/2
Suyeon Hwang [Tue, 5 Jul 2022 11:51:29 +0000 (20:51 +0900)]
Extract common code as functions for reducing duplicated code

Change-Id: I5de2dbe0c6e240ce364c4447c87bca048c59e6cc
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRefactor unit test code for removing duplicated code 97/277297/3
Suyeon Hwang [Tue, 5 Jul 2022 01:29:01 +0000 (10:29 +0900)]
Refactor unit test code for removing duplicated code

- Issue:
There are too many test case for testing scenarios, and some of test
case have similar or same testing scenarios. And these scenarios make
duplicated code.

- Solution:
For removing common and duplicated code for each test case, this patch
creates new test suites classes. Through these new classes, each test
case can remove common setUp and tearDown codes.

Change-Id: Id74508b7ef3732748799d9f2878598de3e5dead0
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoExtract unit functions for reducing duplicated code 86/277286/2
Suyeon Hwang [Mon, 4 Jul 2022 11:01:45 +0000 (20:01 +0900)]
Extract unit functions for reducing duplicated code

- Issue:
To get some dynamic values, there are too many duplicated code used.

- Solution:
This patch extracts duplicated codes and creates new functions using the
codes. Using these new functions, we can remove duplicated codes from
the file.

Change-Id: I926f105e5ed124b10ddc55eecc7844aa83c08033
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoSimplify the precondition checking code 42/277242/3
Suyeon Hwang [Mon, 4 Jul 2022 05:00:32 +0000 (14:00 +0900)]
Simplify the precondition checking code

- Issue:
Each functions of TTS framework have many precondition checking codes and
these codes are duplicated.

- Solution:
This patch creates macro for simplifying the precondition checking
codes. According to this patch, each checking codes are becoming shorter
and simpler than before. There are still duplicated code, but these
codes are shorter than before, so these can effectively reduce the line of
duplicated code.

Change-Id: Ibf705a819217d892ff4d2bdcb2d74d3539640b65
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoReorder precondition checking code 11/277011/1
Suyeon Hwang [Wed, 29 Jun 2022 06:20:04 +0000 (15:20 +0900)]
Reorder precondition checking code

- Issue:
In the ttsd_engine_agent.c file, the precondition checking code of each
function has no constant rule for coding. This can decrease the
readability of the code.

- Solution:
To improve the readbility of the code, this patch reorders the
precondition checking code of each function by constant way.
According to this patch, each function first checks the validation of
parameters and then checks initialization of the module and engine.

Change-Id: If9498fd406ca29bf693493f959b521bf02b9604b
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove duplicated codes 37/276937/4
Suyeon Hwang [Tue, 28 Jun 2022 04:46:04 +0000 (13:46 +0900)]
Remove duplicated codes

- Issue:
The codes for checking preconditions are repeated in every functions. And also,
the codes for clearing list are repeated.

- Solution:
This patch makes new inline functions for simplify the precondtion
checking code. Using theses new functions, we can remove many duplicated
precondition checking code.
And also, this patch makes new function for clearing voice information list.
Through this function, we can remove duplicated list clearing code.

Change-Id: I611c798238b76b3e2d0b50942dc3b3c5d0eb2372
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove duplicated code 65/276865/2
Suyeon Hwang [Mon, 27 Jun 2022 07:07:13 +0000 (16:07 +0900)]
Remove duplicated code

- Issue:
There are too many duplicated codes.

- Solution:
This patch makes new function for removing duplicated code. These new
functions encapsulate duplicated codes, so these have high reusability.

Change-Id: I5a53dc5a6c2c9e97f16944001e3801496e9d771e
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge changes Ic626132d,I2b542061 into tizen
Suyeon Hwang [Mon, 27 Jun 2022 02:35:29 +0000 (02:35 +0000)]
Merge changes Ic626132d,I2b542061 into tizen

* changes:
  Make return value clear using enum
  Remove duplicated code

2 years agoMake return value clear using enum 71/276771/1
Suyeon Hwang [Fri, 24 Jun 2022 08:17:19 +0000 (17:17 +0900)]
Make return value clear using enum

- Issue:
Return values of each function were not clear.

- Solution:
This patch makes each function use enum value as return value. And also,
this patch fixes the return values which are not matched with situation.

Change-Id: Ic626132db4afaa96d3997ba3de02a1f007b9b7ca
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove duplicated code 60/276760/2
Suyeon Hwang [Fri, 24 Jun 2022 05:39:25 +0000 (14:39 +0900)]
Remove duplicated code

- Issue:
From tts_engine_agent.c and tts_config_parser.c, too many duplicated code was generated.

- Solution:
This patch makes new unit functions that encapsulate the duplicated code. These functions will
remove duplicated code.

Change-Id: I2b542061f2d5a694d3f786eefbf6447c507fb225
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove unused reconnect logic code 88/275088/2
Suyeon Hwang [Mon, 16 May 2022 11:41:05 +0000 (20:41 +0900)]
Remove unused reconnect logic code

- Issue:
By calling __reconnect() function from __on_disconnected() callback, unused memory is created.

- Solution:
When client loose the connection to service engine, client tries to reconnect to service engine by
calling tts_core_handle_service_reset() function. This function checks the service engine status
and tries again the prepare processing. So reconnection by __reconnect() function is not necessary.
And also, __reconnect() creates unused information structure memory. Of course these memories are
not searched because the order of append into list. However, this can make memory explosion, so
by this patch, I remove this unused function.

Change-Id: Ic0b0d2aefbb31d8235b4331e1f6f78fa1d4a10ca
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove tts_core_notify_state_changed_async() to assure callback invocation 01/275001/3
Suyeon Hwang [Fri, 13 May 2022 07:46:22 +0000 (16:46 +0900)]
Remove tts_core_notify_state_changed_async() to assure callback invocation

- Issue:
Sometimes, if client calls tts_play() very quickly, then the first state changed callback which
shows the change from 'created' to 'ready' state is skipped.

- Solution:
This patch removes the tts_core_notify_state_changed_async() function in order to make sure that
the first state changed callback is called. tts_core_notify_state_changed_async() can not assure
the callback invocation of all state changed because state of client can be changed between timer
register and its actual invocation. And also, without this function, calback invocation does not
block the main loop because all the callers of this function is called by ipc message.
Thus, by this patch, client can assure that the state changed callback is always invoked when
the state is changed.

Change-Id: I2b333330d0c44caeb08973d41f800619458e292e
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoMerge "Invoke error callback when __prepare_cb is failed" into tizen
Sooyeon Kim [Thu, 16 Jun 2022 09:03:58 +0000 (09:03 +0000)]
Merge "Invoke error callback when __prepare_cb is failed" into tizen

2 years agoInvoke error callback when __prepare_cb is failed 39/271239/2
sooyeon [Thu, 17 Feb 2022 14:27:00 +0000 (23:27 +0900)]
Invoke error callback when __prepare_cb is failed

Change-Id: Ia03e13220dea3f67a1413ddf19a4c0560ae580c9
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoAdd a checker whether requesting connection is failed or not 40/272940/2
sooyeon [Mon, 28 Mar 2022 16:20:08 +0000 (01:20 +0900)]
Add a checker whether requesting connection is failed or not

Change-Id: I050f1be537e0267f2a0f2fb58928d5feaa1ce24b
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
2 years agoUpdate version (1.70.6) 36/276236/1 accepted/tizen/unified/20220615.135320 submit/tizen/20220613.094244 submit/tizen/20220614.055551
Suyeon Hwang [Mon, 13 Jun 2022 08:17:14 +0000 (17:17 +0900)]
Update version (1.70.6)

Change-Id: I0711fd957e0d590fd710a064283ac790370cefa9
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoFix unittest for line coverage automation 49/276149/1
Suyeon Hwang [Fri, 10 Jun 2022 06:27:38 +0000 (15:27 +0900)]
Fix unittest for line coverage automation

Change-Id: Icf4cc166b0516936c385b9903df9699d9e54060d
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoFix gcov package contents for automation 39/276039/1
Suyeon Hwang [Thu, 9 Jun 2022 02:36:12 +0000 (11:36 +0900)]
Fix gcov package contents for automation

Change-Id: I084fa48109e2af6347a0588e82ac15c7053f79a3
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoUpdate Version (1.70.5) 87/274987/1 accepted/tizen/unified/20220524.050339 submit/tizen/20220513.052256
Suyeon Hwang [Fri, 13 May 2022 05:13:23 +0000 (14:13 +0900)]
Update Version (1.70.5)

Change-Id: I5ecbabdc69e926f80d89a9b2016aa20d4da0f3a5
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoFix paused data handling logic 59/274959/1
Suyeon Hwang [Thu, 12 May 2022 12:46:19 +0000 (21:46 +0900)]
Fix paused data handling logic

- Issue:
If sound_data queue is cleared still player thread has reference of the first element of the
sound_data queue, then player thread makes double free problem of sound_data.

- Solution:
Problem is because the player thread tries to destroy the data without ownership of the data. So
This patch makes the player thread has ownership of played sound_data. By this change, player
thread can destroy the data that the thread has its ownership.

Change-Id: Ib3e34f9cc8632458f097edd760da2179471bc864
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoUpdate version to 1.70.4 70/273870/1 accepted/tizen/unified/20220418.141248 submit/tizen/20220415.011716
wn.jang [Fri, 15 Apr 2022 01:04:06 +0000 (10:04 +0900)]
Update version to 1.70.4

Change-Id: I8e73638367b4c660e0082df6079e9a101bbee170

2 years agoAdd metadata profile xml file 69/273769/1
wn.jang [Wed, 13 Apr 2022 10:38:42 +0000 (19:38 +0900)]
Add metadata profile xml file

Change-Id: I0b48c7bafbe1773e7ad97c2112ef593d104aaba6

2 years agoUpdate version to 1.70.3 36/272936/1 accepted/tizen/unified/20220328.131441 submit/tizen/20220328.080118
wn.jang [Mon, 28 Mar 2022 07:15:42 +0000 (16:15 +0900)]
Update version to 1.70.3

Change-Id: I5f21a34f8f853fdd8536f33625f40a289dc3f4c9

2 years agoAdd to check return value 32/272932/1
wn.jang [Mon, 28 Mar 2022 07:01:07 +0000 (16:01 +0900)]
Add to check return value

Change-Id: I7e8033925bef9f14010fdf5409d8fd008bebb097

2 years agoInitialize type of app data 26/272926/1 submit/tizen/20220328.060712
wn.jang [Mon, 28 Mar 2022 05:34:46 +0000 (14:34 +0900)]
Initialize type of app data

This issue was detected by static analysis tool.

Change-Id: I4b1d4dc81d94f3bd6fa492f680697a7670ed79f8

2 years agoUpdate version 1.70.2 11/272811/1 submit/tizen/20220325.021820
wn.jang [Fri, 25 Mar 2022 01:54:12 +0000 (10:54 +0900)]
Update version 1.70.2

Change-Id: I4f3a608b9adf8fb4c4fc5dd9dcef8b346815b18e

2 years agoInitialize result_event of app data 08/272808/1
wn.jang [Fri, 25 Mar 2022 01:34:56 +0000 (10:34 +0900)]
Initialize result_event of app data

This issue was detected by static analysis tool.

Change-Id: Iac86b73641a1feacb59b29781a1f777f12b8f0b5

2 years agoClean up header files 96/271896/2
Suyeon Hwang [Mon, 24 Jan 2022 05:54:52 +0000 (14:54 +0900)]
Clean up header files

Change-Id: I87127a6429e4396dfaf5492c06eba9a6cbb230b2
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove ttsd_player_resume() 95/271895/2
Suyeon Hwang [Thu, 20 Jan 2022 03:11:15 +0000 (12:11 +0900)]
Remove ttsd_player_resume()

Change-Id: Iea7fdeeef07dc83f4a75997c4b9c5ecf2aa5dbb9
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRearrange code to stop all client 94/271894/2
Suyeon Hwang [Thu, 20 Jan 2022 02:26:47 +0000 (11:26 +0900)]
Rearrange code to stop all client

Change-Id: I1395e10b466b998a6b14d4d17ccb2cf6839b20e4
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove code for mode of service engine 93/271893/2
Suyeon Hwang [Wed, 19 Jan 2022 07:02:39 +0000 (16:02 +0900)]
Remove code for mode of service engine

Change-Id: I49ca352cd1dc35a9404903079467277445a35af8
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
2 years agoRemove unused code about sound focus change 92/271892/2
Suyeon Hwang [Wed, 19 Jan 2022 06:05:51 +0000 (15:05 +0900)]
Remove unused code about sound focus change

Change-Id: I7769384e7d16697b460a7b12af669c08b5627dc7
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>