summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtul Rai <a.rai@samsung.com>2019-07-05 10:58:15 +0530
committersaerome kim <saerome.kim@samsung.com>2019-07-08 08:06:28 +0900
commit164c38f4ebc015720d5fa2f5e12b275cb20c3c4c (patch)
treeb6cc5afa65c0fc3283f7dc59eb31117611f1ab10
parenta43dea13ffbee6fd516f07a5db760efec90a04db (diff)
downloaduser-awareness-164c38f4ebc015720d5fa2f5e12b275cb20c3c4c.tar.gz
user-awareness-164c38f4ebc015720d5fa2f5e12b275cb20c3c4c.tar.bz2
user-awareness-164c38f4ebc015720d5fa2f5e12b275cb20c3c4c.zip
Added API for resetting user database
Change-Id: I08eac5c5496e319caa02908855ca157fc5183887 Signed-off-by: Atul Rai <a.rai@samsung.com>
-rw-r--r--include/user-awareness-internal.h2
-rw-r--r--src/user-awareness-monitors.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/include/user-awareness-internal.h b/include/user-awareness-internal.h
index c27a12a..ae36039 100644
--- a/include/user-awareness-internal.h
+++ b/include/user-awareness-internal.h
@@ -195,6 +195,8 @@ int ua_set_detection_window(unsigned int window);
*/
int ua_get_detection_window(unsigned int* window);
+int ua_reset_database(void);
+
/**
* @}
*/
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c
index b0a974f..93b932a 100644
--- a/src/user-awareness-monitors.c
+++ b/src/user-awareness-monitors.c
@@ -1353,4 +1353,19 @@ int ua_get_detection_window(unsigned int* window)
return UA_ERROR_NONE;
}
+int ua_reset_database(void)
+{
+ FUNC_ENTRY;
+ int ret;
+
+ ret = _ua_get_error_code(_uam_db_reset());
+ if (UA_ERROR_NONE != ret) {
+ UA_ERR("_uam_service_remove_device returned %s",
+ _ua_get_error_string(ret));
+ return ret;
+ }
+
+ FUNC_EXIT;
+ return UA_ERROR_NONE;
+}
/* LCOV_EXCL_STOP */