platform/core/api/user-awareness.git
4 years agoModify the package version 48/240048/3 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.122518 accepted/tizen/6.0/unified/hotfix/20201103.004818 accepted/tizen/6.0/unified/hotfix/20201103.052140 accepted/tizen/unified/20200810.123046 submit/tizen/20200806.040127 submit/tizen/20200809.234730 submit/tizen_6.0/20201029.205102 submit/tizen_6.0_hotfix/20201102.192502 submit/tizen_6.0_hotfix/20201103.114802 tizen_6.0.m2_release
DoHyun Pyun [Mon, 3 Aug 2020 01:39:21 +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: Ib5b790c6aa2a70d6d2bc323740dbbfa4de251769
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
4 years agoFix typo for gcov build 27/231427/1 accepted/tizen/unified/20200423.054538 submit/tizen/20200422.035906
Cheoleun Moon [Wed, 22 Apr 2020 03:36:45 +0000 (12:36 +0900)]
Fix typo for gcov build

Change-Id: I138ea5d8d0b84a1318fe330b2591ff1db8709028
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
4 years agoua-test: Check bounds for tainted integer device uid length 39/224339/1 accepted/tizen/unified/20200210.131733 accepted/tizen/unified/20200218.145842 submit/tizen/20200210.035428 submit/tizen/20200218.012819
Abhay Agarwal [Tue, 4 Feb 2020 05:25:18 +0000 (10:55 +0530)]
ua-test: Check bounds for tainted integer device uid length

Integer value 'device_uid_len' is being obtained from untrusted source.
Bounds of device uid length needs to be checked before using it as a loop
bound.

Change-Id: Idcb1f9b67d099d9f3443166ae559c81c563632ad
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoua-test: Fix resource leak because of payload params 41/224241/1
Abhay Agarwal [Wed, 29 Jan 2020 04:53:02 +0000 (10:23 +0530)]
ua-test: Fix resource leak because of payload params

Change-Id: I19749aca6fef9caa82ddf40aa75dcacc88cdf3cb
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoRemove logically dead code 40/224240/1
Abhay Agarwal [Tue, 28 Jan 2020 10:11:46 +0000 (15:41 +0530)]
Remove logically dead code

Change-Id: Ibcae2066b83eefd37da237302bbda0f4e6cdd425
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoua-test: Check bounds for tainted integer device uid length 39/224239/1
Abhay Agarwal [Tue, 4 Feb 2020 05:25:18 +0000 (10:55 +0530)]
ua-test: Check bounds for tainted integer device uid length

Integer value 'device_uid_len' is being obtained from untrusted source.
Bounds of device uid length needs to be checked before using it as a loop
bound.

Change-Id: If7d99db801af3d662e1212b5550ba391a916f913
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
4 years agoFix gcc9 build failed : array-bounds error 48/221848/1 accepted/tizen/unified/20200109.065515 submit/tizen/20200108.150017
Jihoon Jung [Wed, 8 Jan 2020 14:01:03 +0000 (23:01 +0900)]
Fix gcc9 build failed : array-bounds error

Change-Id: Ic14f816d544168ad8ca558ec5d7731178841bf3f
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
4 years agoAdd Remark to free ble payload's user_data accepted/tizen/unified/20200101.120604 submit/tizen/20191230.073018
Nishant Chaprana [Mon, 30 Dec 2019 05:45:41 +0000 (11:15 +0530)]
Add Remark to free ble payload's user_data

Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
4 years agoFix coding guidelines issues
Abhay agarwal [Fri, 27 Dec 2019 07:25:49 +0000 (12:55 +0530)]
Fix coding guidelines issues

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agomodify ua-test app to show payload params in hex
Abhay agarwal [Fri, 27 Dec 2019 04:10:55 +0000 (09:40 +0530)]
modify ua-test app to show payload params in hex

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoGet payload device user data
Abhay agarwal [Thu, 26 Dec 2019 13:43:20 +0000 (19:13 +0530)]
Get payload device user data

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoSet length for payload device uid
Abhay agarwal [Thu, 26 Dec 2019 04:25:15 +0000 (09:55 +0530)]
Set length for payload device uid

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agomodify ua-test app to select and update payload
Abhay agarwal [Wed, 18 Dec 2019 05:36:03 +0000 (11:06 +0530)]
modify ua-test app to select and update payload

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoImplement get APIs to get payload information in ua-test app
Abhay agarwal [Wed, 18 Dec 2019 03:54:18 +0000 (09:24 +0530)]
Implement get APIs to get payload information in ua-test app

Get APIs implemented for payload
- ua_payload_get_primary_key()
- ua_payload_get_secondary_key()
- ua_payload_get_device_uid()
- ua_payload_get_device_icon()

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoAdd APIs to get list of added payload info
Abhay agarwal [Fri, 6 Dec 2019 12:02:41 +0000 (17:32 +0530)]
Add APIs to get list of added payload info

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoAdd API to insert device payload in a service
Abhay agarwal [Mon, 2 Dec 2019 07:19:32 +0000 (12:49 +0530)]
Add API to insert device payload in a service

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoAdd handle for payload
Abhay agarwal [Thu, 28 Nov 2019 11:37:18 +0000 (17:07 +0530)]
Add handle for payload

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoRename duid to device_uid
Abhay agarwal [Wed, 27 Nov 2019 06:56:00 +0000 (12:26 +0530)]
Rename duid to device_uid

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoRename ble payload purpose to secondary key
Abhay agarwal [Wed, 27 Nov 2019 06:36:31 +0000 (12:06 +0530)]
Rename ble payload purpose to secondary key

Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoRename ble payload service_id to primary_key
Abhay agarwal [Wed, 27 Nov 2019 06:10:11 +0000 (11:40 +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>
4 years agoFix format-truncation warning for gcc 9 02/221102/1 accepted/tizen/unified/20191230.050156 submit/tizen/20191230.005459
Jihoon Jung [Fri, 27 Dec 2019 14:58:32 +0000 (23:58 +0900)]
Fix format-truncation warning for gcc 9

Just increased the size of buffer

Change-Id: Id34aa0e44f996f2b259d9541dcef6ba00573294d
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
4 years ago[Fix] Send user_cb for every user accepted/tizen/unified/20191205.142701 submit/tizen/20191205.122156
Lokesh [Thu, 5 Dec 2019 09:36:15 +0000 (15:06 +0530)]
[Fix] Send user_cb for every user

And send user_cb with null user, in case AND_OR conditions have env sensors only

Change-Id: Id3640111c88fa68e8d65e2e273b5c77cb79e2f7a
Signed-off-by: Lokesh <l.kasana@samsung.com>
4 years agoCheck sensors of monitor when setting AND/OR condition
Lokesh [Thu, 5 Dec 2019 09:17:51 +0000 (14:47 +0530)]
Check sensors of monitor when setting AND/OR condition

Instead of global avialable sensors.

Change-Id: Ib7210dae128e3e627b027cfb1b877132046fb07b
Signed-off-by: Lokesh <l.kasana@samsung.com>
4 years agoReset detected bitmask when STOP command received
saerome.kim [Tue, 3 Dec 2019 08:34:06 +0000 (17:34 +0900)]
Reset detected bitmask when STOP command received

- Problem: PRESENCE is not detected after start -> stop -> start
  PRESENCE detection.
- Cause: When receiving the stop PRESENCE detection command,
  the previously detected sensor bitmask is not initialized.
- Solution: When the STOP PRESENCE command is received, initialize the detectedi
  bitmask.

Change-Id: I8893563e0d9f1379b19ac9a0680c9f17d25ecd71
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFix crash of ua-test app. accepted/tizen/unified/20191125.135545 accepted/tizen/unified/20191125.135550 accepted/tizen/unified/20191126.124638 submit/tizen/20191122.014017 submit/tizen/20191126.004258
saerome.kim [Wed, 20 Nov 2019 11:18:00 +0000 (20:18 +0900)]
Fix crash of ua-test app.

- Problem: The crash happened when reusing one after destroying the device.
- Cause: Use the device handle of the device list directly without cloning.
- Solution: Clone the device handle before manipulation.

Change-Id: I47d640c56ca8063e2038debf1f6427beefc587a1
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoSupport multiple timestamp for each service accepted/tizen/unified/20191119.133207 submit/tizen/20191119.082254
Lokesh [Mon, 18 Nov 2019 14:04:54 +0000 (19:34 +0530)]
Support multiple timestamp for each service

Change-Id: I44fe35d1aaacbecb3270ed5ad13fa3ae6a4e4ce1
Signed-off-by: Lokesh <l.kasana@samsung.com>
4 years agoPass the error in ua_user_foreach_added() accepted/tizen/unified/20191115.125558 submit/tizen/20191115.102151
Lokesh [Fri, 15 Nov 2019 08:39:15 +0000 (14:09 +0530)]
Pass the error in ua_user_foreach_added()

Change-Id: I5854b2ab9add067fd90ee1a946d85b7454f1dc5a
Signed-off-by: Lokesh <l.kasana@samsung.com>
4 years agoChange a parameter in ua_device_get_last_presence()
saerome.kim [Fri, 15 Nov 2019 07:48:03 +0000 (16:48 +0900)]
Change a parameter in ua_device_get_last_presence()

- Problem: The meaning of timestamp does not express the recent detection time.
- Cause: The timestamp in the API that was not originally intended
- Solution: Change the timestamp to last_seen.

Change-Id: I3a2f85111f817c0c112fc3dcea52bb7185aaf8d3
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoStart detection only on sensor available in monitor
Abhay agarwal [Mon, 11 Nov 2019 06:12:20 +0000 (11:42 +0530)]
Start detection only on sensor available in monitor

Change-Id: I63fb59c4cd33fbf933af8f6689f6d73df4b264ef
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoDetection stopped event updated with detection cycle mid/end
Lokesh [Wed, 6 Nov 2019 10:22:05 +0000 (15:52 +0530)]
Detection stopped event updated with detection cycle mid/end

Clean user_state only when it is end of detection cycle.

Change-Id: Iadd958c6048b8cf5935c8c85217709ada4942c51
Signed-off-by: Lokesh <l.kasana@samsung.com>
4 years agoAdd invalid parameter check in ua_user_foreach_added()
Nishant Chaprana [Fri, 15 Nov 2019 06:06:33 +0000 (11:36 +0530)]
Add invalid parameter check in ua_user_foreach_added()

When foreach_cb parameter is NULL, API should return invalid parameter error.

Change-Id: Ib5316b1a93c0abe7012f58c1b36988b4e271c34c
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
4 years agoFix the problem that sensor_status_changed_cb is not called
saerome.kim [Wed, 13 Nov 2019 05:24:50 +0000 (14:24 +0900)]
Fix the problem that sensor_status_changed_cb is not called

- problem: when only PRESENCE detectoin enabled, sensor_status_change_cb is not called
- cause: Check the internal flag that must be set before the sensor_status_change_cb is called.
         But the internal flag is set only if ABSENCE detection invoked.
- Solution: remove the internal flag.

Change-Id: I7d320596a4c9580b17a1d4bb9b7d6065b169b80e
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoAdd ua_user_update API accepted/tizen/unified/20191111.152605 submit/tizen/20191111.122616
saerome.kim [Mon, 11 Nov 2019 10:32:43 +0000 (19:32 +0900)]
Add ua_user_update API

- 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: I41e4d8c087af859e886b06c592797052c4e69fa8
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoApply secure option
saerome.kim [Fri, 8 Nov 2019 10:16:40 +0000 (19:16 +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: Idaddb614389bf6f8620720bb51c21128bbca0731
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFixed the issue that the device and user can not be detected
saerome.kim [Fri, 8 Nov 2019 06:12:41 +0000 (15:12 +0900)]
Fixed the issue that the device and user can not be detected

- Problem: If the timestamp is 0, the sensor and a user can not be detected.
- Cause: If the timestamp is 0, PRESENCE/ABSENCE detection result does not appear.
- Solution: remove timestamp-value checker.

Change-Id: If0fafe6c5f945fd58dc28be05fa1ec1511432c89
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoSet-default-values-for-payload
Lokesh [Tue, 5 Nov 2019 08:59:16 +0000 (14:29 +0530)]
Set-default-values-for-payload

Change-Id: I55037839ac4a6b34e70b7c0d83dd33e64504b4ce
Signed-off-by: Lokesh <l.kasana@samsung.com>
4 years agoFix the problem that timestamp is not included in user_presence_detected_cb
saerome.kim [Wed, 6 Nov 2019 03:54:25 +0000 (12:54 +0900)]
Fix the problem that timestamp is not included in user_presence_detected_cb

- Problem: Even if the user device is detected, the timestamp value is 0.
- Cause: The timestamp value is not applied to the detected device.
- Solution: Apply timestamp value to detected device info.

Change-Id: I08536397aa2ad021231289661de969bfb872221d
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFix the issue that always notifies that ABSENCE has been detected
saerome.kim [Mon, 4 Nov 2019 23:47:21 +0000 (08:47 +0900)]
Fix the issue that always notifies that ABSENCE has been detected

- Problem: If ABSENCE is detected immediately after starting and stopping
  PRESENCE.
- Cause: If user_state is 0, then it is considered as an ABSENCE.
- Solution: Modified checking user_state condition if user_state is 0
  then it is not an ABSENCE.

Change-Id: I815ff4b36498d34f23a02a60da0d64c2fb3f5791
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoChange error type
saerome.kim [Mon, 4 Nov 2019 06:40:18 +0000 (15:40 +0900)]
Change error type

- Problem: A strange error code is returned when TC is executed.
- Cause: The error code does not express the exact meaning
- Solution: Change the error code with the proper one.

Change-Id: Ibb82083fc6cdf6178049a5a8cf83c52da206e67f
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFix a crash issue
saerome.kim [Thu, 31 Oct 2019 06:06:01 +0000 (15:06 +0900)]
Fix a crash issue

- Problem: crash happens when executing UTC.
- Cause: A memory allocation of the device is freed when
  ua_device_destry() called, but linked list is not removed.
- Solution: Remove the link in the list when ua_device_destroy() called.

Change-Id: Idcb8bf0a54aac101aa41e7fe6d23db8d78222d91
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoRemove useless handle checker
saerome.kim [Thu, 31 Oct 2019 06:06:01 +0000 (15:06 +0900)]
Remove useless handle checker

- Problem: can't clone any device.
- Cause: There is useleess handle comparison at ua_device_clone.
- Solution: Remove them.

Change-Id: Idee58777a86be96b51bf3896326a3be2a6d70644
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoModify to create a device-list at a client application starts.
saerome.kim [Wed, 30 Oct 2019 03:14:44 +0000 (12:14 +0900)]
Modify to create a device-list at a client application starts.

- Problem: If the device list is not updated, the device information cannot
  be updated.
- Cause: ua-manager and device list in client applications are not the same.
- Solution: Synchronizes the device list with ua-manager when running a client app.

Change-Id: I6831b2670f061f4beef6ae28260797ba48391d44
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoModify the test app to support service functionality accepted/tizen/unified/20191101.042013 submit/tizen/20191030.083316
saerome.kim [Mon, 28 Oct 2019 12:11:31 +0000 (21:11 +0900)]
Modify the test app to support service functionality

- Problem: Can't remove/add devices or users to a service
- Cause: The request goes to the service module includes a useless data that
  the current instance does not have is ignored.
- Solution: Make userless data ignore and modified a ua-test app to explain
  how to manipulate the service functionality.

Change-Id: I913a5f7f2722bc473bdd50605c79630860fc2285
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoModify UA CAPI
saerome.kim [Mon, 28 Oct 2019 12:03:05 +0000 (21:03 +0900)]
Modify UA CAPI

1. Add new APIs
ua_user_clone()
ua_user_get_by_account()
ua_user_foreach_added_devices()

2. Change name
ua_service_added_service_cb() -> ua_service_added_cb()

3. Deprecated
ua_device_foreach_added_by_user()

Change-Id: Idf8e92eec507b35ac8126da7ca969bebc4555ac8
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFix the problem that status_changed_cb is not reported
saerome.kim [Fri, 25 Oct 2019 03:38:59 +0000 (12:38 +0900)]
Fix the problem that status_changed_cb is not reported

- Problem: Without ABSENCE detection, status_changed_cb never be
  notified.
- Cause: Make decision whether ABSNECE detection is started or not.
- Solution: When at least one more detection started, make
  status_changed_cb be called continously.

Change-Id: Ic98982884b51b887619bb14259ae1d662be76d26
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoAdd power lock/unlock functionality
saerome.kim [Fri, 25 Oct 2019 00:08:06 +0000 (09:08 +0900)]
Add power lock/unlock functionality

Change-Id: Ie22d72368421d5f55136b3d384c244f8c1ab4303
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFix a build error for 64-bit machine
saerome.kim [Thu, 24 Oct 2019 22:40:50 +0000 (07:40 +0900)]
Fix a build error for 64-bit machine

- Problem: build error during test-hub
- Cause: The reason for the error is that the compiler suspects we might be
  trying to round-trip a pointer through int and back. This was common
  practice before the advent of 64-bit machines and it is not safe or reasonable.
- Solution: replace 'int' type-casting with 'intptr_t'.

Change-Id: I0fe0f8c4e8ebf6af45eb714f8284b7bc9371d1f8
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoProvide only NULL user callback if no connectivity sensor in AND/OR condition submit/tizen/20191024.123502
Abhay agarwal [Wed, 23 Oct 2019 13:15:01 +0000 (18:45 +0530)]
Provide only NULL user callback if no connectivity sensor in AND/OR condition

- Problem: In case connectivity sensor is detected but not included in AND/OR
we are providing user callback for detected user
- Solution: Only provide user callback with NULL user and block other callbacks

Change-Id: I08150f2821e326d43bf0745ee4bfa4369e5af942
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
4 years agoFix svace issue
saerome.kim [Tue, 22 Oct 2019 08:11:31 +0000 (17:11 +0900)]
Fix svace issue

413217, 413218, 413219: signed to big unsigned issue.

Change-Id: If1d7b3906f666a625407cbcd5c26e3c23095ca8e
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoModify uat-test that detection cases can be distinguish more cleary
saerome.kim [Tue, 22 Oct 2019 07:30:58 +0000 (16:30 +0900)]
Modify uat-test that detection cases can be distinguish more cleary

Change-Id: Iddd83f882579b6eaac368749426ecb0932988c5f
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoFix the problem that the SF and UAF use different data format
saerome.kim [Mon, 21 Oct 2019 12:00:23 +0000 (21:00 +0900)]
Fix the problem that the SF and UAF use different data format

- Problem: The data format of timestamp is not different from the sensor
  framework.
- Cause: The UAF uses 32 bit timestamp but the sensor framework uses 64
  bit timestamp.
- Solution: Change timestamps in UAF with 64-bit unsigned long long.

Change-Id: I174627c17a17e5f59c2f9c04ed78f81b12ff0ebe
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
4 years agoAdd functionality to report instant sensor status change
saerome.kim [Mon, 21 Oct 2019 11:55:53 +0000 (20:55 +0900)]
Add functionality to report instant sensor status change

- Problem: in ABSENCE case, even the motion sensor detects ABSENCE
ua-manager reports this ABSENCE state after the detection window complete.
- Cause: If ABSENCE case, the ABSENCE can be jurged only when the
detction window complete.
- Solution: Whenever the sensor status is changed, plugin reports status
changed event immediately so that the user can recognize ABSENCE event
takes place during uncompleted ABSENCE detection window.

Change-Id: I49254770cbab1c55aac7b9b893c5eec8d54139cf
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoAdd new API to set low power mode accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.031318 accepted/tizen/5.5/unified/mobile/hotfix/20201027.065752 accepted/tizen/unified/20191018.052938 submit/tizen/20191018.005538 submit/tizen_5.5/20191031.000002 submit/tizen_5.5_mobile_hotfix/20201026.185102 tizen_5.5.m2_release
saerome.kim [Thu, 17 Oct 2019 09:26:52 +0000 (18:26 +0900)]
Add new API to set low power mode

- Problem: it is needed that new API that can set low power mode
- Cause: without adding new API, build break occurs.
- Solution: add new API to set low power mode.

Change-Id: I2e9269003238973f29424a017c0b9f56c18b4b6d
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoModify APIs to set low power mode selectively
Abhay agarwal [Thu, 17 Oct 2019 04:18:50 +0000 (09:48 +0530)]
Modify APIs to set low power mode selectively

Change-Id: I249d3b3bba1294a21967a10c8247f9c294674957
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
5 years agoClean up codes for suspend/resume test accepted/tizen/unified/20191017.035459 submit/tizen/20191017.002636
saerome.kim [Tue, 15 Oct 2019 11:02:12 +0000 (20:02 +0900)]
Clean up codes for suspend/resume test

- Problem: suspend/resume seem not to work correctly.
- Cause: sequence for calling power API is not working.
- Solution: fix the sequence for callign power API and test scenario.

Change-Id: I80977b9d51137cfe29684a514bbfbe3b37de21fd
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoFixed svace issue.
Abhay agarwal [Mon, 14 Oct 2019 07:12:07 +0000 (12:42 +0530)]
Fixed svace issue.

386398: Dynamic memory referenced by 'name' was allocated by calling function
        'ua_service_get_name' at uat-service.c:85 and lost at uat-service.c:97.

Change-Id: I06a43c1699632465e05dfe04b104044631f4b1fc
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
5 years agoProvide user callback to applications as soon as possible
Abhay agarwal [Mon, 14 Oct 2019 07:12:07 +0000 (12:42 +0530)]
Provide user callback to applications as soon as possible

Provide user callback earlier instead of waiting for detection window to complete.
Callback is provided as soon as the AND/OR condition for a particular user is met.
This will result in missing of device/sensor information in callback provided for
the device/sensor detected after sending callback.

Change-Id: I7a5a1912a66ec932ef261f74f354d4717994decf
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
5 years agoModify test app to handle error from set and/or condition accepted/tizen/unified/20191014.005013 submit/tizen/20191011.095843
Abhay Agarwal [Fri, 11 Oct 2019 08:11:35 +0000 (17:11 +0900)]
Modify test app to handle error from set and/or condition

Change-Id: I36b41ba265fc3db20412c496c2c151549be16caf
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoAdd API to get service detection thresholds
Abhay Agarwal [Fri, 11 Oct 2019 06:26:42 +0000 (15:26 +0900)]
Add API to get service detection thresholds

Change-Id: Ib34bbba2555157823d8e098faae08c5f9d4e69df
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide API to update service
Abhay Agarwal [Fri, 11 Oct 2019 04:48:29 +0000 (13:48 +0900)]
Provide API to update service

Change-Id: I85080d43b496762a1563b359ed3667e1a51b66f2
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoUpdate sensor handle list for user callback accepted/tizen/unified/20191011.101528 submit/tizen/20191011.062256
Abhay Agarwal [Fri, 11 Oct 2019 02:29:50 +0000 (11:29 +0900)]
Update sensor handle list for user callback

Provide handle of sensors which are also present in AND/OR condition
This patch also fix AND/OR condition when only one condition is applied

Change-Id: I8ca7299c5eaffffb4f07d230626c1a5cdd1df50c
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide user presence callback in case no user information present accepted/tizen/unified/20191011.080021 submit/tizen/20191011.014757
Abhay Agarwal [Thu, 10 Oct 2019 07:51:06 +0000 (16:51 +0900)]
Provide user presence callback in case no user information present

AND/OR condition being used to provide user presence callback can get satisfied
without user information also with the presence of environmental sensors.
This patch also modifies to provide user callback at the end of detection window
to provide application with more detection data.

Change-Id: I3236762071303e565d689b66dc1261cb98c27bc3
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoFix coverity issues. accepted/tizen/unified/20191008.101526 submit/tizen/20191008.043811
saerome.kim [Tue, 8 Oct 2019 01:47:20 +0000 (10:47 +0900)]
Fix coverity issues.

1087649: leaked_storage: Variable sensor_info going out of scope leaks
         the storage it points to.
1087675: leaked_storage: Variable sensor_info going out of scope leaks
         the storage it points to.

Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoAdd NULL check before g_strlcpy operation in ua_user_remove_device() accepted/tizen/unified/20191008.101535 submit/tizen/20191008.005850
Nishant Chaprana [Mon, 7 Oct 2019 12:35:44 +0000 (18:05 +0530)]
Add NULL check before g_strlcpy operation in ua_user_remove_device()

The ua_user_remove_device() returns INVALID_PARAMETER error
when both device_id and mac are NULL.
However when device_id is only NULL and mac is not NULL
then Glib warning will be generated.

Change-Id: I26a21db9659866d3e1a2e6ded9722e9897e958d9
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
5 years agoRemove redundant g_strlcpy operation in ua_device_set_mac_address()
Nishant Chaprana [Mon, 7 Oct 2019 12:28:23 +0000 (17:58 +0530)]
Remove redundant g_strlcpy operation in ua_device_set_mac_address()

Change-Id: I08371368c022492f9e922486efa768441a2083c4
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
5 years agoFix GLib-CRITICAL using NULL check before g_strlcpy()
Nishant Chaprana [Mon, 7 Oct 2019 11:43:44 +0000 (17:13 +0530)]
Fix GLib-CRITICAL using NULL check before g_strlcpy()

This patch removes below glib's critical warning:-
    GLib-CRITICAL **: g_strlcpy: assertion 'src != NULL' failed

Below is the backtrace when glib warning is generated:-
    (gdb) bt full
    #0  0xb6176f14 in g_log () from /usr/lib/libglib-2.0.so.0
    No symbol table info available.
    #1  0xb61774f8 in g_return_if_fail_warning () from /usr/lib/libglib-2.0.so.0
    No symbol table info available.
    #2  0xb6191320 in g_strlcpy () from /usr/lib/libglib-2.0.so.0
    No symbol table info available.
    #3  0xb610ec90 in ua_user_add_device (
     user_handle=user_handle@entry=0xb0c8ec50,
     device_handle=device_handle@entry=0xb0e00a90,
     callback=0x4064a1 <_ua_user_device_added_cb>,
     user_data=user_data@entry=0x0)
     at /usr/src/debug/capi-network-ua-0.11.2/src/user-awareness-users.c:835
     __func__ = "ua_user_add_device"
     ret = <optimized out>
     handle = 0x0
     temp_handle = 0x0
     device = 0xb0e00a90
     user = <optimized out>
     uam_device = {operating_system = UAM_OS_TYPE_TIZEN,
       type = UAM_TECH_TYPE_WIFI, mac = "ab:cd:ef:gh:ij:kl",
       ipv4_addr = '\000' <repeats 49 times>,
       device_id = '\000' <repeats 49 times>, payload = {
     service_id = 0 '\000', device_icon = 0 '\000', purpose = 0 '\000',
     duid = '\000' <repeats 17 times>,
     bt_mac = '\000' <repeats 17 times>}, discriminant = 1,
       last_seen = 0}

Change-Id: I25b7f26b18c6ff8bfff3522c653d66128f1eafd7
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
5 years agoAdd null-check to prevent crash.
saerome.kim [Mon, 7 Oct 2019 08:33:26 +0000 (17:33 +0900)]
Add null-check to prevent crash.

Change-Id: Ibaf4f40cf8a07c2cb974573378b320149d9a869f
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoProvide device added errors to applications through callback
Abhay Agarwal [Mon, 7 Oct 2019 04:17:08 +0000 (13:17 +0900)]
Provide device added errors to applications through callback

This commit provides the errors received from ua-manager in adding a device.
This also provide modifications to always reset the callback states.

Change-Id: I65b5a0be9807576027435918cbf769ef9b74403e
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoUpdate description of user callbacks to the doxygen comments accepted/tizen/unified/20191007.234842 submit/tizen/20191007.022831
Abhay Agarwal [Mon, 7 Oct 2019 01:43:38 +0000 (10:43 +0900)]
Update description of user callbacks to the doxygen comments

Change-Id: I986d13362ec310957df7faa82832aa292b0c9df5
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide sensor info in user absence detected callback
Abhay Agarwal [Fri, 4 Oct 2019 11:20:04 +0000 (20:20 +0900)]
Provide sensor info in user absence detected callback

Change-Id: I5c7164a7dd9f8e71f7b5a6654f736ef71acd0a59
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide sensor information in user detection callback
Abhay Agarwal [Fri, 4 Oct 2019 10:39:01 +0000 (19:39 +0900)]
Provide sensor information in user detection callback

Change-Id: I79c1256f8bd1ea21f8421d3964b573d6eba45cef
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoAdd API to get service specific device discriminant
Abhay Agarwal [Fri, 4 Oct 2019 07:05:12 +0000 (16:05 +0900)]
Add API to get service specific device discriminant

Change-Id: I4651c96e27ac8fae5f98ceae4e198becc444260a
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoservice specific device discriminant
Abhay Agarwal [Mon, 30 Sep 2019 10:34:39 +0000 (19:34 +0900)]
service specific device discriminant

Change-Id: Idff3ea4d729aa408c51152dee5bfd49c4bf3bf98
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoFixed coverity issues accepted/tizen/unified/20191004.003621 submit/tizen/20191002.073539
saerome.kim [Wed, 2 Oct 2019 06:07:58 +0000 (15:07 +0900)]
Fixed coverity issues

1087645 leaked_storage: Variable sensor_info going out of scope leaks the
        storage it points to
1087646 var_deref_model: Passing null pointer sensor_info to
        __send_sensor_presence_event, which dereferences it.
1087649 leaked_storage: Variable sensor_info going out of scope leaks the
        storage it points to

Change-Id: I7c5a080c876c2f43ac3b6ab4fde008bba97894fd
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoFree the unused memory for sensor info struct submit/tizen/20191001.125608
Abhay Agarwal [Tue, 1 Oct 2019 11:31:26 +0000 (20:31 +0900)]
Free the unused memory for sensor info struct

This commit fix the issue of memory corruption because of unused memory
by ua_sensor_info_s struct and free the memory.

Change-Id: I9f8b0bfea9e51f9993b81c79f1e706452a56b40c
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoAdd API set to get sensor information from sensor handle
Abhay Agarwal [Tue, 1 Oct 2019 10:09:47 +0000 (19:09 +0900)]
Add API set to get sensor information from sensor handle

This commit add an API set which can be used by the application to get the detected
sensor information of the sensor using sensor handle.

Change-Id: I10dec7bd427ab5d616bb6860f68e4d318d1234fe
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agouse sensor handle to send sensor information to application
Abhay Agarwal [Tue, 1 Oct 2019 09:19:22 +0000 (18:19 +0900)]
use sensor handle to send sensor information to application

This commit provides the sensor information to application using a sensor handle
instead of providing directly using sensor struct, so that sensor struct need not
to be disclosed to the application.

Change-Id: Iab7ff5c6898404412f0fbb3d2d3586f2306d3237
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide sensor info in absence callback
Abhay Agarwal [Tue, 1 Oct 2019 05:38:52 +0000 (14:38 +0900)]
Provide sensor info in absence callback

Change-Id: I82a70cbe2312d035f3167fe8f789f92b0eae1148
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoModify callback signature for sensor_presence_cb
Abhay Agarwal [Tue, 1 Oct 2019 04:17:26 +0000 (13:17 +0900)]
Modify callback signature for sensor_presence_cb

This patch modify callback sensor_presence_cb to not provide sensor information
using user data and add a seprate field for this parameter.

Change-Id: Ia0c6159225be99595516f9dc10ecf58f2e16fa16
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide detected sensor information in ALL Mode accepted/tizen/unified/20191002.013420 submit/tizen/20191001.112138
Abhay Agarwal [Tue, 1 Oct 2019 02:04:21 +0000 (11:04 +0900)]
Provide detected sensor information in ALL Mode

Change-Id: Ia5247115d8ecf22faff6cc48f826775ec77c55c5
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoSend only device handle instead of list during sensor callback
Abhay Agarwal [Mon, 30 Sep 2019 11:11:07 +0000 (20:11 +0900)]
Send only device handle instead of list during sensor callback

Change-Id: I81cb02c458ffe49da531bb70d336ff3e041e0dfe
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoProvide device information in sensor callback
Abhay Agarwal [Mon, 30 Sep 2019 03:56:41 +0000 (12:56 +0900)]
Provide device information in sensor callback

Change-Id: I16046cb0154bf143fb59c6f420b77db663136bad
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years ago[Crash Fix] Set global list variables back to NULL after g_slist_free_full() operation. accepted/tizen/unified/20190929.221445 submit/tizen/20190927.055416
Nishant Chaprana [Thu, 26 Sep 2019 13:31:41 +0000 (19:01 +0530)]
[Crash Fix] Set global list variables back to NULL after g_slist_free_full() operation.

Change-Id: I219130622e4d5471cf6f9ee6b30f911c8ff44d83
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
5 years agoFix buffer overflow issue
Abhay Agarwal [Thu, 26 Sep 2019 02:14:54 +0000 (11:14 +0900)]
Fix buffer overflow issue

Change-Id: I2e2ffc47bf5517015e0bbcad9b2cda9951a69b5f
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoAdd API to set light detection threshold
Abhay Agarwal [Wed, 25 Sep 2019 04:25:50 +0000 (13:25 +0900)]
Add API to set light detection threshold

Change-Id: Idef67a2c512af01aa3c14669c9c275a724946777
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoChanged presence_detected_cb in ua-test.
saerome.kim [Wed, 25 Sep 2019 23:49:06 +0000 (08:49 +0900)]
Changed presence_detected_cb in ua-test.

This version display sensor information when be called sensor callback.
So we changed the name of the exsiting __device_presence_detected_cb and
__device_absence_cb to __sensor_presence/absence_cb.

Change-Id: I5b384d7e1917cad57d1545eab314ae653f0a675b
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years ago[Fix] Allocate and free memory for sensor info
Abhay Agarwal [Tue, 24 Sep 2019 03:49:09 +0000 (12:49 +0900)]
[Fix] Allocate and free memory for sensor info

Change-Id: I7a1a2639c3b06e98fd3a2757d73e9fb6ef1b10e2
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoModified test app for sensor info in callback
Abhay Agarwal [Mon, 23 Sep 2019 10:03:45 +0000 (19:03 +0900)]
Modified test app for sensor info in callback

Change-Id: I79de27fcc552a788f348ffca6ad63c3edcec2539
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoSupport sensor info in detection callback
Abhay Agarwal [Fri, 20 Sep 2019 08:19:39 +0000 (17:19 +0900)]
Support sensor info in detection callback

Change-Id: I36d14926f676cc6ff1e3ffd988b670f0fad01e0d
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoSupport Add/Remove sensor during detection 39/214439/1
Abhay Agarwal [Thu, 19 Sep 2019 05:14:29 +0000 (14:14 +0900)]
Support Add/Remove sensor during detection

Change-Id: I7337191785ac65c251a549f058c294d7d19da7d1
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agocall stop presence detection only if started 38/214438/1
Abhay Agarwal [Wed, 18 Sep 2019 10:49:20 +0000 (19:49 +0900)]
call stop presence detection only if started

Change-Id: I569ea947646588105b5bf0cc7f987656f6e754cb
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
5 years agoChaged default detection cycle at ua-test app. 55/213955/1
saerome.kim [Tue, 17 Sep 2019 02:23:16 +0000 (11:23 +0900)]
Chaged default detection cycle at ua-test app.

Change-Id: I0a4ad435dc7d9e93265f67917b1c87fcebbdc7ea
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoUpdate detection cycle/window time accepted/tizen/unified/20190917.034102 submit/tizen/20190916.120818
Abhay agarwal [Mon, 2 Sep 2019 09:30:27 +0000 (15:00 +0530)]
Update detection cycle/window time

Change-Id: I43823c1502e9381c7476d10d974a81208a1e26e9
Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
5 years agoFix __ua_send_absence_detection() to store monitor->absence_detected_bitmask
Lokesh [Tue, 10 Sep 2019 11:38:20 +0000 (17:08 +0530)]
Fix __ua_send_absence_detection() to store monitor->absence_detected_bitmask

1/ fix user_sensor_bitmask in __ua_monitor_send_user_absence_cb()
2/ _uam_to_ua_sensor() is newly named

Changed uat-detection menu.
1/ change default detection type: ANY
2/ removed stop presence/detection menu

Change-Id: I30c3df499d080a080f22186c412aab3e447aaa9d
Signed-off-by: Lokesh <l.kasana@samsung.com>
5 years agofilter list of found_devices of a user based on sensors mentioned in AND/OR conditions
Lokesh [Mon, 9 Sep 2019 05:39:14 +0000 (11:09 +0530)]
filter list of found_devices of a user based on sensors mentioned in AND/OR conditions

Change-Id: I49c00ab54aa734506e4403b08f58fc04b2a4e9d7
Signed-off-by: Lokesh <l.kasana@samsung.com>
5 years agoMake '__ua_monitor_send_user_absence_cb' consistent with '__ua_monitor_send_user_pres...
Lokesh [Thu, 5 Sep 2019 11:51:18 +0000 (17:21 +0530)]
Make '__ua_monitor_send_user_absence_cb' consistent with '__ua_monitor_send_user_presence_cb'

Pass user_state pointer as the method parameter.

Change-Id: I7a10855f2aa3b12eee156b4855124255fe3e8ed0
Signed-off-by: Lokesh <l.kasana@samsung.com>
5 years agoChanged 'env_absence_bm' to 'env_absence_bitmask'
Lokesh [Thu, 5 Sep 2019 11:36:22 +0000 (17:06 +0530)]
Changed 'env_absence_bm' to 'env_absence_bitmask'

user_handle is checked to be non-null in __ua_monitor_send_user_presence_cb()

Change-Id: Ic0382c0c8a03887026943f78aebd5c1e2cdc1d16
Signed-off-by: Lokesh <l.kasana@samsung.com>
5 years agoFixed problem that cant'receive PRESENCE/ABSENCE if a least one device
saerome.kim [Wed, 4 Sep 2019 11:57:51 +0000 (20:57 +0900)]
Fixed problem that cant'receive PRESENCE/ABSENCE if a least one device
is not deceted.

Problem: PRESENCE/ABSENCE callback are not called if no device is detected.
Cause: monitor->presence_detected_bitmask might be updated in
       __a_sensor_presence_detected() according to the monitor->presence_mode.
       However, this function __ua_monitor_send_user_presence_cb() can be called
       before it is updated when "account" is valid.
Soultion: remove checking user_handle in __ua_monitor_send_user_presence_cb()

Change-Id: I6ce39a3e12c22d098a54d86abc165722495c43a7
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoCombined bitmask conditions menu and detection menu into one.
saerome.kim [Wed, 4 Sep 2019 01:33:13 +0000 (10:33 +0900)]
Combined bitmask conditions menu and detection menu into one.

Change-Id: Ibf8b870dfdaff8d4952966e0ecd8523313f7c3f5
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
5 years agoAdded logical conjunction operator in between AND/OR conditions of user_cb
Lokesh [Tue, 3 Sep 2019 11:34:09 +0000 (17:04 +0530)]
Added logical conjunction operator in between AND/OR conditions of user_cb

1/ Added enum 'ua_condition_conjunction_e'

Change-Id: I3b665d1a7610197945a4005ee7f0c92d78af429b
Signed-off-by: Lokesh <l.kasana@samsung.com>