summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-12-05[Fix] Send user_cb for every usersubmit/tizen_5.5_wearable_hotfix/20201026.184302submit/tizen_5.5/20191205.122148accepted/tizen/5.5/unified/wearable/hotfix/20201027.121639accepted/tizen/5.5/unified/20191206.013117tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5accepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unifiedLokesh2-6/+13
And send user_cb with null user, in case AND_OR conditions have env sensors only Change-Id: Iad6f15d38589a13a0bdef8499a8ffc182c15fc18 Signed-off-by: Lokesh <l.kasana@samsung.com>
2019-12-05Check sensors of monitor when setting AND/OR conditionLokesh1-10/+4
Instead of global avialable sensors. Change-Id: Ief7c3ee87a5f3adbea790d6d7e1e966e1499002c Signed-off-by: Lokesh <l.kasana@samsung.com>
2019-12-03Reset detected bitmask when STOP command receivedsaerome.kim2-85/+9
- 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: I91ef081509b308174b868f6935067da3d2ce5468 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-21Fix crash of ua-test app.submit/tizen_5.5/20191129.113305submit/tizen_5.5/20191129.060250submit/tizen_5.5/20191126.004230submit/tizen_5.5/20191122.014238accepted/tizen/5.5/unified/20191203.011219accepted/tizen/5.5/unified/20191203.011213accepted/tizen/5.5/unified/20191203.011206accepted/tizen/5.5/unified/20191203.011154saerome.kim11-48/+50
- 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: I8a207229eb6aa4b60ec98556c792fd20db070b32 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-19Support multiple timestamp for each servicesubmit/tizen/20191119.081157accepted/tizen/5.5/unified/20191120.034608Lokesh2-1/+2
Change-Id: I20647e7ec81318ab91887dc72b452f00fcb42cb0 Signed-off-by: Lokesh <l.kasana@samsung.com>
2019-11-15Pass the error in ua_user_foreach_added()submit/tizen_5.5/20191115.102057accepted/tizen/5.5/unified/20191118.084850Lokesh4-10/+8
Change-Id: Ia9b8a7371dd49c235ebe878e443c2e497363d32c Signed-off-by: Lokesh <l.kasana@samsung.com>
2019-11-15Change a parameter in ua_device_get_last_presence()saerome.kim5-118/+8
- 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: Ie729f1b0c8e19cebaec44230f650ad770529c929 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-15Start detection only on sensor available in monitorAbhay agarwal3-3/+113
Change-Id: Ia6f9f081c0d15d740e57115ff83bf42edee8fe10 Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
2019-11-15Detection stopped event updated with detection cycle mid/endLokesh3-14/+31
Clean user_state only when it is end of detection cycle. Change-Id: Icaffcfc7263094c1b7d9c85b771f8d6a8368beea Signed-off-by: Lokesh <l.kasana@samsung.com>
2019-11-15Add invalid parameter check in ua_user_foreach_added()Nishant Chaprana2-1/+3
When foreach_cb parameter is NULL, API should return invalid parameter error. Change-Id: I1196b7f3a7134f5f40ab8e10f22c37379346ea7d Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2019-11-15Fix the problem that sensor_status_changed_cb is not calledsaerome.kim2-4/+2
- 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. The the internal flag is set only if ABSENCE detection invoked. - Solution: remove the internal flag. Change-Id: Ide40b46073cde5c1fff78b247ff937c5c3982821 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-15Add ua_user_update APIsaerome.kim5-28/+100
- 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: Iab298a8f1f18e5ed17cd5dc6ca4bb016404cefef Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-08Apply secure optionsaerome.kim2-3/+11
- 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: Ifd845013948abd9384d36d3b576b4af00cdb8814 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-08Fixed the issue that the device and user can not be detectedsaerome.kim2-2/+1
- 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: Ic2734b91058abb0562fe01f6a1b05eb29a9b8498 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-08Set-default-values-for-payloadLokesh2-6/+11
Change-Id: Id334cc0ce21ca708f5a8eccdb556009255549dac Signed-off-by: Lokesh <l.kasana@samsung.com>
2019-11-06Fix the problem that timestamp is not included in user_presence_detected_cbsaerome.kim4-3/+14
- 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: Ieeada0d9a714dfdbfe74b6599bba77e1107ef90c Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-05Fix the issue that always notifies that ABSENCE has been detectedsaerome.kim2-1/+6
- 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>
2019-11-04Change error typesaerome.kim3-13/+12
- 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: I6845ac43950cf907633b9d9b9a34a907fb9d29f1 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-04Fix a crash issuesaerome.kim1-2/+15
- 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: I3005386a57f9ebaf1843676a4f0ffe6b2d2497c7 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-04Remove useless handle checkersaerome.kim7-134/+196
- Problem: can't clone any device. - Cause: There is useleess handle comparison at ua_device_clone. - Solution: Remove them. Change-Id: I3e936e596108718d9126851c5c48ec25b500796f Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-04Modify to create a device-list at a client application starts.saerome.kim5-4/+67
- 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: I0e2d6adcb827d4e381c505c525bdbc92d3c186a7 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-01Modify the test app to support service functionalitysubmit/tizen_5.5/20191101.035514accepted/tizen/5.5/unified/20191104.111255saerome.kim10-813/+1063
- 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>
2019-11-01Modify UA CAPIsaerome.kim6-100/+308
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>
2019-11-01Fix the problem that status_changed_cb is not reportedsaerome.kim2-5/+17
- 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>
2019-11-01Add power lock/unlock functionalitysaerome.kim1-5/+45
Change-Id: Ie22d72368421d5f55136b3d384c244f8c1ab4303 Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-01Fix a build error for 64-bit machinesaerome.kim1-1/+1
- 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>
2019-11-01Provide only NULL user callback if no connectivity sensor in AND/OR conditionAbhay agarwal2-3/+10
- 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>
2019-11-01Fix svace issuesaerome.kim5-9/+9
413217, 413218, 413219: signed to big unsigned issue. Change-Id: If1d7b3906f666a625407cbcd5c26e3c23095ca8e Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-01Modify uat-test that detection cases can be distinguish more clearysaerome.kim9-78/+165
Change-Id: Iddd83f882579b6eaac368749426ecb0932988c5f Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-11-01Fix the problem that the SF and UAF use different data formatsaerome.kim11-29/+29
- 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>
2019-11-01Add functionality to report instant sensor status changesaerome.kim8-24/+285
- 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>
2019-10-17Add new API to set low power modetizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185102submit/tizen_5.5/20191031.000002submit/tizen/20191018.005538accepted/tizen/unified/20191018.052938accepted/tizen/5.5/unified/mobile/hotfix/20201027.065752accepted/tizen/5.5/unified/20191031.031318tizen_5.5_mobile_hotfixaccepted/tizen_5.5_unified_mobile_hotfixsaerome.kim4-45/+98
- 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>
2019-10-17Modify APIs to set low power mode selectivelyAbhay agarwal4-11/+37
Change-Id: I249d3b3bba1294a21967a10c8247f9c294674957 Signed-off-by: Abhay agarwal <ay.agarwal@samsung.com>
2019-10-15Clean up codes for suspend/resume testsubmit/tizen/20191017.002636accepted/tizen/unified/20191017.035459saerome.kim3-15/+18
- 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>
2019-10-15Fixed svace issue.Abhay agarwal1-1/+2
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>
2019-10-14Provide user callback to applications as soon as possibleAbhay agarwal2-1/+18
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>
2019-10-11Modify test app to handle error from set and/or conditionsubmit/tizen/20191011.095843accepted/tizen/unified/20191014.005013Abhay Agarwal2-1/+9
Change-Id: I36b41ba265fc3db20412c496c2c151549be16caf Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2019-10-11Add API to get service detection thresholdsAbhay Agarwal3-5/+86
Change-Id: Ib34bbba2555157823d8e098faae08c5f9d4e69df Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2019-10-11Provide API to update serviceAbhay Agarwal3-5/+56
Change-Id: I85080d43b496762a1563b359ed3667e1a51b66f2 Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2019-10-11Update sensor handle list for user callbacksubmit/tizen/20191011.062256accepted/tizen/unified/20191011.101528Abhay Agarwal2-9/+18
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>
2019-10-11Provide user presence callback in case no user information presentsubmit/tizen/20191011.014757accepted/tizen/unified/20191011.080021Abhay Agarwal5-88/+155
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>
2019-10-08Fix coverity issues.submit/tizen/20191008.043811accepted/tizen/unified/20191008.101526saerome.kim6-1/+3
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>
2019-10-08Add NULL check before g_strlcpy operation in ua_user_remove_device()submit/tizen/20191008.005850accepted/tizen/unified/20191008.101535Nishant Chaprana1-1/+2
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>
2019-10-08Remove redundant g_strlcpy operation in ua_device_set_mac_address()Nishant Chaprana1-3/+2
Change-Id: I08371368c022492f9e922486efa768441a2083c4 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
2019-10-08Fix GLib-CRITICAL using NULL check before g_strlcpy()Nishant Chaprana1-1/+2
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>
2019-10-08Add null-check to prevent crash.saerome.kim3-6/+10
Change-Id: Ibaf4f40cf8a07c2cb974573378b320149d9a869f Signed-off-by: saerome.kim <saerome.kim@samsung.com>
2019-10-07Provide device added errors to applications through callbackAbhay Agarwal4-7/+11
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>
2019-10-07Update description of user callbacks to the doxygen commentssubmit/tizen/20191007.022831accepted/tizen/unified/20191007.234842Abhay Agarwal1-4/+14
Change-Id: I986d13362ec310957df7faa82832aa292b0c9df5 Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2019-10-04Provide sensor info in user absence detected callbackAbhay Agarwal3-57/+73
Change-Id: I5c7164a7dd9f8e71f7b5a6654f736ef71acd0a59 Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
2019-10-04Provide sensor information in user detection callbackAbhay Agarwal7-5/+145
Change-Id: I79c1256f8bd1ea21f8421d3964b573d6eba45cef Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>