Abhay Agarwal [Tue, 9 Mar 2021 09:01:12 +0000 (14:31 +0530)]
Add UWB plugin support
This patch updates the enums and convert functions
to support UWB plugin.
Change-Id: I51db435f5bfe4413ddb9e9437dff73f46b1ea22f
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Wed, 6 Jan 2021 09:48:46 +0000 (15:18 +0530)]
Add wifi location plugin support
This patch updates the enums, convert functions to
support wifi-location plugin.
Change-Id: I7f8d398708d5d6c4559d7f4d4c0fedd7ca6af6ee
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
rohit singh [Mon, 14 Jun 2021 11:05:39 +0000 (16:35 +0530)]
Add multi-application support for service api's
This patch adds the multi-applcation support for service
based api's and methods.
Change-Id: I21f73c208825161d547f052eb2eebfd4c37c1c21
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Wed, 9 Jun 2021 10:38:47 +0000 (16:08 +0530)]
Fix derefencing of null pointer issue
Return value of a function '__search_device' is dereferenced
inside __init_svc_user_mapping() function.
Change-Id: Ibeb9cdc49dc5fdfa8c94f036dca5c6802c0929eb
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Mon, 7 Jun 2021 12:00:57 +0000 (17:30 +0530)]
Modify ua_service_foreach_users
This patch modifies ua_service_foreach_users based on
service->user->device hierarchy.
Change-Id: I31ac658cc553ffa3e98ab26f57ab5c8b08ca2ed1
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Mon, 31 May 2021 10:32:41 +0000 (16:02 +0530)]
Fix style issues
This patches fixes the styles issues as shown
in the check-patch script.
Change-Id: Iccf3afcab19debd2850b5d8fd1a3250ee894a36d
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Thu, 27 May 2021 05:16:12 +0000 (10:46 +0530)]
Modify service-user based API's
This patch modifies:
1) ua_service_remove_user
2) adds the app_num attribute support to the
service-user hierarchy based API's.
Change-Id: I6d080b0356b9fb8a3632c0c09e8f057698673faa
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Mon, 17 May 2021 12:03:19 +0000 (17:33 +0530)]
Fix for ua_foreach_service
Issue: In a scenario when a service is registered and when
ua_foreach_service() is called it failed to get the newly registered
services though the service got persisted to db.
Solution: Logical error fix w.r.t app_num attribute of struct
uam_service_info_s at the daemon side solved the issue.
Change-Id: I055779441191e9439e66ab715c173f91c16b2817
Anupam Roy [Tue, 25 May 2021 11:51:13 +0000 (11:51 +0000)]
Merge "Change implentation for ua_service_add_user" into tizen
rohit singh [Sun, 16 May 2021 13:21:34 +0000 (18:51 +0530)]
Change implentation for ua_service_add_user
Issue: Earlier ua_service_add_user is not having the support for Service -> User -> Device
hierarchy structure.
Solution: Added implementation to maintain service_user mapping at the daemon side so that
whenever a device gets added to user it automatically gets added to the respective
service with which the user is mapped to.
Change-Id: I4cfca7db3f6e8fa6616d68c0570f86f23838022c
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Mon, 24 May 2021 05:53:55 +0000 (11:23 +0530)]
Dead default in switch
Issue: The statements in the default case are never executed.
Solution: Removal of the retv statement will solve the issue.
Change-Id: I74cc0d357acbb7bc5ce986ef532f5684b3ab74fa
Signed-off-by: rohit.singh <rohit.singh@samsung.com>
rohit singh [Wed, 12 May 2021 11:52:29 +0000 (17:22 +0530)]
Fix for __uam_manager_get_device_type
Issue: Return type mismatch issue. Inside function __uam_manager_get_device_type()
enum UAM_SENSOR_BITMASK_* is used instead of UAM_TECH_TYPE-*, which was inconsistent
to the function calling __uam_manager_get_device_type().
Solution: Changed UAM_SENSOR_BITMASK_* to UAM_TECH_TYPE-*.
Change-Id: I1df188dd713379e8c594de86707bf39e05a7fec9
hyunuk.tak [Thu, 25 Mar 2021 23:37:44 +0000 (08:37 +0900)]
Modify to check privilege
Change privilege as below
userawareness, userawareness.admin
=> bluetooth, network.get, location
Add request for adding/removing sensor
Change-Id: Iedd72ba46ac0a93b1ba320f637a9b0aa464686d1
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
hyunuk.tak [Mon, 22 Mar 2021 23:59:30 +0000 (08:59 +0900)]
Modify default policy for dbus
Change-Id: I3a02f401a9c7614d42bb7919e41a1b4c89fac522
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
DoHyun Pyun [Wed, 24 Feb 2021 23:20:16 +0000 (08:20 +0900)]
Fix the security configuration issue (Shell Script)
All command line tools in any shell script should be executed
in designated location or executed as absolute path.
Change-Id: I8f9548f7fda0db656ede895be2fd7c92e2c9161f
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Abhay Agarwal [Tue, 9 Feb 2021 06:18:59 +0000 (11:48 +0530)]
ua-daemon: Add support for product API's
This patch adds support in ua-daemon to handle product API's.
Change-Id: Ic37f326f04bbcdd6c67734ae5ae7f48ab677afa7
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Fri, 5 Feb 2021 09:14:52 +0000 (14:44 +0530)]
ua-api: Add support for product API's
This patch adds support in ua-api to handle product API's.
Change-Id: Ied7769ad1f550a81e643a7ab894625860924c5ba
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
hyunuk.tak [Mon, 4 Jan 2021 04:19:31 +0000 (13:19 +0900)]
Add some patches
Fix circleCI script
Undefined OS type , OS updation for single device ID fix
OS_update in plugin bug fix
Fix to not to use docker image
Fix device detection failure due to payload
Change the plugin path to RO area
Fix stop detection event
Fix user absence event
Fix set service detection cycle functionality
Remove implicit call of stop_detection before start_detection
Send unique payloads to plugins in registered device list
Add scan mode functionality for start detection
Terminate ua-manager if no client is referencing it
Change-Id: I5bd6d8d421071d534991818d3e0128c5d68ce8d6
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
Jihoon Jung [Mon, 7 Dec 2020 01:09:21 +0000 (10:09 +0900)]
Add ifndef flag for sqlite 3.33.0
Change-Id: Ib36af3e1001371d1440a1d842a6c9a0308085a40
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
DoHyun Pyun [Mon, 3 Aug 2020 01:39:53 +0000 (10:39 +0900)]
Modify the package version
In order to distinguish the package history as tizen version,
we manage the package version from now.
Change-Id: I3d40228067053f313fa695e56c42453c0b1263d2
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
Abhay Agarwal [Mon, 17 Feb 2020 08:43:39 +0000 (14:13 +0530)]
Stop scan on sensor when no monitoring application
Issue: Presence/absence scanning on BLE/wifi plugin was not able to
stop in case only presence or only absence was started by application.
Reason: Even if only presence or only absence is started by application
ua-manager simultaneoulsy starts both presence and absence to keep their
detection cycle in sync.
Solution: Stop both presence and absence detection when stop detection
is called, if no application is monitioring on this sensor.
Change-Id: I1e54bad283932dfe3128628e98369a0070f9e623
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Thu, 30 Jan 2020 11:33:48 +0000 (17:03 +0530)]
ua-daemon: Fix memory leak during init
Change-Id: I2284a7de845bfbfc88bdffa6de30f0fc8700757c
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Thu, 30 Jan 2020 06:19:48 +0000 (11:49 +0530)]
ua-db: Fix negative returns
If payload device uid length is negative, assign this length as 0
Change-Id: I2bda321b6d27df2962771d809a0459c15724aaff
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Thu, 30 Jan 2020 05:39:36 +0000 (11:09 +0530)]
ua-daemon: Fix resource leak, possible NULL derefernce and coverity issues
Change-Id: Ib94b45ee765549198c5b56f0967a78e6ac121c06
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Wed, 29 Jan 2020 05:22:23 +0000 (10:52 +0530)]
plugin handler: Fix resource leak because of payload
Change-Id: Ife96b4762153e52fc26babff1ddf6ce0a79f9f3b
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Tue, 21 Jan 2020 05:40:44 +0000 (11:10 +0530)]
Simultaneously start presence and absence detection
Issue: when presence detection is follwed by absence detection,
absence callback is missed in first cycle.
Solution: start both presence and absence detection
Change-Id: I353a2ecd985c86afefb322cad47283695853896c
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Tue, 14 Jan 2020 09:35:31 +0000 (15:05 +0530)]
Add support to report light sensor status change
This patch add support of light sensor in existing functionality
to report sensor status change to application
Change-Id: Ie237eeecc1fbf15c3ccb08b35b91ec5e597e60d3
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay Agarwal [Tue, 14 Jan 2020 11:38:58 +0000 (17:08 +0530)]
Fix check for db file size
Database file should not be 0 after db creation
Change-Id: I93803f853ffd6b3afed3b18010cc556da7eb3417
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Fri, 27 Dec 2019 03:24:19 +0000 (08:54 +0530)]
Fix device payload update query
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 26 Dec 2019 15:53:33 +0000 (21:23 +0530)]
Fix device service list in ua-manager for NULL payloads
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 26 Dec 2019 13:48:33 +0000 (19:18 +0530)]
Store payload device user data in database
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 26 Dec 2019 04:24:44 +0000 (09:54 +0530)]
Set length for payload device uid
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Tue, 24 Dec 2019 13:34:28 +0000 (19:04 +0530)]
Fix payload copy functions
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Tue, 24 Dec 2019 09:39:00 +0000 (15:09 +0530)]
update handle device detected for payload handling
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Mon, 23 Dec 2019 13:45:09 +0000 (19:15 +0530)]
update svc_dev list while registering device to service
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Mon, 23 Dec 2019 12:16:10 +0000 (17:46 +0530)]
Update registered device list to plugin with payload information
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Fri, 20 Dec 2019 12:49:30 +0000 (18:19 +0530)]
Update svc_dev info while adding payload to service
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 19 Dec 2019 12:02:50 +0000 (17:32 +0530)]
Add service-device-payload list in device tech
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Wed, 18 Dec 2019 09:29:29 +0000 (14:59 +0530)]
Fix copy function of payload
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Tue, 17 Dec 2019 14:24:08 +0000 (19:54 +0530)]
Do not return from uam core initialization if no data in database
- All the database tables must be checked before returning from
uam_core_init function
- Some/All of tables of uam database may be empty and can be
updated by application
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Tue, 17 Dec 2019 12:27:35 +0000 (17:57 +0530)]
Update core payload list from database during init
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Tue, 17 Dec 2019 11:22:47 +0000 (16:52 +0530)]
Add database API to get all payloads
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 12 Dec 2019 09:55:02 +0000 (15:25 +0530)]
Add API to get payloads list
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Fri, 6 Dec 2019 04:07:56 +0000 (09:37 +0530)]
Add database APIs to update device service payload info
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Wed, 4 Dec 2019 08:50:22 +0000 (14:20 +0530)]
Fix device payload insert
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Mon, 2 Dec 2019 10:06:53 +0000 (15:36 +0530)]
Add ua-manager core API to insert payload information to a service
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Fri, 29 Nov 2019 08:51:15 +0000 (14:21 +0530)]
Add database API to insert device payload
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Fri, 29 Nov 2019 05:52:07 +0000 (11:22 +0530)]
Add ua-manager core APIs to insert payload information
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 28 Nov 2019 11:35:41 +0000 (17:05 +0530)]
Remove payload from device
payload would be added to device-service instead of only being device specific
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 28 Nov 2019 10:48:30 +0000 (16:18 +0530)]
Seperate payload database table from device table
For a device, each service can have different payload.
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 28 Nov 2019 04:23:38 +0000 (09:53 +0530)]
Rename duid to device_uid
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Wed, 27 Nov 2019 06:36:02 +0000 (12:06 +0530)]
Rename ble payload purpose to secondary key
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Wed, 27 Nov 2019 06:08:41 +0000 (11:38 +0530)]
Rename ble payload service_id to primary_key
Renamed to hide SEC BLE Adv format
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
saerome.kim [Thu, 12 Dec 2019 06:10:38 +0000 (15:10 +0900)]
Fix crash issue
- problem: Crash takes place when doing adding a device and detection
simultaneously.
- Cause: timer callback tries to remove freed memory.
- Solution: Remove timer when removing an async request.
Change-Id: I24be2a3c53ee18e8f3c97be46348a05b03a0782d
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Wed, 11 Dec 2019 10:19:41 +0000 (15:49 +0530)]
Change UAM_ASYNC_REQUEST_TIMEOUT to 11 from 10 sec
Problem: While adding wifi device with broadcast mac address, and device is not
discoverable, the request_list is cleaned by __uam_request_context_timeout_cb()
before plugin callback came (within 10 sec).
Solution: Plugin tries for 10 seconds, so wait for 11 seconds.
Change-Id: I2bbfc38ccfec65035ecfbb61bf30c20749ee44dd
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Thu, 5 Dec 2019 10:25:17 +0000 (19:25 +0900)]
Remove unnecessary error log
Change-Id: I4fa6b31e6511ccef0e3b827b939663146eb9a4bc
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 5 Dec 2019 09:22:22 +0000 (18:22 +0900)]
Fix that the device is not added while detecting devices.
- Problem: If adding a device while detecting the device, the first device
detection callback is not called.
- Cause: If the broadcast MAC is used as a source filed in APR Request packet,
can't distinguish ARP Response whether the device detected or the device added.
- Solution: Modified the device is not added while detecting devices.
Change-Id: Iad779411cecc89869b1aa77522cefd22e7106ecb
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 5 Dec 2019 08:35:55 +0000 (17:35 +0900)]
Increase 'enable' method timeout
- Problem: At the time of booting, failt to start ua-manager.
- Cause: It takes a long time for sensor framework to operate.
- Solution: Temporarily increase the response waiting time of the enable method
to start ua-amanger.
Change-Id: I136d689180535ffe86431c97ad82eb00fb259632
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 5 Dec 2019 05:38:06 +0000 (14:38 +0900)]
Fix the issue that MAC cannot be updated when adding a device to broadcast MAC
- Problem: The actual MAC is not applied even if the ARP response is received
from the device added with broadcast MAC.
- Cause: MAC is managed as a unique key.
- Solution: Modified so that MAC can be changed.
Change-Id: Ic9f1b1b0a9b5694b9275302354df9e36a78d3da4
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Wed, 4 Dec 2019 08:49:57 +0000 (14:19 +0530)]
Revert "Add DB functionality for device users mapping"
This reverts commit
1afd2d3aeb9758f4f894c3aa917874da82d33c3b.
Change-Id: I5a76569e7190643c7dfc726dbdeca01d1cb27723
Lokesh [Wed, 4 Dec 2019 08:49:12 +0000 (14:19 +0530)]
Revert "Identify whether device is already registered and not"
This reverts commit
5ac8bb7cef537a0db489b1a364c4bffbf8ca0dbf.
Change-Id: I5164eb00ff30c9006786ce963ba1810023588364
Lokesh [Wed, 4 Dec 2019 08:47:51 +0000 (14:17 +0530)]
Revert "Fix the problem that can't access the device-users table"
This reverts commit
798a02d0faca05dc6a7a5124c382471e43efd381.
Change-Id: Iae2c03b1fa6c9826c420f9e3d9a6de07820643a4
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Tue, 3 Dec 2019 12:29:45 +0000 (21:29 +0900)]
Fix memory leak
- Problem: Even clients app. died, ua-manager keeps dead client's
monitor handle.
- Cause: ua-manager does not care for the dead client app.
- Solution: Remove the client's monitor handle if the client requests un-initialization.
Change-Id: I992bf5a6234675fbc3b81fad7f97b530e4019ae4
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Fri, 29 Nov 2019 08:19:46 +0000 (13:49 +0530)]
[Fix] Write service specific device last_seen in DB
Issue:
On device detection, update service specific device last_seen in DB.
At time of service_add_device/user(), this last_seen must initialisze from 0,
as per jira statement(https://code.sec.samsung.net/jira/browse/TSYSCON-1948).
Change-Id: I4c7d46fc6ff43f6a09d27df671805eb5f33bfb69
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Fri, 29 Nov 2019 04:43:17 +0000 (13:43 +0900)]
Fix the problem that can't access the device-users table
- Problem: After DB reset, ua-manager can't create the device-users table.
- Cause: Attempt to access a table that does not exist.
- Solution: Modified the device-users table name as intended.
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Mon, 25 Nov 2019 11:43:29 +0000 (20:43 +0900)]
Remove error-logging when removing un-opened DB
- Problem: An error is displayed while attempting to delete an unopened DB.
- Cause: vendor plugin tried to clear DB but ua-manager did not open DB file.
- Solution: If the DB is not open, the error is returned.
Change-Id: Ifc3f13cc18ab362ebd1c18910ee6a430449b0732
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Mon, 25 Nov 2019 11:33:14 +0000 (20:33 +0900)]
Make unclear code as clear
- Problem: The Coverity regarded that ua-manager refering freed() pointer.
- Cause: The input param and the param in the list may not be the same value.
- Solution: Clarify variable name.
Change-Id: I13597ecfcd79843e7ba7222b2282e6e5dd8b6dc3
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Fri, 22 Nov 2019 02:04:04 +0000 (07:34 +0530)]
Identify whether device is already registered and not
Change-Id: I14be9dd70c03f3d40e2b4d4e953b5ad72c2c5c33
Signed-off-by: Lokesh <l.kasana@samsung.com>
Lokesh [Fri, 22 Nov 2019 02:04:04 +0000 (07:34 +0530)]
Add DB functionality for device users mapping
Change-Id: Id41e248ce14ed1f1fdb75fec2aa2680077e5855d
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Fri, 22 Nov 2019 01:31:15 +0000 (10:31 +0900)]
Fix build error occurred in sensor plugins
- Problem: Build break took place when building Light/Motion plugins.
- Cause: member variable name had been changed in uas_sensor_info_t.
- Solution: Backout the change.
Change-Id: Id8c10d798a28427451d81b16772603490f24dcd0
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Nishant Chaprana [Thu, 21 Nov 2019 14:12:36 +0000 (19:42 +0530)]
Provide pending request TRUE only for already registered but not verified device.
- Problem: Pending request returns TRUE when last registered device which is not
yet verified by plugin, even for different device.
- Cause: __uam_manager_is_request_pending() only checks for matching function
before returning result.
- Solution: Match device_id for UAM_REQUEST_ADD_DEVICE before returning result.
Change-Id: Ie0d148f821932eb195547c47939917bb7bdbba60
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Nishant Chaprana [Thu, 21 Nov 2019 14:04:41 +0000 (19:34 +0530)]
Fix handle leak when loading plugins
- Problem: dlopen() returned handle was leaking when loading plugins in loop.
- Cause: dlcose() not called when plugin add operation fails.
- Solution: Call dlcose() when plugin add operation fails.
Change-Id: Id3c1d9a42fb2ef8b9b9e5b64393c40f6e771d9fc
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
saerome.kim [Thu, 21 Nov 2019 08:33:14 +0000 (17:33 +0900)]
Fix crash issue
- Problem: A crash may occur in a multi-client environment.
- Cause: A crash may occur if a request is deleted in the middle while
processing the async request included in the list.
- Solution: Modified so that the list is not broken by deleting the request
while processing the request.
Change-Id: Ic51e4571ea10d7922b429d2712b8a3ed4dccc512
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 21 Nov 2019 08:29:56 +0000 (17:29 +0900)]
Update a missing column for device-services table
Change-Id: I1f9b7864cc44bb37e63c51dc713e7c0c38d07194
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 21 Nov 2019 04:39:37 +0000 (13:39 +0900)]
Change the last seen that has never been added or detected by the service to 0
- Problem: The last_seen information may not be 0 even if the service is not executed.
- Cause: We are adding the last_seen info regardless the service.
- Solution: The device information added to the service is initialized to 0.
Change-Id: I14249599db420b25e47098c83eaa17ed1d65182e
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Thu, 21 Nov 2019 04:39:37 +0000 (13:39 +0900)]
Fix the problem that can't add a device from next time once add_device_failed.
- Problem: Once add_device failed, we can't add the device anymore.
- Cause: The request stored in the internal queue is not deleted.
- Solution: If the request is not processed for a certain period of time,
remove the request from the queue
Change-Id: I14990e3854d599ca3adfed491f64bb215e94d232
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Wed, 20 Nov 2019 11:10:56 +0000 (20:10 +0900)]
Modify to store last seen information of device added by service in DB
- Problem: Once a client app restarts, the previous last seen information is 0.
- Cause: As a requirement, last seen information of service-specific device
should be stored in DB
- Solution: Save the last seen information to the DB.
Change-Id: Ifd1e41c0c822b2274262d3aea6c723e192945822
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Tue, 19 Nov 2019 05:36:17 +0000 (11:06 +0530)]
Reduce calls to _uam_get_timestamp()
Instead use the value stored in tech->timestamp
Change-Id: I1017043c45a0fd53cd2f962c6168a1e7a902c7d2
Signed-off-by: Lokesh <l.kasana@samsung.com>
Lokesh [Mon, 18 Nov 2019 14:00:04 +0000 (19:30 +0530)]
Support multiple timestamp for each service
Change-Id: I67acdcfa5e4ba8a6d8de68f7e37dfcd4f58adf01
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Mon, 18 Nov 2019 04:13:03 +0000 (13:13 +0900)]
Fix memory leak
- Problem: heap is increasing a bit by bit.
- Cause: BT_MAC is not freed.
- Solution: make BT_MAC free.
Change-Id: I0f118ba74c2e62c81561080751338a4925044b2a
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 14 Nov 2019 09:59:11 +0000 (18:59 +0900)]
Change the timestamp value to use the monotonic timer
- Problem: real-time timestamp causes various problems.
- Cause: If the time zone is changed or the system time is initialized,
the wrong timestamp may be generated.
- Solution:
1. Change to use the monotonic timer when creating a timestamp.
2. Add new plugin API that enables the BLE plugin can save real-time
timestamp.
Change-Id: I2508ecdb15977f6278fb2eeec89dc5caba77537f
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Thu, 14 Nov 2019 09:59:11 +0000 (18:59 +0900)]
Change the timestamp value to use the monotonic timer
- Problem: real-time timestamp causes various problems.
- Cause: If the time zone is changed or the system time is initialized,
the wrong timestamp may be generated.
- Solution:
1. Change to use the monotonic timer when creating a timestamp.
2. Add new plugin API that enables the BLE plugin can save real-time
timestamp.
Change-Id: I24c1dbbec39417f6f13ec87dfff8c3239572722c
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Thu, 14 Nov 2019 11:28:00 +0000 (16:58 +0530)]
Change position of _uam_pm_stop_detection()
Do _uam_pm_stop_detection() for both presence and absence together,
so that motion plugin sends detection_stopped event.
Change-Id: I9fb0e1696c16cb59eb0c3c7f910101844364b5ec
Signed-off-by: Lokesh <l.kasana@samsung.com>
Abhay agarwal [Mon, 11 Nov 2019 06:10:05 +0000 (11:40 +0530)]
Start continuous detection only on sensors present in monitor
Instead of always starting continuous detection, start only when particular
environmental sensor is being detected by atleast one application.
Change-Id: I0e4baac40074fcd7b1cedf139dfe1e773b1c7049
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Lokesh [Mon, 11 Nov 2019 01:43:55 +0000 (07:13 +0530)]
In detection_stopped event, consider when no environmental sensors exist
1/ If there is no environmental sensor, send UAM_DETECTION_CYCLE_END only once.
2/ First update service->remaining_time, then start various detections.
3/ Environmental sensors may send detection_stopped before start_detection of
connectivity sensor, which results in multiple detection stopped events to CAPI
within a detection window.
Change-Id: I1c149fe8be8f3f86bf053ac8167df765948df72e
Signed-off-by: Lokesh <l.kasana@samsung.com>
Lokesh [Wed, 6 Nov 2019 10:12:39 +0000 (15:42 +0530)]
Detection stopped event updated with detection cycle mid/end
Every one minute we receive environmental presence/absence and detection
stopped calls. Earlier _uam_core_handle_detection_stopped() sends
detection_stopped_event which then called __ua_user_state_clean() and
cleaned recorded WIFI/BLE data in CAPI. Hence it cannot be used for
next one minute cycles of environmental sensors.
Change-Id: Ibad4cbf5e05840b31a593984a0f00f1ca4b72ae9
Signed-off-by: Lokesh <l.kasana@samsung.com>
Lokesh [Thu, 7 Nov 2019 08:40:25 +0000 (14:10 +0530)]
Fix first detection stopped callback due to motion sensor
_uam_core_handle_detection_stopped() should work only if detection has been
started on that sensor previously.
Change-Id: I32b04ed63bc108606a59c0d64066cf9efa42ad52
Signed-off-by: Lokesh <l.kasana@samsung.com>
saerome.kim [Thu, 14 Nov 2019 03:37:49 +0000 (12:37 +0900)]
Fix memory leak
- Problem: during aging test, heap is increasing bit by bit.
- Cause: when updating the device list, the BLE payload is not freed.
- Solution: release BLE payload after updating the device list.
Change-Id: I2019643888883ca1c53ea16d9565e178ab6ec28f
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Mon, 11 Nov 2019 10:34:35 +0000 (19:34 +0900)]
Add functionality that allow changing user's name
- Problem: Users want to change their name.
- Cause: it is not supported to change the user name once user information
added to ua-manager DB.
- Solution: Make the user can change his name even user-information added.
Change-Id: I54901e5c24da13239e8cce7d35063d15ed6ca975
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Abhay agarwal [Mon, 11 Nov 2019 07:40:05 +0000 (13:10 +0530)]
Fix crash issue on sensor status change event
ua-manager crash was observed with sensor status change event
Destination: [(null)], event: [UNKNOWN ERROR], signal: [SensorStatusChanged]
Change-Id: I04610425e6019c51d3bd083ee59084a706e93eff
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
saerome.kim [Fri, 8 Nov 2019 09:46:19 +0000 (18:46 +0900)]
Add the compiler flag required for performing GTest
Change-Id: I3d3b21e4f0dc34e351dd060d4aeff5a72fbee575
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Fri, 8 Nov 2019 08:52:10 +0000 (17:52 +0900)]
Fixed the problem where enabler method fails
- Problem: The net.uamd.enabler method call fails.
- Cause: Invoke the 'enable' method to an object is not registered in
dbus system.
- Solution: Remove 'enabler' interface and combine 'enabler' to
'/net/uamd' interface
Change-Id: Ia40394ceb7d83a4305b0c0ab953ea6ffc423f9df
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Fri, 8 Nov 2019 08:44:37 +0000 (17:44 +0900)]
Apply secure option
- Problem: There is no FORTIFY option.
- Cause: Unlike the SSP that catches the stack BOF, a protection technique is
needed to catch the BOF that occurs in a general memory buffer.
- Solution: apply FORTIFY and stack-canar options.
Change-Id: I1c1d45f1edfb0e017bdd8a3a3c1f42469f324220
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Fri, 8 Nov 2019 06:19:09 +0000 (15:19 +0900)]
Fix the problem of not removing the device added to the default user or service
- Problem: can't remove a device from default-user.
- Cause: A device can be added to a default user or a default service,
but can not be deleted.
- Solution: Deleting the default user checker.
Change-Id: I7bcce4fd4ac45e411e1be19fb793cf1532d366f7
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
saerome.kim [Fri, 8 Nov 2019 06:02:23 +0000 (15:02 +0900)]
Countermeasure if time() returns -1
- Problem: timestamp value may contain abnormal value.
- Cause: time() can retuern -1.
- Solution: We agreed to set the timestamp to 0 when time() returns -1.
Change-Id: I8d6189212589d28f09bac75b6075d7652415f4c7
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
Lokesh [Tue, 5 Nov 2019 08:55:43 +0000 (14:25 +0530)]
Set default values for payload
Change-Id: I2d863d2c0ff566bab6a5910613adc6912adddc38
Signed-off-by: Lokesh <l.kasana@samsung.com>
Abhay agarwal [Mon, 4 Nov 2019 15:28:37 +0000 (20:58 +0530)]
Improve error handling by returning error code
Change-Id: Idb6b9e9f2076972a0a4d4a2dedd173d7badfbc48
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Mon, 4 Nov 2019 05:35:20 +0000 (11:05 +0530)]
Remove duplicate code to copy device
Change-Id: Idb87db47775d437a19d9c18f4321de6e41870f4f
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Mon, 4 Nov 2019 04:38:29 +0000 (10:08 +0530)]
Return error code while handling devices
- Improve error handling by returning error code
Change-Id: I6d0da4c9a819345b808aaa913c2fa31e00f431a4
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
Abhay agarwal [Thu, 31 Oct 2019 06:16:07 +0000 (11:46 +0530)]
Modify DB transactions to return when fail
- Problem: If the transaction fails, more queries are being run on database
to insert/update/delete data from it without starting the transaction.
- Solution: Rollback and return from the function when transaction fails.
Change-Id: I086e56cae6a4964925fd8ee63b486469fe052314
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>