Integrate changes from Tizen 2.4 46/42446/1
authorMu-Woong <muwoong.lee@samsung.com>
Mon, 29 Jun 2015 08:34:59 +0000 (17:34 +0900)
committerMu-Woong <muwoong.lee@samsung.com>
Mon, 29 Jun 2015 08:34:59 +0000 (17:34 +0900)
- Remove redundant doxygen comments. All detailed descriptions are inlcuded in the programming guide and the tutorial.
- Remove history record insertion APIs
- Apply Tizen coding rules to the header files
- Refactor history item - filter key pair validation routine
- Remove context_internal API set.
- Replace security-privilege-checker with libsmack
- Replace deprecated privilege_checker_check_package_privilege()

Change-Id: I2b8a0b505917f5e01cd8977d21b7dca39f83a8f2
Signed-off-by: Mu-Woong <muwoong.lee@samsung.com>
21 files changed:
CMakeLists.txt
doc/context_history_doc.h
doc/context_trigger_doc.h
include/context_history.h
include/context_history_types_internal.h
include/context_internal.h [deleted file]
include/context_trigger.h
include/context_trigger_types_internal.h
internal/CMakeLists.txt [deleted file]
internal/context_internal.cpp [deleted file]
packaging/context.spec
src/context_history.cpp
src/context_trigger.cpp
src/priv_util.cpp
src/rule_validator.h
test/CMakeLists.txt [deleted file]
test/src/main.c [deleted file]
test/src/utc_context_history.c [deleted file]
test/src/utc_context_history.h [deleted file]
test/src/utc_context_trigger.c [deleted file]
test/src/utc_context_trigger.h [deleted file]

index 6916b08..1c80c4d 100644 (file)
@@ -10,7 +10,7 @@ FILE(GLOB_RECURSE SRCS src/*.cpp)
 MESSAGE("Sources: ${SRCS}")
 
 # Dependencies
-SET(DEPS "aul bundle pkgmgr-info capi-security-privilege-manager capi-appfw-app-control context-common")
+SET(DEPS "aul bundle pkgmgr-info libsmack capi-appfw-app-control context-common")
 
 # Dependencies regarding profiles
 IF("${PROFILE}" STREQUAL "mobile")
@@ -54,7 +54,6 @@ INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeL
 INSTALL(
        DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service
        FILES_MATCHING PATTERN "*.h"
-       PATTERN "*_internal.h" EXCLUDE
 )
 
 SET(VERSION ${FULLVER})
@@ -73,10 +72,3 @@ CONFIGURE_FILE(
        @ONLY
 )
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-
-# Building internal test API
-ADD_SUBDIRECTORY(internal)
-
-#IF("${BINTYPE}" STREQUAL "engineer")  //TODO: Re-enabled later
-#      ADD_SUBDIRECTORY(test)
-#ENDIF("${BINTYPE}" STREQUAL "engineer")
index c08d9ab..617d984 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  * @section            CAPI_CONTEXT_HISTORY_MODULE_OVERVIEW Overview
  *
+ * An application can retrieve the user's device usages statistics and patterns via the contextual history API.
+ * This API mainly provides three categories of statistical usage patterns, including
+ * <i>application usage</i>, <i>peak time of activities</i>, and <i>common setting for activities</i>.
+ * See #context_history_data_e for all available statistic items.
+ * After choosing a statistic item to retrieve, a @em filter can be set to narrow down to the data you need.@n
+ * For more details about the available filter keys, and the data attributes provided by each item,
+ * please refer the programming guide and the tutorial.
  *
- * @subsection CAPI_CONTEXT_HISTORY_MODULE_Get To get contextual history data
- *The application can read derived contextual history data with <em>read</em> API provided by contextual history engine.
- *The data is mainly categorized to <i>Application Usage</i>, <i>Peak Time of Activity</i> and <i>Common Setting for Activity</i>. @n
- *To read desired data with contextual history API, you should set data type and filters to limit raw data set. Each data type has its corresponding possible filter types and result attributes. @n
- *Each data type also requires different types of privilege.
- *The following is the list of data type. An enumeration type is defined to #context_history_data_e.
- *
- *<ul>
- *     <li>#CONTEXT_HISTORY_RECENTLY_USED_APP @n
- *             Description : Returns recently used application list sorted by time in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/apphistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_WIFI_BSSID </td>
- *                     <td> string </td>
- *                     <td> Wi-Fi BSSID value to filter </td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_AUDIO_JACK </td>
- *                     <td> integer </td>
- *                     <td> Audio jack status #context_history_filter_audio_jack_e </td>
- *                     <td> X </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Total used count </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_DURATION </td>
- *                     <td> integer </td>
- *                     <td> Total used time in second </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_TIME </td>
- *                     <td> integer </td>
- *                     <td> Last used time in epoch time </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_FREQUENTLY_USED_APP @n
- *             Description : Returns frequently used application list sorted by used count in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/apphistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_WIFI_BSSID </td>
- *                     <td> string </td>
- *                     <td> Wi-Fi BSSID value to filter </td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_AUDIO_JACK </td>
- *                     <td> integer </td>
- *                     <td> Audio jack status #context_history_filter_audio_jack_e </td>
- *                     <td> X </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Total used count </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_DURATION </td>
- *                     <td> integer </td>
- *                     <td> Total used time in second </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_TIME </td>
- *                     <td> integer </td>
- *                     <td> Last used time in epoch time </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_RARELY_USED_APP @n
- *             Description : Returns rarely used application list sorted by time in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/apphistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Total used count </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_DURATION </td>
- *                     <td> integer </td>
- *                     <td> Total used time in second </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_TIME </td>
- *                     <td> integer </td>
- *                     <td> Last used time in epoch time </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_PEAK_TIME_FOR_APP @n
- *             Description : Returns peak time of application use list in hour sorted by used time in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/apphistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id to filter</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_DAY_OF_WEEK </td>
- *                     <td> integer </td>
- *                     <td> Weekdays or weekends #context_history_filter_day_of_week_e </td>
- *                     <td> X (Default : All days) </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_HOUR_OF_DAY </td>
- *                     <td> integer </td>
- *                     <td> Hour of day value(0~24) based on local time </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Event count </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC @n
- *             Description : Returns peak time of listening music list in hour sorted by used time in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_APP_ID </td>
- *                     <td> string </td>
- *                     <td> The player application's id to filter</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_DAY_OF_WEEK </td>
- *                     <td> integer </td>
- *                     <td> Weekdays or weekends #context_history_filter_day_of_week_e </td>
- *                     <td> X (Default : All days) </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_HOUR_OF_DAY </td>
- *                     <td> integer </td>
- *                     <td> Hour of day value(0~24) based on local time </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Event count </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO @n
- *             Description : Returns peak time of watching video list in hour sorted by used time in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_APP_ID </td>
- *                     <td> string </td>
- *                     <td> The player application's id to filter</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_DAY_OF_WEEK </td>
- *                     <td> integer </td>
- *                     <td> Weekdays or weekends #context_history_filter_day_of_week_e </td>
- *                     <td> X (Default : All days) </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_HOUR_OF_DAY </td>
- *                     <td> integer </td>
- *                     <td> Hour of day value(0~24) based on local time </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Event count </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_COMMON_SETTING_FOR_APP @n
- *             Description : Returns the most common setting value of application use. This returns always 1 row of record@n
- *             Required privilege : <em> http://tizen.org/privilege/apphistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id to filter</td>
- *                     <td> X (Default : All applications) </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_AUDIO_JACK </td>
- *                     <td> integer </td>
- *                     <td> The most common value of audio jack status </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_SYSTEM_VOLUME </td>
- *                     <td> integer </td>
- *                     <td> The most common value of system volume  </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_MEDIA_VOLUME </td>
- *                     <td> integer </td>
- *                     <td> The most common value of media volume </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC @n
- *             Description : Returns the most common setting value of music playing. This returns always 1 row of record@n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id to filter</td>
- *                     <td> X (Default : All applications) </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_AUDIO_JACK </td>
- *                     <td> integer </td>
- *                     <td> The most common value of audio jack status </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_SYSTEM_VOLUME </td>
- *                     <td> integer </td>
- *                     <td> The most common value of system volume  </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_MEDIA_VOLUME </td>
- *                     <td> integer </td>
- *                     <td> The most common value of media volume </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO @n
- *             Description : Returns the most common setting value of video watching. This returns always 1 row of record@n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id to filter</td>
-  *                    <td> X (Default : All applications) </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_AUDIO_JACK </td>
- *                     <td> integer </td>
- *                     <td> The most common value of audio jack status </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_SYSTEM_VOLUME </td>
- *                     <td> integer </td>
- *                     <td> The most common value of system volume  </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_MEDIA_VOLUME </td>
- *                     <td> integer </td>
- *                     <td> The most common value of media volume </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS @n
- *             Description : Returns frequently communicated address list sorted by communicated count in descending order. @n
- *             Required privilege : <em> http://tizen.org/privilege/callhistory.read </em> @n
- *             <table>
- *             <caption> Table: Filters</caption>
- *             <tr>
- *                     <th> Filter </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *                     <th> Mandatory </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_TIME_SPAN </td>
- *                     <td> integer </td>
- *                     <td> Time span of data in days from today ( 1 ~ 90 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_RESULT_SIZE </td>
- *                     <td> integer </td>
- *                     <td> Result size of data set ( 1 ~ 50 ) </td>
- *                     <td> O </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_START_TIME </td>
- *                     <td> integer </td>
- *                     <td> Start time in epoch time to load only data which is inserted after the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_END_TIME </td>
- *                     <td> integer </td>
- *                     <td> End time in epoch time to load only data which is inserted before the specific time</td>
- *                     <td> X </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE </td>
- *                     <td> integer </td>
- *                     <td> Call or message logs #context_history_filter_communication_type_e </td>
- *                     <td> X </td>
- *             </tr>
- *             </table>
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_ADDRESS </td>
- *                     <td> string </td>
- *                     <td> Address </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_COUNT </td>
- *                     <td> integer </td>
- *                     <td> Total communication count </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_TOTAL_DURATION </td>
- *                     <td> integer </td>
- *                     <td> Total communication duration </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_TIME </td>
- *                     <td> integer </td>
- *                     <td> Last communication time in epoch time </td>
- *             </tr>
- *             </table> @n
- *</ul>
- *
- *Sample code: @n
- *the code below creates a handle and reads the data from contextual history engine.
-
- \code
-// create a handle
-context_history_h handle = NULL;
-context_history_create(&handle);
-
-// create a filter
-context_history_filter_h filter;
-context_history_filter_create(&filter);
-
-// set filter values
-context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 5);
-context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_APP_ID, "org.tizen.music");
-
-// set start and end time to query only data from 6:00 to 12:00
-
-i18n_ucalendar_h ucal = NULL;
-char *loc_default = NULL;
-i18n_udate time;
-int start_time_in_sec, end_time_in_sec;
-
-i18n_ulocale_get_default((const char **)&loc_default);
-i18n_ucalendar_create(NULL, -1, loc_default, I18N_UCALENDAR_GREGORIAN, &ucal);
-
-i18n_ucalendar_set(ucal, I18N_UCALENDAR_HOUR_OF_DAY, 6);
-i18n_ucalendar_set(ucal, I18N_UCALENDAR_MINUTE, 0);
-i18n_ucalendar_set(ucal, I18N_UCALENDAR_SECOND, 0);
-i18n_ucalendar_set(ucal, I18N_UCALENDAR_MILLISECOND, 0);
-i18n_ucalendar_get_milliseconds(ucal, &time);
-start_time_in_sec = time/1000;
-
-i18n_ucalendar_add(ucal, I18N_UCALENDAR_HOUR_OF_DAY, 6);
-i18n_ucalendar_get_milliseconds(ucal, &time);
-end_time_in_sec = time/1000;
-
-i18n_ucalendar_destroy(ucal);
-
-context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_START_TIME, start_time_in_sec);
-context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_END_TIME, end_time_in_sec);
-
-context_history_list_h list = NULL;
-
-// read data from contextual history engine
-context_history_get_list(handle, CONTEXT_HISTORY_COMMON_SETTING_FOR_APP, filter, &list);
-
-int size = 0;
-int media_volume;
-int audio_jack;
-context_history_list_get_count(list, &size);
-
-context_history_record_h record = NULL;
-
-// get current record
-context_history_list_get_current(list, &record);
-
-// get attributes
-context_history_record_get_int(record, CONTEXT_HISTORY_MEDIA_VOLUME, &media_volume);
-context_history_record_get_int(record, CONTEXT_HISTORY_AUDIO_JACK, &audio_jack);
-
-context_history_record_destroy(record);
-
-// to next position of the list
-context_history_list_move_next(list);
-
-// ...
-
-// destroy
-context_history_list_destroy(list);
-context_history_destroy(handle);
-context_history_filter_destroy(filter);
- \endcode
-
- * @internal
- * <h2>To insert contextual event data to contextual history database</h2>
- * The application can insert contextual event data into the contextual history database when a meaningful user event is generated.
- * An <i>event data</i> usually contains a set of information regarding user's activities.
- * It is used by contextual history engine to analyze user's behavioral patterns or characteristics. Each event type has different attributes and requires different privileges.@n
- * The following is the list of event type can be used. An enumeration type is defined to #context_history_event_e.
- *
- *<ul>
- *     <li>#CONTEXT_HISTORY_START_MUSIC @n
- *             Description : The user started to listen to music. @n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.admin </em> @n
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_URI </td>
- *                     <td> string </td>
- *                     <td> Uri of media file </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id that inserted event data </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_POSITION </td>
- *                     <td> integer </td>
- *                     <td> The last played position of media file </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_STOP_MUSIC @n
- *             Description : The user stopped to listen to music. @n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.admin </em> @n
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_URI </td>
- *                     <td> string </td>
- *                     <td> Uri of media file </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id that inserted event data </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_POSITION </td>
- *                     <td> integer </td>
- *                     <td> The last played position of media file </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_START_VIDEO @n
- *             Description : The user started to watch a video. @n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.admin </em> @n
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_URI </td>
- *                     <td> string </td>
- *                     <td> Uri of media file </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id that inserted event data </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_POSITION </td>
- *                     <td> integer </td>
- *                     <td> The last played position of media file </td>
- *             </tr>
- *             </table> @n
- *     <li>#CONTEXT_HISTORY_STOP_VIDEO @n
- *             Description : The user stopped to watch the video. @n
- *             Required privilege : <em> http://tizen.org/privilege/mediahistory.admin </em> @n
- *             <table>
- *             <caption> Table: Attributes</caption>
- *             <tr>
- *                     <th> Attribute </th>
- *                     <th> Type </th>
- *                     <th> Value </th>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_URI </td>
- *                     <td> string </td>
- *                     <td> Uri of media file </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_APP_ID </td>
- *                     <td> string </td>
- *                     <td> Application id that inserted event data </td>
- *             </tr>
- *             <tr>
- *                     <td> #CONTEXT_HISTORY_LAST_POSITION </td>
- *                     <td> integer </td>
- *                     <td> The last played position of media file </td>
- *             </tr>
- *             </table> @n
- *</ul>
- *
- *Sample code: @n
- *the code below creates a record and inserts it into contextual history engine.
-
-
- \code
-// create a record
-context_history_record_h record = NULL;
-context_history_record_create(&record);
-
-// set attributes to the record
-context_history_record_set_string(record, "Uri", media_info->uri);
-context_history_record_set_int(record, "LastPosition", media_info->last_position);
-
-// insert record to contextual history
-context_history_record_insert(record, CONTEXT_HISTORY_START_MUSIC);
-
-// destroy
-context_history_record_destroy(record);
- \endcode
-
  */
index 5ed94ec..c2e0f39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,8 +29,6 @@
  * The contextual trigger API provides a way to define trigger rules,
  * each of which launches an application or posts a notification if it is satisfied.
  *
- * @subsection CAPI_CONTEXT_TRIGGER_MODULE_CODE_EXAMPLE Trigger Rule Creation and Activation
- *
  * To use this API, an application first needs to assemble a @em rule,
  * which consists of the following three components:
  *
                The action can be an app launching request or a notification posting request.
  </ol>
  *
- * As a case study, the below example code illustrates how to create and activate a rule,
- * which can be described as
- * "Notify if the battery is not charged enough and currently not charing,
- * at 10 and 11 PM" in human language.
-
- \code
-       // Creating a rule handle
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-
-       // Creating an event
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME,
-                       CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event,
-                       CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, CONTEXT_TRIGGER_TIME_OF_DAY);
-       context_trigger_rule_entry_add_comparison_int(event,
-                       CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_EQUAL_TO, 22);
-       context_trigger_rule_entry_add_comparison_int(event,
-                       CONTEXT_TRIGGER_TIME_OF_DAY, CONTEXT_TRIGGER_EQUAL_TO, 23);
-
-       // Adding the event to the rule and releasing the resource occupied.
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_entry_destroy(event);
- \endcode
-
- * While creating a rule handle, the application chooses the logical operator,
- * <em>logical conjunction</em> or <em>disjunction</em>,
- * which will be applied to the conditions.@n
- * Then some logical conditions can be added to the rule.
- * Note that, adding conditions are not mandatory.
-
- \code
-       // Creating a condition
-       context_trigger_rule_entry_h condition = NULL;
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_BATTERY,
-                       CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition,
-                       CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, CONTEXT_TRIGGER_LEVEL);
-       context_trigger_rule_entry_add_comparison_string(condition,
-                       CONTEXT_TRIGGER_LEVEL, CONTEXT_TRIGGER_NOT_EQUAL_TO, CONTEXT_TRIGGER_FULL);
-       context_trigger_rule_entry_add_comparison_string(condition,
-                       CONTEXT_TRIGGER_LEVEL, CONTEXT_TRIGGER_NOT_EQUAL_TO, CONTEXT_TRIGGER_HIGH);
-       context_trigger_rule_entry_add_key(condition,
-                       CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, CONTEXT_TRIGGER_IS_CHARGING);
-       context_trigger_rule_entry_add_comparison_int(condition,
-                       CONTEXT_TRIGGER_IS_CHARGING, CONTEXT_TRIGGER_EQUAL_TO, CONTEXT_TRIGGER_FALSE);
-
-       // Adding the condition to the handle
-       context_trigger_rule_add_entry(rule, condition);
-       context_trigger_rule_entry_destroy(condition);
- \endcode
-
- * A app launching request or a notification posting request is set as the action,
- * which will be triggered if the rule is satisfied.
- * The below example shows how to register a notification posting request.
-
- \code
-       // Setting a notification posting request
-       context_trigger_rule_set_action_notification(rule, "Battery Alert", "Charge your battery please.", NULL, NULL);
- \endcode
-
- * An app launching request is created and manipulated by the app control API.
- * Please refer to the app control API for more details.@n
- * Regarding the notification posting request, this API supports the very basic
- * form of notifications only. To create a more sophisticated notification,
- * the application needs to implement a service application that posts the notification.@n
- * After creating a rule, to activate it, the rule needs to be registered and enabled explicitly.
-
- \code
-       // Adding the rule to the engine
-       int rule_id;
-       context_trigger_add_rule(rule, &rule_id);
-
-       // Enabling the rule
-       context_trigger_enable_rule(rule_id)
- \endcode
-
  * Note that, a rule only can be managed by the application that has registered the rule.
  *
  * If the rule is not required anymore, it can be disabled and removed from the engine.
  * owner application, which has registered the rule to the trigger engine.
  * In the below example, the application queries its own rule IDs,
  * deactivates enabled rules, and removes all rules from the trigger engine.
-
- \code
-       context_trigger_disable_rule(rule_id)
-       context_trigger_remove_rule(rule_id);
- \endcode
-
- *
- * @subsection CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT Supported Attribute Keys and Comparison Operators
  *
- * Each event or condition item may support different types of attribute keys,
- * which are used as left operands of comparison operations.
- * The supported attribute keys, their types, and acceptable values are summarized in the table below.
+ * For more details, please see the programming guide and the tutorial.
  *
-
-<table>
-       <caption>Table: Supported Attribute Keys</caption>
-       <tr>
-               <th>Event/Condition</th>
-               <th>Attribute Key</th>
-               <th>Type</th>
-               <th>Acceptable Values</th>
-       </tr>
-       <tr>
-               <td rowspan=2>#CONTEXT_TRIGGER_EVENT_ON_TIME</td>
-               <td>#CONTEXT_TRIGGER_TIME_OF_DAY</td>
-               <td>Integer</td>
-               <td>From 0 to 23 (hour)</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_DAY_OF_WEEK</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_MON,<br>
-                       #CONTEXT_TRIGGER_TUE,<br>
-                       #CONTEXT_TRIGGER_WED,<br>
-                       #CONTEXT_TRIGGER_THU,<br>
-                       #CONTEXT_TRIGGER_FRI,<br>
-                       #CONTEXT_TRIGGER_SAT,<br>
-                       #CONTEXT_TRIGGER_SUN
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_CONDITION_TIME_OF_DAY</td>
-               <td>#CONTEXT_TRIGGER_TIME_OF_DAY</td>
-               <td>Integer</td>
-               <td>From 0 to 1439 (min)</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_CONDITION_DAY_OF_WEEK</td>
-               <td>#CONTEXT_TRIGGER_DAY_OF_WEEK</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_MON,<br>
-                       #CONTEXT_TRIGGER_TUE,<br>
-                       #CONTEXT_TRIGGER_WED,<br>
-                       #CONTEXT_TRIGGER_THU,<br>
-                       #CONTEXT_TRIGGER_FRI,<br>
-                       #CONTEXT_TRIGGER_SAT,<br>
-                       #CONTEXT_TRIGGER_SUN
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_CONDITION_DAY_OF_MONTH</td>
-               <td>#CONTEXT_TRIGGER_DAY_OF_MONTH</td>
-               <td>Integer</td>
-               <td>From 1 to 31</td>
-       </tr>
-       <tr>
-               <td>
-                       #CONTEXT_TRIGGER_EVENT_CHARGER<br>
-                       #CONTEXT_TRIGGER_EVENT_USB<br>
-                       #CONTEXT_TRIGGER_CONDITION_CHARGER<br>
-                       #CONTEXT_TRIGGER_CONDITION_USB
-               </td>
-               <td>#CONTEXT_TRIGGER_IS_CONNECTED</td>
-               <td>Integer</td>
-               <td>#CONTEXT_TRIGGER_TRUE,<br>#CONTEXT_TRIGGER_FALSE</td>
-       </tr>
-       <tr>
-               <td rowspan=2>
-                       #CONTEXT_TRIGGER_EVENT_BATTERY<br>
-                       #CONTEXT_TRIGGER_CONDITION_BATTERY
-               </td>
-               <td>#CONTEXT_TRIGGER_LEVEL</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_EMPTY,<br>
-                       #CONTEXT_TRIGGER_CRITICAL,<br>
-                       #CONTEXT_TRIGGER_LOW,<br>
-                       #CONTEXT_TRIGGER_NORMAL,<br>
-                       #CONTEXT_TRIGGER_HIGH,<br>
-                       #CONTEXT_TRIGGER_FULL
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_IS_CHARGING</td>
-               <td>Integer</td>
-               <td>#CONTEXT_TRIGGER_TRUE,<br>#CONTEXT_TRIGGER_FALSE</td>
-       </tr>
-       <tr>
-               <td>
-                       #CONTEXT_TRIGGER_EVENT_FLIGHT_MODE<br>
-                       #CONTEXT_TRIGGER_EVENT_POWER_SAVING_MODE<br>
-                       #CONTEXT_TRIGGER_EVENT_SILENT_MODE<br>
-                       #CONTEXT_TRIGGER_EVENT_VIBRATION_MODE<br>
-                       #CONTEXT_TRIGGER_CONDITION_FLIGHT_MODE<br>
-                       #CONTEXT_TRIGGER_CONDITION_POWER_SAVING_MODE<br>
-                       #CONTEXT_TRIGGER_CONDITION_SILENT_MODE<br>
-                       #CONTEXT_TRIGGER_CONDITION_VIBRATION_MODE
-               </td>
-               <td>#CONTEXT_TRIGGER_IS_ENABLED</td>
-               <td>Integer</td>
-               <td>#CONTEXT_TRIGGER_TRUE,<br>#CONTEXT_TRIGGER_FALSE</td>
-       </tr>
-       <tr>
-               <td>
-                       #CONTEXT_TRIGGER_EVENT_GPS<br>
-                       #CONTEXT_TRIGGER_CONDITION_GPS
-               </td>
-               <td>#CONTEXT_TRIGGER_STATE</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_DISABLED,<br>
-                       #CONTEXT_TRIGGER_SEARCHING,<br>
-                       #CONTEXT_TRIGGER_CONNECTED
-               </td>
-       </tr>
-       <tr>
-               <td rowspan=2>
-                       #CONTEXT_TRIGGER_EVENT_HEADPHONE<br>
-                       #CONTEXT_TRIGGER_CONDITION_HEADPHONE
-               </td>
-               <td>#CONTEXT_TRIGGER_IS_CONNECTED</td>
-               <td>Integer</td>
-               <td>#CONTEXT_TRIGGER_TRUE,<br>#CONTEXT_TRIGGER_FALSE</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_TYPE</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_NORMAL,<br>
-                       #CONTEXT_TRIGGER_HEADSET,<br>
-                       #CONTEXT_TRIGGER_BLUETOOTH
-               </td>
-       </tr>
-       <tr>
-               <td rowspan=2>
-                       #CONTEXT_TRIGGER_EVENT_WIFI<br>
-                       #CONTEXT_TRIGGER_CONDITION_WIFI
-               </td>
-               <td>#CONTEXT_TRIGGER_STATE</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_DISABLED,<br>
-                       #CONTEXT_TRIGGER_CONNECTED,<br>
-                       #CONTEXT_TRIGGER_UNCONNECTED
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_BSSID</td>
-               <td>String</td>
-               <td>WiFi BSSID</td>
-       </tr>
-       <tr>
-               <td rowspan=3>
-                       #CONTEXT_TRIGGER_EVENT_CALL<br>
-                       #CONTEXT_TRIGGER_CONDITION_CALL
-               </td>
-               <td>#CONTEXT_TRIGGER_STATE</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_IDLE,<br>
-                       #CONTEXT_TRIGGER_CONNECTING,<br>
-                       #CONTEXT_TRIGGER_CONNECTED
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_MEDIUM</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_VOICE,<br>#CONTEXT_TRIGGER_VIDEO</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_ADDRESS</td>
-               <td>String</td>
-               <td>Phone number</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_EVENT_EMAIL</td>
-               <td>#CONTEXT_TRIGGER_EVENT</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_RECEIVED,<br>#CONTEXT_TRIGGER_SENT</td>
-       </tr>
-       <tr>
-               <td rowspan=3>#CONTEXT_TRIGGER_EVENT_MESSAGE</td>
-               <td>#CONTEXT_TRIGGER_EVENT</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_RECEIVED</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_TYPE</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_SMS,<br>#CONTEXT_TRIGGER_MMS</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_ADDRESS</td>
-               <td>String</td>
-               <td>Phone number</td>
-       </tr>
-       <tr>
-               <td rowspan=2>
-                       #CONTEXT_TRIGGER_EVENT_ACTIVITY_STATIONARY,<br>
-                       #CONTEXT_TRIGGER_EVENT_ACTIVITY_WALKING,<br>
-                       #CONTEXT_TRIGGER_EVENT_ACTIVITY_RUNNING,<br>
-                       #CONTEXT_TRIGGER_EVENT_ACTIVITY_IN_VEHICLE
-               </td>
-               <td>#CONTEXT_TRIGGER_EVENT</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_DETECTED</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_ACCURACY</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_HIGH,<br>#CONTEXT_TRIGGER_NORMAL,<br>#CONTEXT_TRIGGER_LOW</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_EVENT_PLACE</td>
-               <td>#CONTEXT_TRIGGER_EVENT</td>
-               <td>String</td>
-               <td>#CONTEXT_TRIGGER_IN,<br>#CONTEXT_TRIGGER_OUT</td>
-       </tr>
-       <tr>
-               <td>
-                       #CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY
-               </td>
-               <td>#CONTEXT_TRIGGER_RANK</td>
-               <td>Integer</td>
-               <td>Positive integer</td>
-       </tr>
-       <tr>
-               <td>
-                       #CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY
-               </td>
-               <td>#CONTEXT_TRIGGER_TOTAL_COUNT</td>
-               <td>Integer</td>
-               <td>Nonnegative integer</td>
-       </tr>
-</table>
-
- *
- * For each type of attribute, as operators, the followings are allowed:
- *
-
-<ul>
-       <li><i>For <b>integer</b> attributes</i>:<br>
-               #CONTEXT_TRIGGER_EQUAL_TO ("=="), #CONTEXT_TRIGGER_NOT_EQUAL_TO ("!="),<br>
-               #CONTEXT_TRIGGER_GREATER_THAN (">"), #CONTEXT_TRIGGER_GREATER_THAN_OR_EQUAL_TO (">="),<br>
-               #CONTEXT_TRIGGER_LESS_THAN ("<"), #CONTEXT_TRIGGER_LESS_THAN_OR_EQUAL_TO ("<=")
-       <li><i>For <b>string</b> attributes</i>:<br>
-               #CONTEXT_TRIGGER_EQUAL_TO ("=="), #CONTEXT_TRIGGER_NOT_EQUAL_TO ("!=")
-</ul>
-
- *
- * @subsection CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT Supported Options Keys
- *
- * Certain events or conditions require to specify option values, which will be used
- * to produce the output attribute values.
- * For example, in case of #CONTEXT_TRIGGER_EVENT_PLACE,
- * the target place id should be specified, by using context_trigger_rule_entry_add_option_int().
- * The table below summarizes the supported option keys and acceptable values for each event or condition.
- *
-
-<table>
-       <caption>Table: Supported Option Keys</caption>
-       <tr>
-               <th>Event/Condition</th>
-               <th>Option Key</th>
-               <th>Type</th>
-               <th>Acceptable Values</th>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_EVENT_PLACE</td>
-               <td>#CONTEXT_TRIGGER_PLACE_ID</td>
-               <td>Integer</td>
-               <td>
-                       Place ID<br>
-                       See \ref CAPI_GEOFENCE_MANAGER_MODULE
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY</td>
-               <td>#CONTEXT_TRIGGER_APP_ID</td>
-               <td>String</td>
-               <td>Application ID</td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY</td>
-               <td>#CONTEXT_TRIGGER_ADDRESS</td>
-               <td>String</td>
-               <td>Phone number</td>
-       </tr>
-       <tr>
-               <td rowspan=2>
-                       #CONTEXT_TRIGGER_CONDITION_APP_USE_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_COMMUNICATION_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_MUSIC_PLAYBACK_FREQUENCY,<br>
-                       #CONTEXT_TRIGGER_CONDITION_VIDEO_PLAYBACK_FREQUENCY
-               </td>
-               <td>#CONTEXT_TRIGGER_TIME_OF_DAY</td>
-               <td>String</td>
-               <td>
-                       Time interval of day, for example,<br>
-                       <b>"13-15"</b> denoting "from 1 PM to 3 PM".
-               </td>
-       </tr>
-       <tr>
-               <td>#CONTEXT_TRIGGER_DAY_OF_WEEK</td>
-               <td>String</td>
-               <td>
-                       #CONTEXT_TRIGGER_MON,<br>
-                       #CONTEXT_TRIGGER_TUE,<br>
-                       #CONTEXT_TRIGGER_WED,<br>
-                       #CONTEXT_TRIGGER_THU,<br>
-                       #CONTEXT_TRIGGER_FRI,<br>
-                       #CONTEXT_TRIGGER_SAT,<br>
-                       #CONTEXT_TRIGGER_SUN,<br>
-                       #CONTEXT_TRIGGER_WEEKDAY,<br>
-                       #CONTEXT_TRIGGER_WEEKEND
-               </td>
-       </tr>
-</table>
-
  *
  * @section CAPI_CONTEXT_TRIGGER_MODULE_FEATURE Related Features
  *
- * Some of the event and condition items in this API are related with one or the following features:@n
+ * Some of the event and condition items in this API are related with one of the following features:@n
  * - http://tizen.org/feature/network.telephony
  * - http://tizen.org/feature/location.gps
  * - http://tizen.org/feature/network.bluetooth
index 74546a6..f368993 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifdef __cplusplus
 extern "C" {
-#endif // __cplusplus
+#endif /* __cplusplus */
 
 /**
  * @addtogroup CAPI_CONTEXT_HISTORY_MODULE
@@ -107,18 +107,6 @@ typedef enum {
 } context_history_data_e;
 
 /**
- * @platform
- * @brief              Enumeration for event types for logging.
- * @since_tizen 2.4
- */
-typedef enum {
-       CONTEXT_HISTORY_START_MUSIC = 1,        /**< @platform Start music event.@n Privilege : http://tizen.org/privilege/mediahistory.admin*/
-       CONTEXT_HISTORY_STOP_MUSIC,             /**< @platform Stop music event.@n Privilege : http://tizen.org/privilege/mediahistory.admin*/
-       CONTEXT_HISTORY_START_VIDEO,    /**< @platform Start video event.@n Privilege : http://tizen.org/privilege/mediahistory.admin*/
-       CONTEXT_HISTORY_STOP_VIDEO              /**< @platform Stop video event.@n Privilege : http://tizen.org/privilege/mediahistory.admin*/
-} context_history_event_e;
-
-/**
  * @brief              Enumeration for filters of statistics and patterns.
  * @since_tizen 2.4
  */
@@ -402,28 +390,6 @@ int context_history_list_move_next(context_history_list_h list);
 int context_history_list_destroy(context_history_list_h list);
 
 /**
- * @platform
- * @brief              Creates a record handle.
- * @since_tizen 2.4
- * @remarks            The @c record must be released using context_history_record_destroy().
- *
- * @param[out] record          The record handle
- *
- * @return             0 on success, otherwise a negative error value
- * @retval             #CONTEXT_HISTORY_ERROR_NONE                                     Successful
- * @retval             #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER        Invalid parameter
- * @retval             #CONTEXT_HISTORY_ERROR_OPERATION_FAILED         Operation failed
- * @retval             #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY                    Out of memory
- *
- * @post       context_history_record_destroy()
- * @see                context_history_record_get_int()
- * @see                context_history_record_get_string()
- * @see                context_history_record_set_int()
- * @see                context_history_record_set_string()
- */
-int context_history_record_create(context_history_record_h* record);
-
-/**
  * @brief              Gets an integer value from a record.
  * @since_tizen 2.4
  *
@@ -459,42 +425,6 @@ int context_history_record_get_int(context_history_record_h record,  const char*
 int context_history_record_get_string(context_history_record_h record, const char* key, char** value);
 
 /**
- * @platform
- * @brief              Sets an integer value to the record.
- * @since_tizen 2.4
- *
- * @param[in]  record          The record handle
- * @param[in]  key                     The key of attribute to set
- * @param[in]  value           The value to be set
- *
- * @return             0 on success, otherwise a negative error value
- * @retval             #CONTEXT_HISTORY_ERROR_NONE                                     Successful
- * @retval             #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER        Invalid parameter
- *
- * @pre                context_history_record_create()
- * @see                context_history_record_set_string()
- */
-int context_history_record_set_int(context_history_record_h record, const char* key, int value);
-
-/**
- * @platform
- * @brief              Sets a string to the record.
- * @since_tizen 2.4
- *
- * @param[in]  record          The record handle
- * @param[in]  key                     The key of attribute to set
- * @param[in]  value           The value to be set
- *
- * @return             0 on success, otherwise a negative error value
- * @retval             #CONTEXT_HISTORY_ERROR_NONE                                     Successful
- * @retval             #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER        Invalid parameter
- *
- * @pre                context_history_record_create()
- * @see                context_history_record_set_int()
- */
-int context_history_record_set_string(context_history_record_h record, const char* key, const char* value);
-
-/**
  * @brief              Destroys a record handle and releases all its resources.
  * @since_tizen 2.4
  *
@@ -508,36 +438,12 @@ int context_history_record_set_string(context_history_record_h record, const cha
  */
 int context_history_record_destroy(context_history_record_h record);
 
-/**
- * @platform
- * @brief              Inserts a history event log.
- * @since_tizen 2.4
- *
- * @privlevel platform
- * @privilege %http://tizen.org/privilege/mediahistory.admin
- *
- * @remarks            Some mandatory attributes have to be set to record. Mandatory fields are described in overview.
- *
- * @param[in]  event_type      The history event type
- * @param[in]  record          The record to be inserted
- *
- * @return             0 on success, otherwise a negative error value
- * @retval             #CONTEXT_HISTORY_ERROR_NONE                                     Successful
- * @retval             #CONTEXT_HISTORY_ERROR_INVALID_PARAMETER                Invalid parameter
- * @retval             #CONTEXT_HISTORY_ERROR_OPERATION_FAILED         Operation failed
- * @retval             #CONTEXT_HISTORY_ERROR_OUT_OF_MEMORY                    Out of memory
- *
- * @pre                context_history_record_create()
- * @post       context_history_record_destroy()
- */
-int context_history_record_insert(context_history_record_h record, context_history_event_e event_type);
-
 #ifdef __cplusplus
 }
-#endif // __cplusplus
+#endif /* __cplusplus */
 
 /**
 * @}
 */
 
-#endif // __TIZEN_CONTEXT_HISTORY_H__
+#endif /* __TIZEN_CONTEXT_HISTORY_H__ */
index fff24a2..e240cf1 100644 (file)
 #define CONTEXT_HISTORY_SUBJECT_COMMON_SETTING_FOR_VIDEO "video/history/common_setting"
 #define CONTEXT_HISTORY_SUBJECT_FREQUENTLY_COMMUNICATED_ADDRESS "social/history/frequently_communicated"
 
-#define CONTEXT_HISTORY_EVENT_START_MUSIC "music/event/start"
-#define CONTEXT_HISTORY_EVENT_STOP_MUSIC "music/event/stop"
-#define CONTEXT_HISTORY_EVENT_START_VIDEO "video/event/start"
-#define CONTEXT_HISTORY_EVENT_STOP_VIDEO "video/event/stop"
-
 #define CONTEXT_HISTORY_FILTER_KEY_TIME_SPAN "TimeSpan"
 #define CONTEXT_HISTORY_FILTER_KEY_RESULT_SIZE "ResultSize"
 #define CONTEXT_HISTORY_FILTER_KEY_APP_ID "AppId"
@@ -47,4 +42,4 @@
 #define CONTEXT_HISTORY_FILTER_KEY_WIFI_BSSID "BSSID"
 #define CONTEXT_HISTORY_FILTER_KEY_COMMUNICATION_TYPE "CommunicationType"
 
-#endif // __TIZEN_CONTEXT_HISTORY_TYPES_INTERNAL_H__
+#endif /* __TIZEN_CONTEXT_HISTORY_TYPES_INTERNAL_H__ */
diff --git a/include/context_internal.h b/include/context_internal.h
deleted file mode 100644 (file)
index 97d085e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * This API set is only for testing purposes.
- * Do not use any of this set for other purposes.
- */
-
-#ifndef __TIZEN_CONTEXT_INTERNAL_TEST_API_H__
-#define __TIZEN_CONTEXT_INTERNAL_TEST_API_H__
-
-#include <tizen_error.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-typedef void(* context_internal_subscribe_cb)(const char* item, int req_id, int error, const char* data, void *user_data);
-
-int context_internal_read(const char* item, const char* option, char** data);
-
-int context_internal_write(const char* item, const char* data, char** result);
-
-int context_internal_subscribe(const char* item, const char* option, context_internal_subscribe_cb callback, void *user_data);
-
-int context_internal_unsubscribe(int req_id);
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif
index 113c2ef..d0d5d93 100644 (file)
@@ -28,7 +28,7 @@
 
 #ifdef __cplusplus
 extern "C" {
-#endif // __cplusplus
+#endif /* __cplusplus */
 
 /**
  * @brief      The operator "is equal to".
@@ -91,9 +91,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "time of day".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n
- *                     When being used with #CONTEXT_TRIGGER_EVENT_ON_TIME, it's unit is "hour",
- *                     the valid range of the corresponding right operands is thus from 0 (12:00 AM) to 23 (11:00 PM).@n
- *                     When being used with #CONTEXT_TRIGGER_CONDITION_TIME_OF_DAY, it's unit is "minute",
+ *                     When being used with #CONTEXT_TRIGGER_EVENT_TIME or #CONTEXT_TRIGGER_CONDITION_TIME, it's unit is "minute",
  *                     the valid range of the corresponding right operands is thus from 0 (12:00 AM) to 1439 (11:59 PM).
  * @since_tizen 2.4
  */
@@ -147,7 +145,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "level".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands values.
+ *                     See the programming guide to find available right operands values.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_LEVEL "Level"
@@ -155,7 +153,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "state".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_STATE "State"
@@ -163,7 +161,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "BSSID".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_BSSID "BSSID"
@@ -171,7 +169,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "type".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_TYPE "Type"
@@ -179,7 +177,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "event".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_EVENT "Event"
@@ -187,7 +185,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "accuracy".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_ACCURACY "Accuracy"
@@ -195,7 +193,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "medium".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_MEDIUM "Medium"
@@ -203,7 +201,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "place id".
  * @details    This can be used as a key of context_trigger_rule_entry_add_option_int().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find the corresponding trigger events.
+ *                     See the programming guide to find the corresponding trigger events.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_PLACE_ID "PlaceId"
@@ -211,7 +209,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "application id".
  * @details    This can be used as a key of context_trigger_rule_entry_add_option_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find the corresponding trigger events.
+ *                     See the programming guide to find the corresponding trigger events.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_APP_ID "AppId"
@@ -220,7 +218,7 @@ extern "C" {
  * @brief      The attribute key denoting "address".
  * @details    This can be used as a key of context_trigger_rule_entry_add_option_string(),
  *                     or context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT and CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find the corresponding items.
+ *                     See the programming guide and CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find the corresponding items.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_ADDRESS "Address"
@@ -228,7 +226,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "rank".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_RANK "Rank"
@@ -236,7 +234,7 @@ extern "C" {
 /**
  * @brief      The attribute key denoting "total count".
  * @details    This can be used as left operands of context_trigger_rule_entry_add_comparison_int().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available right operands.
+ *                     See the programming guide to find available right operands.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_TOTAL_COUNT "TotalCount"
@@ -244,7 +242,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Monday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_MON "Mon"
@@ -252,7 +250,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Tuesday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_TUE "Tue"
@@ -260,7 +258,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Wednesday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_WED "Wed"
@@ -268,7 +266,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Thursday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_THU "Thu"
@@ -276,7 +274,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Friday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_FRI "Fri"
@@ -284,7 +282,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Saturday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_SAT "Sat"
@@ -292,7 +290,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Sunday.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_SUN "Sun"
@@ -300,7 +298,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Weekdays.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_WEEKDAY "Weekday"
@@ -308,7 +306,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting Weekends.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_WEEKEND "Weekend"
@@ -316,7 +314,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "empty" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_EMPTY "Empty"
@@ -324,7 +322,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "critical" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_CRITICAL "Critical"
@@ -332,7 +330,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "low" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_LOW "Low"
@@ -340,7 +338,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "normal" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_NORMAL "Normal"
@@ -348,7 +346,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "high" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_HIGH "High"
@@ -356,7 +354,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "full" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_FULL "Full"
@@ -364,7 +362,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "disabled" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_DISABLED "Disabled"
@@ -372,7 +370,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "searching" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_SEARCHING "Searching"
@@ -380,7 +378,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "connecting" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_CONNECTING "Connecting"
@@ -388,7 +386,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "connected" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_CONNECTED "Connected"
@@ -396,7 +394,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "unconnected" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_UNCONNECTED "Unconnected"
@@ -404,7 +402,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "idle" state.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_IDLE "Idle"
@@ -412,7 +410,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "voice" type.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_VOICE "Voice"
@@ -420,7 +418,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "video" type.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_VIDEO "Video"
@@ -428,7 +426,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "headset" type.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_HEADSET "Headset"
@@ -436,7 +434,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "bluetooth" type.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_BLUETOOTH "Bluetooth"
@@ -444,7 +442,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "received" event.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_RECEIVED "Received"
@@ -452,7 +450,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "sent" event.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_SENT "Sent"
@@ -460,7 +458,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "SMS" type.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_SMS "SMS"
@@ -468,7 +466,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "MMS" type.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_MMS "MMS"
@@ -476,7 +474,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "detected" event.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_DETECTED "Detected"
@@ -484,7 +482,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "in" event.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_IN "In"
@@ -492,7 +490,7 @@ extern "C" {
 /**
  * @brief      The attribute value denoting the "out" event.
  * @details    This can be used as right operands of context_trigger_rule_entry_add_comparison_string().@n
- *                     See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find the corresponding left operand attribute keys.
+ *                     See the programming guide to find the corresponding left operand attribute keys.
  * @since_tizen 2.4
  */
 #define CONTEXT_TRIGGER_OUT "Out"
@@ -928,7 +926,7 @@ int context_trigger_rule_entry_destroy(context_trigger_rule_entry_h entry);
 
 /**
  * @brief              Sets an integer type option to an event or condition entry.
- * @details            See \ref CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find available option keys for each event/condition item.
+ * @details            See the programming guide to find available option keys for each event/condition item.
  * @since_tizen 2.4
  *
  * @param[in]  entry                   The event or condition entry
@@ -945,7 +943,7 @@ int context_trigger_rule_entry_add_option_int(context_trigger_rule_entry_h entry
 
 /**
  * @brief              Sets a string type option to an event or condition entry.
- * @details            See \ref CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find available option keys for each event/condition item.
+ * @details            See the programming guide to find available option keys for each event/condition item.
  * @since_tizen 2.4
  *
  * @param[in]  entry                   The event or condition entry
@@ -962,7 +960,7 @@ int context_trigger_rule_entry_add_option_string(context_trigger_rule_entry_h en
 
 /**
  * @brief              Sets an option to a condition entry, which references an attribute that will be extracted from the event.
- * @details            See \ref CAPI_CONTEXT_TRIGGER_MODULE_OPTION_FORMAT to find available option keys for each condition item.
+ * @details            See the programming guide to find available option keys for each condition item.
  * @since_tizen 2.4
  *
  * @param[in]  entry                   The condition entry
@@ -980,7 +978,7 @@ int context_trigger_rule_entry_add_option(context_trigger_rule_entry_h entry, co
 /**
  * @brief              Adds an attribute key to an entry.
  * @details            The key will be used as the left operand of comparisons.
- *                             See \ref CAPI_CONTEXT_TRIGGER_MODULE_DATA_FORMAT to find available attribute keys for each event/condition item.
+ *                             See the programming guide to find available attribute keys for each event/condition item.
  * @since_tizen 2.4
  *
  * @param[in]  entry                   The event or condition entry
@@ -1056,10 +1054,10 @@ int context_trigger_rule_entry_add_comparison(context_trigger_rule_entry_h entry
 
 #ifdef __cplusplus
 }
-#endif // __cplusplus
+#endif /* __cplusplus */
 
 /**
 * @}
 */
 
-#endif // __TIZEN_CONTEXT_CONTEXT_TRIGGER_H__
+#endif /* __TIZEN_CONTEXT_CONTEXT_TRIGGER_H__ */
index 763cf04..dcdf1d4 100644 (file)
 #define TYPE_ATTR_STR "attributes"
 
 
-#endif // __TIZEN_CONTEXT_CONTEXT_TRIGGER_TYPES_INTERNAL_H__
+#endif /* __TIZEN_CONTEXT_CONTEXT_TRIGGER_TYPES_INTERNAL_H__ */
diff --git a/internal/CMakeLists.txt b/internal/CMakeLists.txt
deleted file mode 100644 (file)
index 061a20d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(context-internal)
-
-# Targets
-SET(target_internal "context-internal")
-
-# Source Lists
-FILE(GLOB_RECURSE SRCS_INTERNAL *.cpp)
-
-# Dependencies
-SET(DEPS_INTERNAL "context-common")
-
-# Building Library
-pkg_check_modules(api_internal_pkg REQUIRED ${DEPS_INTERNAL})
-
-FOREACH(flag ${api_internal_pkg_CFLAGS})
-   SET(API_INTERNAL_EXTRA_CFLAGS "${API_INTERNAL_EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-ADD_LIBRARY(${target_internal} SHARED ${SRCS_INTERNAL})
-TARGET_LINK_LIBRARIES(${target_internal} ${api_internal_pkg_LDFLAGS})
-SET_TARGET_PROPERTIES(${target_internal} PROPERTIES COMPILE_FLAGS ${API_INTERNAL_EXTRA_CFLAGS})
-SET_TARGET_PROPERTIES(${target_internal} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-API\"")
-SET_TARGET_PROPERTIES(${target_internal} PROPERTIES SOVERSION ${MAJORVER})
-SET_TARGET_PROPERTIES(${target_internal} PROPERTIES VERSION ${FULLVER})
-
-# Installing
-INSTALL(TARGETS ${target_internal} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
-INSTALL(
-       DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service/internal
-       FILES_MATCHING PATTERN "*_internal.h"
-)
-
-SET(VERSION ${FULLVER})
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(PC_NAME ${target_internal})
-SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-service/internal")
-SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-SET(PC_DESCRIPTION "Tizen Context Framework Native Test API")
-SET(PC_REQUIRED ${DEPS_INTERNAL})
-SET(PC_LDFLAGS -l${target_internal})
-SET(PC_CFLAGS -I\${includedir}/context-service/internal)
-
-CONFIGURE_FILE(
-       ${CMAKE_SOURCE_DIR}/context.pc.in
-       ${CMAKE_SOURCE_DIR}/${target_internal}.pc
-       @ONLY
-)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/${target_internal}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
diff --git a/internal/context_internal.cpp b/internal/context_internal.cpp
deleted file mode 100644 (file)
index 36ce9d5..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string>
-#include <map>
-#include <json.h>
-#include <types_internal.h>
-#include <request_handler.h>
-#include <context_internal.h>
-
-typedef std::map<int, context_internal_subscribe_cb> callback_map_t;
-static callback_map_t callback_map;
-
-static void internal_domain_cb(const char* item, int req_id, int error, ctx::json data)
-{
-       callback_map_t::iterator cb = callback_map.find(req_id);
-       IF_FAIL_VOID_TAG(cb != callback_map.end(), _W, "No callback found");
-
-       // user_data pointer is not supported
-       cb->second(item, req_id, error, data.str().c_str(), NULL);
-}
-
-EXTAPI int context_internal_read(const char* item, const char* option, char** data)
-{
-       int req_id;
-       ctx::json jdata;
-       ctx::json joption = option;
-
-       int error = ctx::request_handler::read_sync(item, &joption, &req_id, &jdata);
-       IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "read_sync error");
-
-       *data = jdata.dup_cstr();
-
-       return ERR_NONE;
-}
-
-EXTAPI int context_internal_write(const char* item, const char* data, char** result)
-{
-       ctx::json jdata = data;
-       ctx::json jresult;
-
-       int error = ctx::request_handler::write_with_reply(item, &jdata, &jresult);
-       IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "write_with_reply error");
-
-       *result = jresult.dup_cstr();
-
-       return ERR_NONE;
-}
-
-EXTAPI int context_internal_subscribe(const char* item, const char* option, context_internal_subscribe_cb callback, void *user_data)
-{
-       ctx::request_handler::register_callback(item, internal_domain_cb);
-
-       int req_id;
-       ctx::json jresult;
-       ctx::json joption = option;
-
-       int error = ctx::request_handler::subscribe(item, &joption, &req_id, &jresult);
-       IF_FAIL_RETURN(error == ERR_NONE, error);
-
-       _J("Request Result:", jresult);
-
-       callback_map[req_id] = callback;
-       return req_id;
-}
-
-EXTAPI int context_internal_unsubscribe(int req_id)
-{
-       callback_map.erase(req_id);
-       return ctx::request_handler::unsubscribe(req_id);
-}
index 4393dfc..7e2f4cc 100644 (file)
@@ -11,7 +11,7 @@ BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(bundle)
 BuildRequires: pkgconfig(capi-appfw-app-control)
 BuildRequires: pkgconfig(pkgmgr-info)
-BuildRequires: pkgconfig(capi-security-privilege-manager)
+BuildRequires: pkgconfig(libsmack)
 BuildRequires: pkgconfig(context-common)
 
 %ifarch %{arm}
@@ -80,16 +80,3 @@ Tizen Context Framework Native API (Development)
 %defattr(-,root,root,-)
 %{_includedir}/context-service/*.h
 %{_libdir}/pkgconfig/%{name}.pc
-
-%package internal
-Summary:    Tizen Context Framework Internal Headers
-Group:      System/API
-Requires:      %{name} = %{version}-%{release}
-
-%description internal
-Tizen Context Framework Internal Headers
-
-%files internal
-%defattr(-,root,root,-)
-%{_includedir}/context-service/internal/*.h
-%{_libdir}/pkgconfig/context-internal.pc
index 6ecac10..b7b451b 100644 (file)
@@ -22,6 +22,7 @@
 
 #define TYPE_INT 0
 #define TYPE_STRING 1
+#define FILTER_KEY_LIMIT 10
 
 #define GROUP_COMMON 0
 #define GROUP1 1
@@ -57,7 +58,6 @@ typedef struct _context_history_record_handle_s {
 
 static std::string convert_filter_to_string(context_history_filter_e filter_type);
 static std::string convert_data_to_string(context_history_data_e data_type);
-static std::string convert_event_to_string(context_history_event_e event_type);
 static bool check_record_key_data_type(int type, std::string key);
 static bool check_filter_data_int(context_history_filter_e filter_type, int val);
 static bool check_filter_data_string(context_history_filter_e filter_type, const char* val);
@@ -231,17 +231,6 @@ EXTAPI int context_history_list_destroy(context_history_list_h list)
        return CONTEXT_HISTORY_ERROR_NONE;
 }
 
-// Log data manipulation
-EXTAPI int context_history_record_create(context_history_record_h* record)
-{
-       ASSERT_NOT_NULL(record);
-
-       *record = new(std::nothrow) _cx_history_record_handle();
-       ASSERT_ALLOC(*record);
-
-       return CONTEXT_HISTORY_ERROR_NONE;
-}
-
 EXTAPI int context_history_record_get_int(context_history_record_h record, const char* key, int* val)
 {
        ASSERT_NOT_NULL(record && val && key);
@@ -280,24 +269,6 @@ EXTAPI int context_history_record_get_string(context_history_record_h record, co
        return CONTEXT_HISTORY_ERROR_NONE;
 }
 
-EXTAPI int context_history_record_set_int(context_history_record_h record, const char* key, int val)
-{
-       ASSERT_NOT_NULL(record && key);
-
-       record->jrecord.set(NULL, key, val);
-
-       return CONTEXT_HISTORY_ERROR_NONE;
-}
-
-EXTAPI int context_history_record_set_string(context_history_record_h record, const char* key, const char* val)
-{
-       ASSERT_NOT_NULL(record && val && key);
-
-       record->jrecord.set(NULL, key, val);
-
-       return CONTEXT_HISTORY_ERROR_NONE;
-}
-
 EXTAPI int context_history_record_destroy(context_history_record_h record)
 {
        ASSERT_NOT_NULL(record);
@@ -306,23 +277,6 @@ EXTAPI int context_history_record_destroy(context_history_record_h record)
        return CONTEXT_HISTORY_ERROR_NONE;
 }
 
-// Write
-EXTAPI int context_history_record_insert(context_history_record_h record, context_history_event_e event_type)
-{
-       ASSERT_NOT_NULL(record);
-       IF_FAIL_RETURN(event_type > 0, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
-       std::string event_type_str = convert_event_to_string(event_type);
-       if (event_type_str.empty()) {
-               return CONTEXT_HISTORY_ERROR_INVALID_PARAMETER;
-       }
-
-       record->jrecord.set(NULL, COMMON_ATTR_CLIENT_APP_ID, "");
-       int error = ctx::request_handler::write(event_type_str.c_str(), &record->jrecord);
-
-       return error;
-}
-
 std::string convert_filter_to_string(context_history_filter_e filter_type)
 {
        std::string str;
@@ -400,28 +354,6 @@ std::string convert_data_to_string(context_history_data_e data_type)
        return str;
 }
 
-std::string convert_event_to_string(context_history_event_e event_type)
-{
-       std::string str;
-       switch (event_type) {
-       case CONTEXT_HISTORY_START_MUSIC:
-               str = CONTEXT_HISTORY_EVENT_START_MUSIC;
-               break;
-       case CONTEXT_HISTORY_STOP_MUSIC:
-               str = CONTEXT_HISTORY_EVENT_STOP_MUSIC;
-               break;
-       case CONTEXT_HISTORY_START_VIDEO:
-               str = CONTEXT_HISTORY_EVENT_START_VIDEO;
-               break;
-       case CONTEXT_HISTORY_STOP_VIDEO:
-               str = CONTEXT_HISTORY_EVENT_STOP_VIDEO;
-               break;
-       default:
-               break;
-       }
-       return str;
-}
-
 bool check_record_key_data_type(int type, std::string key)
 {
        if ((key.compare(CONTEXT_HISTORY_APP_ID) == 0) ||
@@ -477,62 +409,75 @@ bool check_filter_data_int(context_history_filter_e filter_type, int val)
 
 bool check_filter_data_string(context_history_filter_e filter_type, const char* val)
 {
+       IF_FAIL_RETURN(val, false);
+
        switch (filter_type) {
        case CONTEXT_HISTORY_FILTER_APP_ID:
        case CONTEXT_HISTORY_FILTER_WIFI_BSSID:
-               if (val)
-                       return true;
-               break;
+               return true;
+
        default:
                return false;
        }
-       return false;
 }
 
 bool check_invalid_filter(context_history_data_e data_type, context_history_filter_h filter)
 {
-       static const char* group_common[] = {CONTEXT_HISTORY_FILTER_KEY_TIME_SPAN, NULL};
-       static const char* group1[] = {CONTEXT_HISTORY_FILTER_KEY_RESULT_SIZE, CONTEXT_HISTORY_FILTER_KEY_START_TIME,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_END_TIME, CONTEXT_HISTORY_FILTER_KEY_WIFI_BSSID,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_AUDIO_JACK, NULL};
-       static const char* group2[] = {CONTEXT_HISTORY_FILTER_KEY_RESULT_SIZE, CONTEXT_HISTORY_FILTER_KEY_START_TIME,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_END_TIME, NULL};
-       static const char* group3[] = {CONTEXT_HISTORY_FILTER_KEY_RESULT_SIZE, CONTEXT_HISTORY_FILTER_KEY_START_TIME,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_END_TIME, CONTEXT_HISTORY_FILTER_KEY_APP_ID,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_DAY_OF_WEEK, NULL};
-       static const char* group4[] = {CONTEXT_HISTORY_FILTER_KEY_START_TIME, CONTEXT_HISTORY_FILTER_KEY_END_TIME,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_APP_ID, NULL};
-       static const char* group5[] = {CONTEXT_HISTORY_FILTER_KEY_RESULT_SIZE, CONTEXT_HISTORY_FILTER_KEY_START_TIME,
-                                                                       CONTEXT_HISTORY_FILTER_KEY_END_TIME, CONTEXT_HISTORY_FILTER_KEY_COMMUNICATION_TYPE, NULL};
-       static const char** const filter_arr[] = {group_common, group1, group2, group3, group4, group5};
-
-       int group;
+       /* This should be aligned with context_history_filter_e */
+       static const char *filter_key[FILTER_KEY_LIMIT] = {
+               NULL,
+               CONTEXT_HISTORY_FILTER_KEY_TIME_SPAN,
+               CONTEXT_HISTORY_FILTER_KEY_RESULT_SIZE,
+               CONTEXT_HISTORY_FILTER_KEY_APP_ID,
+               CONTEXT_HISTORY_FILTER_KEY_DAY_OF_WEEK,
+               CONTEXT_HISTORY_FILTER_KEY_START_TIME,
+               CONTEXT_HISTORY_FILTER_KEY_END_TIME,
+               CONTEXT_HISTORY_FILTER_KEY_WIFI_BSSID,
+               CONTEXT_HISTORY_FILTER_KEY_AUDIO_JACK,
+               CONTEXT_HISTORY_FILTER_KEY_COMMUNICATION_TYPE,
+       };
+
+       bool allowed[FILTER_KEY_LIMIT] = {false};
+
+       allowed[CONTEXT_HISTORY_FILTER_TIME_SPAN] = true;
+       allowed[CONTEXT_HISTORY_FILTER_START_TIME] = true;
+       allowed[CONTEXT_HISTORY_FILTER_END_TIME] = true;
+       allowed[CONTEXT_HISTORY_FILTER_RESULT_SIZE] = true;
+
        switch (data_type) {
-       // Group1
        case CONTEXT_HISTORY_RECENTLY_USED_APP:
        case CONTEXT_HISTORY_FREQUENTLY_USED_APP:
-               group = GROUP1;
+               allowed[CONTEXT_HISTORY_FILTER_WIFI_BSSID] = true;
+               allowed[CONTEXT_HISTORY_FILTER_AUDIO_JACK] = true;
                break;
-       // Group2
+
        case CONTEXT_HISTORY_RARELY_USED_APP:
-               group = GROUP2;
                break;
-       // Group3
+
        case CONTEXT_HISTORY_PEAK_TIME_FOR_APP:
+               allowed[CONTEXT_HISTORY_FILTER_APP_ID] = true;
+               allowed[CONTEXT_HISTORY_FILTER_DAY_OF_WEEK] = true;
+               break;
+
        case CONTEXT_HISTORY_PEAK_TIME_FOR_MUSIC:
        case CONTEXT_HISTORY_PEAK_TIME_FOR_VIDEO:
-               group = GROUP3;
+               allowed[CONTEXT_HISTORY_FILTER_DAY_OF_WEEK] = true;
                break;
-       // Group4
+
        case CONTEXT_HISTORY_COMMON_SETTING_FOR_APP:
+               allowed[CONTEXT_HISTORY_FILTER_RESULT_SIZE] = false;
+               allowed[CONTEXT_HISTORY_FILTER_APP_ID] = true;
+               break;
+
        case CONTEXT_HISTORY_COMMON_SETTING_FOR_MUSIC:
        case CONTEXT_HISTORY_COMMON_SETTING_FOR_VIDEO:
-               group = GROUP4;
+               allowed[CONTEXT_HISTORY_FILTER_RESULT_SIZE] = false;
                break;
-       // Group5
+
        case CONTEXT_HISTORY_FREQUENTLY_COMMUNICATED_ADDRESS:
-               group = GROUP5;
+               allowed[CONTEXT_HISTORY_FILTER_COMMUNICATION_TYPE] = true;
                break;
+
        default:
                return false;
        }
@@ -544,26 +489,17 @@ bool check_invalid_filter(context_history_data_e data_type, context_history_filt
        for (std::list<std::string>::iterator it = keys.begin(); it != keys.end(); ++it) {
                std::string key = (*it);
                found = false;
-               for (int i = 0; filter_arr[GROUP_COMMON][i] != NULL; i++) {
-                       if (key.compare(filter_arr[GROUP_COMMON][i]) == 0) {
+               for (int i = 1; i < FILTER_KEY_LIMIT; ++i) {
+                       if (allowed[i] && key == filter_key[i]) {
                                found = true;
                                break;
                        }
                }
-               if (found == true) {
+               if (found == true)
                        continue;
-               }
 
-               for (int i = 0; filter_arr[group][i] != NULL; i++) {
-                       if (key.compare(filter_arr[group][i]) == 0) {
-                               found = true;
-                               break;
-                       }
-               }
-               if (found == false) {
-                       break;
-               }
+               return false;
        }
 
-       return found;
+       return true;
 }
index 4867e99..7f57b89 100644 (file)
@@ -352,11 +352,11 @@ EXTAPI int context_trigger_rule_set_action_app_control(context_trigger_rule_h ru
        int error;
 
        // Privilege check
-       error = ctx::privilege_util::is_allowed("http://tizen.org/privilege/appmanager.launch");
+       error = ctx::privilege_util::is_allowed("appmanager.launch");
        IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "Privilege checking failed (%#x)", error);
 
        if (is_call_operation(app_control)) {
-               error = ctx::privilege_util::is_allowed("http://tizen.org/privilege/call");
+               error = ctx::privilege_util::is_allowed("call");
                IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "Privilege checking failed (%#x)", error);
        }
 
@@ -392,7 +392,7 @@ EXTAPI int context_trigger_rule_set_action_notification(context_trigger_rule_h r
        ASSERT_NOT_NULL(rule && title && content);
 
        // Privilege check
-       int error = ctx::privilege_util::is_allowed("http://tizen.org/privilege/notification");
+       int error = ctx::privilege_util::is_allowed("notification");
        IF_FAIL_RETURN_TAG(error == ERR_NONE, error, _E, "Privilege checking failed (%#x)", error);
 
        // if action arleady exists
index ffee54b..a9cb03b 100644 (file)
  * limitations under the License.
  */
 
-#include <sys/types.h>
-#include <unistd.h>
-#include <aul.h>
-#include <pkgmgr-info.h>
-#include <privilege_checker.h>
-
+#include <glib.h>
+#include <sys/smack.h>
+#include <string>
 #include <types_internal.h>
 #include "priv_util.h"
 
 int ctx::privilege_util::is_allowed(const char* priv)
 {
-       int error;
-       char app_id[256];
-       error = aul_app_get_appid_bypid(getpid(), app_id, sizeof(app_id));
-       IF_FAIL_RETURN_TAG(error == AUL_R_OK, ERR_OPERATION_FAILED, _E, "Getting AppId failed");
-
-       pkgmgrinfo_appinfo_h app_info;
-       error = pkgmgrinfo_appinfo_get_appinfo(app_id, &app_info);
-       IF_FAIL_RETURN_TAG(error == PMINFO_R_OK, ERR_OPERATION_FAILED, _E, "Failed to get app_info");
-
-       char *pkg_name = NULL;
-       error = pkgmgrinfo_appinfo_get_pkgname(app_info, &pkg_name);
-       if (error != PMINFO_R_OK || pkg_name == NULL) {
-               pkgmgrinfo_appinfo_destroy_appinfo(app_info);
-               _E("Failed to get package name");
-               return ERR_OPERATION_FAILED;
-       }
+       IF_FAIL_RETURN_TAG(priv, ERR_OPERATION_FAILED, _E, "Invalid parameter");
 
-       error = privilege_checker_check_package_privilege(pkg_name, priv);
-       pkgmgrinfo_appinfo_destroy_appinfo(app_info);
+       char *subject = NULL;
+       int ret = smack_new_label_from_self(&subject);
+       IF_FAIL_RETURN_TAG(ret == 0 && subject != NULL, ERR_OPERATION_FAILED, _E, "Getting smack label failed");
 
-       _D("Privilege checking result: %d", error);
+       std::string priv_name = "privilege::tizen::";
+       priv_name += priv;
+       ret = smack_have_access(subject, priv_name.c_str(), "rw");
+       g_free(subject);
 
-       if (error == PRIV_CHECKER_ERR_NONE) {
+       if (ret == 1)
                return ERR_NONE;
-       }
 
-       if (error == PRIV_CHECKER_ERR_INVALID_PRIVILEGE) {
+       if (ret == 0)
                return ERR_PERMISSION_DENIED;
-       }
 
        return ERR_OPERATION_FAILED;
 }
index cdda646..9d34b42 100644 (file)
 namespace ctx {
        namespace rule_validator {
 
-               bool check_option(ctx::jsonitem);
+               bool check_option(ctx::json &item);
                bool check_option_int(std::string name, std::string key, int value);
                bool check_option_string(std::string name, std::string key, std::string value);
-               bool check_option_reference(std::string event, ctx::jsonitem);
+               bool check_option_reference(std::string event, ctx::json &item);
                bool check_comparison_int(std::string name, std::string key, std::string op, int value);
                bool check_comparison_string(std::string name, std::string key, std::string op, std::string value);
                bool check_valid_key(int type, std::string name, std::string key);
 
-               bool set_ref_info(int type, ctx::jsonjref, std::string name, std::string key, std::string ref_key);
+               bool set_ref_info(int type, ctx::json *jref, std::string name, std::string key, std::string ref_key);
                int get_data_type(int type, std::string name, std::string key);
-               bool check_referential_data(std::string name, ctx::jsonref_info);
+               bool check_referential_data(std::string name, ctx::json &ref_info);
 
        }
 }      /* namespace ctx */
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
deleted file mode 100644 (file)
index 95d23f3..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(context-test)
-SET(EXEC context-test)
-
-# Source List
-FILE(GLOB_RECURSE UTC_SRCS src/*.c)
-MESSAGE("UTC Sources: ${UTC_SRCS}")
-
-INCLUDE_DIRECTORIES(
-       /usr/include
-       /usr/include/glib-2.0
-       ${CMAKE_SOURCE_DIR}/include
-)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
-       dlog
-       glib-2.0
-       capi-base-common
-       capi-appfw-app-control
-)
-
-SET(EXTRA_CFLAGS -fPIE)
-FOREACH(flag ${pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-# for Emulator
-IF("${ARCH}" STREQUAL "arm")
-       ADD_DEFINITIONS("-DTARGET")
-ELSE("${ARCH}" STREQUAL "arm")
-       ADD_DEFINITIONS("-DEMULATOR")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_EXECUTABLE(${EXEC} ${UTC_SRCS})
-TARGET_LINK_LIBRARIES(${EXEC} ${pkgs_LDFLAGS} ${target} -pie)
-SET_TARGET_PROPERTIES(${EXEC} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
-SET_TARGET_PROPERTIES(${EXEC} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEXT-TEST\"")
-
-INSTALL(TARGETS ${EXEC} DESTINATION /usr/bin)
diff --git a/test/src/main.c b/test/src/main.c
deleted file mode 100644 (file)
index 8eada05..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <glib/gprintf.h>
-
-#include "utc_context_trigger.h"
-#include "utc_context_history.h"
-
-#define RED(X) "\033[1;31m"X"\033[0m"
-
-static void signal_handler(int signo)
-{
-       g_print(RED("\nSIGNAL %d received\n"), signo);
-       exit(EXIT_SUCCESS);
-}
-
-int main(int argc, char** argv)
-{
-       signal(SIGINT,  signal_handler);
-       signal(SIGHUP,  signal_handler);
-       signal(SIGTERM, signal_handler);
-       signal(SIGQUIT, signal_handler);
-       signal(SIGABRT, signal_handler);
-
-       g_print("\n");
-       g_print("***********************************\n");
-       g_print("* Context Service Unit Test Cases *\n");
-       g_print("***********************************\n");
-       g_print("\n");
-
-#if !defined(GLIB_VERSION_2_36)
-       g_type_init();
-#endif
-       g_test_init(&argc, &argv, NULL);
-
-       g_test_add_func("/context_trigger/initialize", initialize);
-       g_test_add_func("/context_trigger/utc_context_trigger_create_p", utc_context_trigger_create_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_create_n", utc_context_trigger_create_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_destroy_p", utc_context_trigger_destroy_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_destroy_n", utc_context_trigger_destroy_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_set_callback_p", utc_context_trigger_set_callback_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_set_callback_n", utc_context_trigger_set_callback_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_add_rule_p", utc_context_trigger_add_rule_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_add_rule_n", utc_context_trigger_add_rule_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_remove_rule_p", utc_context_trigger_remove_rule_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_remove_rule_n", utc_context_trigger_remove_rule_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_enable_rule_p", utc_context_trigger_enable_rule_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_enable_rule_n", utc_context_trigger_enable_rule_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_disable_rule_p", utc_context_trigger_disable_rule_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_disable_rule_n", utc_context_trigger_disable_rule_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_get_own_rule_ids_p", utc_context_trigger_get_own_rule_ids_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_get_own_rule_ids_n", utc_context_trigger_get_own_rule_ids_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_get_rule_by_id_p", utc_context_trigger_get_rule_by_id_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_get_rule_by_id_n", utc_context_trigger_get_rule_by_id_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_create_p", utc_context_trigger_rule_create_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_create_n", utc_context_trigger_rule_create_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_destroy_p", utc_context_trigger_rule_destroy_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_destroy_n", utc_context_trigger_rule_destroy_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_add_entry_p", utc_context_trigger_rule_add_entry_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_add_entry_n", utc_context_trigger_rule_add_entry_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_set_action_app_control_p", utc_context_trigger_rule_set_action_app_control_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_set_action_app_control_n", utc_context_trigger_rule_set_action_app_control_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_set_action_notification_p", utc_context_trigger_rule_set_action_notification_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_set_action_notification_n", utc_context_trigger_rule_set_action_notification_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_set_description_p", utc_context_trigger_rule_set_description_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_set_description_n", utc_context_trigger_rule_set_description_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_get_description_p", utc_context_trigger_rule_get_description_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_get_description_n", utc_context_trigger_rule_get_description_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_event_create_p", utc_context_trigger_rule_event_create_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_event_create_n", utc_context_trigger_rule_event_create_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_event_is_supported_p", utc_context_trigger_rule_event_is_supported_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_event_is_supported_n", utc_context_trigger_rule_event_is_supported_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_condition_create_p", utc_context_trigger_rule_condition_create_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_condition_create_n", utc_context_trigger_rule_condition_create_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_condition_is_supported_p", utc_context_trigger_rule_condition_is_supported_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_condition_is_supported_n", utc_context_trigger_rule_condition_is_supported_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_destroy_p", utc_context_trigger_rule_entry_destroy_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_destroy_n", utc_context_trigger_rule_entry_destroy_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_key_p", utc_context_trigger_rule_entry_add_key_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_key_n", utc_context_trigger_rule_entry_add_key_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_comparison_int_p", utc_context_trigger_rule_entry_add_comparison_int_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_comparison_int_n", utc_context_trigger_rule_entry_add_comparison_int_n);
-//     g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_comparison_double_p", utc_context_trigger_rule_entry_add_comparison_double_p);
-//     g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_comparison_double_n", utc_context_trigger_rule_entry_add_comparison_double_n);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_comparison_string_p", utc_context_trigger_rule_entry_add_comparison_string_p);
-       g_test_add_func("/context_trigger/utc_context_trigger_rule_entry_add_comparison_string_n", utc_context_trigger_rule_entry_add_comparison_string_n);
-       g_test_add_func("/context_trigger/release", release);
-
-       g_test_add_func("/context_history/utc_context_history_create_p", utc_context_history_create_p);
-       g_test_add_func("/context_history/utc_context_history_create_n", utc_context_history_create_n);
-       g_test_add_func("/context_history/utc_context_history_destroy_p", utc_context_history_destroy_p);
-       g_test_add_func("/context_history/utc_context_history_destroy_n", utc_context_history_destroy_n);
-       g_test_add_func("/context_history/utc_context_history_filter_create_p", utc_context_history_filter_create_p);
-       g_test_add_func("/context_history/utc_context_history_filter_create_n", utc_context_history_filter_create_n);
-       g_test_add_func("/context_history/utc_context_history_filter_destroy_p", utc_context_history_filter_destroy_p);
-       g_test_add_func("/context_history/utc_context_history_filter_destroy_n", utc_context_history_filter_destroy_n);
-       g_test_add_func("/context_history/utc_context_history_filter_set_int_p", utc_context_history_filter_set_int_p);
-       g_test_add_func("/context_history/utc_context_history_filter_set_int_n", utc_context_history_filter_set_int_n);
-       g_test_add_func("/context_history/utc_context_history_filter_set_string_p", utc_context_history_filter_set_string_p);
-       g_test_add_func("/context_history/utc_context_history_filter_set_string_n", utc_context_history_filter_set_string_n);
-       g_test_add_func("/context_history/utc_context_history_get_list_p", utc_context_history_get_list_p);
-       g_test_add_func("/context_history/utc_context_history_get_list_n", utc_context_history_get_list_n);
-       g_test_add_func("/context_history/utc_context_history_list_get_count_p", utc_context_history_list_get_count_p);
-       g_test_add_func("/context_history/utc_context_history_list_get_count_n", utc_context_history_list_get_count_n);
-       g_test_add_func("/context_history/utc_context_history_list_get_current_p", utc_context_history_list_get_current_p);
-       g_test_add_func("/context_history/utc_context_history_list_get_current_n", utc_context_history_list_get_current_n);
-       g_test_add_func("/context_history/utc_context_history_list_move_first_p", utc_context_history_list_move_first_p);
-       g_test_add_func("/context_history/utc_context_history_list_move_first_n", utc_context_history_list_move_first_n);
-       g_test_add_func("/context_history/utc_context_history_list_move_next_p", utc_context_history_list_move_next_p);
-       g_test_add_func("/context_history/utc_context_history_list_move_next_n", utc_context_history_list_move_next_n);
-       g_test_add_func("/context_history/utc_context_history_list_destroy_p", utc_context_history_list_destroy_p);
-       g_test_add_func("/context_history/utc_context_history_list_destroy_n", utc_context_history_list_destroy_n);
-       g_test_add_func("/context_history/utc_context_history_record_create_p", utc_context_history_record_create_p);
-       g_test_add_func("/context_history/utc_context_history_record_create_n", utc_context_history_record_create_n);
-       g_test_add_func("/context_history/utc_context_history_record_get_int_p", utc_context_history_record_get_int_p);
-       g_test_add_func("/context_history/utc_context_history_record_get_int_n", utc_context_history_record_get_int_n);
-       g_test_add_func("/context_history/utc_context_history_record_get_string_p", utc_context_history_record_get_string_p);
-       g_test_add_func("/context_history/utc_context_history_record_get_string_n", utc_context_history_record_get_string_n);
-       g_test_add_func("/context_history/utc_context_history_record_set_int_p", utc_context_history_record_set_int_p);
-       g_test_add_func("/context_history/utc_context_history_record_set_int_n", utc_context_history_record_set_int_n);
-       g_test_add_func("/context_history/utc_context_history_record_set_string_p", utc_context_history_record_set_string_p);
-       g_test_add_func("/context_history/utc_context_history_record_set_string_p", utc_context_history_record_set_string_n);
-       g_test_add_func("/context_history/utc_context_history_record_destroy_p", utc_context_history_record_destroy_p);
-       g_test_add_func("/context_history/utc_context_history_record_destroy_n", utc_context_history_record_destroy_n);
-       g_test_add_func("/context_history/utc_context_history_record_insert_p", utc_context_history_record_insert_p);
-       g_test_add_func("/context_history/utc_context_history_record_insert_n", utc_context_history_record_insert_n);
-
-       return g_test_run();
-}
diff --git a/test/src/utc_context_history.c b/test/src/utc_context_history.c
deleted file mode 100644 (file)
index 54ad3a5..0000000
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <glib.h>
-#include <dlog.h>
-#include <context_history.h>
-#include "utc_context_history.h"
-#include <stdlib.h>
-
-#define RED(X)         "\033[1;31m"X"\033[0m"
-#define GREEN(X)       "\033[1;32m"X"\033[0m"
-#define YELLOW(X)      "\033[1;33m"X"\033[0m"
-#define BLUE(X)                "\033[1;34m"X"\033[0m"
-
-void utc_context_history_create_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-
-       error = context_history_create(&handle);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_destroy(handle);
-}
-
-void utc_context_history_create_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_create(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-
-void utc_context_history_destroy_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle;
-
-       context_history_create(&handle);
-       error = context_history_destroy(handle);
-
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-}
-
-void utc_context_history_destroy_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_filter_create_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_filter_h filter = NULL;
-
-       error = context_history_filter_create(&filter);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_filter_destroy(filter);
-}
-
-void utc_context_history_filter_create_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_filter_create(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_filter_destroy_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_filter_h filter;
-
-       context_history_filter_create(&filter);
-       error = context_history_filter_destroy(filter);
-
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-}
-
-void utc_context_history_filter_destroy_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_filter_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_filter_set_int_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_filter_h filter = NULL;
-
-       context_history_filter_create(&filter);
-
-       error = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 10);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_filter_destroy(filter);
-}
-
-void utc_context_history_filter_set_int_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_filter_set_int(NULL, CONTEXT_HISTORY_FILTER_TIME_SPAN, 10);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_filter_set_string_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_filter_h filter = NULL;
-
-       context_history_filter_create(&filter);
-
-       error = context_history_filter_set_string(filter, CONTEXT_HISTORY_FILTER_APP_ID, "org.tizen.sample");
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_filter_destroy(filter);
-}
-
-void utc_context_history_filter_set_string_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_filter_set_string(NULL, CONTEXT_HISTORY_FILTER_APP_ID, "org.tizen.sample");
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_get_list_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_get_list_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       error = context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, NULL, &list);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
-       context_history_list_destroy(list);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_get_count_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       int count;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error = context_history_list_get_count(list, &count);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_get_count_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error = context_history_list_get_count(list, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_get_current_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-       context_history_record_h record = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error = context_history_list_get_current(list, &record);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_record_destroy(record);
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_get_current_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error = context_history_list_get_current(list, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_move_first_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error = context_history_list_move_first(list);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_move_first_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_list_move_first(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_list_move_next_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error = context_history_list_move_next(list);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_move_next_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_list_move_next(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_list_destroy_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       error =  context_history_list_destroy(list);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_list_destroy_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_list_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_record_create_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_record_h record = NULL;
-
-       error =  context_history_record_create(&record);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_record_destroy(record);
-}
-
-void utc_context_history_record_create_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error =  context_history_record_create(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_record_get_int_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       int value;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-       context_history_record_h record = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       context_history_list_get_current(list, &record);
-
-       error = context_history_record_get_int(record, "UsedCount", &value);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_record_destroy(record);
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_record_get_int_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-       context_history_record_h record = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       context_history_list_get_current(list, &record);
-
-       error = context_history_record_get_int(record, "UsedCount", NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
-       context_history_record_destroy(record);
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_record_get_string_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       char *value = NULL;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-       context_history_record_h record = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       context_history_list_get_current(list, &record);
-
-       error = context_history_record_get_string(record, "AppId", &value);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       g_free(value);
-
-       context_history_record_destroy(record);
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_record_get_string_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_h handle = NULL;
-       context_history_filter_h filter = NULL;
-       context_history_list_h list = NULL;
-       context_history_record_h record = NULL;
-
-       context_history_create(&handle);
-
-       context_history_filter_create(&filter);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, 30);
-       context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, 10);
-
-       context_history_get_list(handle, CONTEXT_HISTORY_FREQUENTLY_USED_APP, filter, &list);
-
-       context_history_list_get_current(list, &record);
-
-       error = context_history_record_get_string(record, "AppId", NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-
-       context_history_record_destroy(record);
-       context_history_list_destroy(list);
-       context_history_filter_destroy(filter);
-       context_history_destroy(handle);
-}
-
-void utc_context_history_record_set_int_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_record_h record = NULL;
-
-       context_history_record_create(&record);
-
-       error =  context_history_record_set_int(record, "LastPosition", 200);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_record_destroy(record);
-}
-
-void utc_context_history_record_set_int_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error =  context_history_record_set_int(NULL, "LastPosition", 200);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_record_set_string_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_record_h record = NULL;
-
-       context_history_record_create(&record);
-
-       error =  context_history_record_set_string(record, "AppId", "org.tizen.sample");
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_record_destroy(record);
-}
-
-void utc_context_history_record_set_string_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error =  context_history_record_set_string(NULL, "AppId", "org.tizen.sample");
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_record_destroy_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_record_h record = NULL;
-
-       context_history_record_create(&record);
-
-       error = context_history_record_destroy(record);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-}
-
-void utc_context_history_record_destroy_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_record_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_history_record_insert_p(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-       context_history_record_h record = NULL;
-
-       context_history_record_create(&record);
-
-       context_history_record_set_string(record, "AppId", "org.tizen.sample");
-       context_history_record_set_int(NULL, "LastPosition", 200);
-
-       error = context_history_record_insert(record, CONTEXT_HISTORY_START_MUSIC);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_NONE);
-
-       context_history_record_destroy(record);
-}
-
-void utc_context_history_record_insert_n(void)
-{
-       int error = CONTEXT_HISTORY_ERROR_NONE;
-
-       error = context_history_record_insert(NULL, CONTEXT_HISTORY_START_MUSIC);
-       g_assert_cmpint(error, ==, CONTEXT_HISTORY_ERROR_INVALID_PARAMETER);
-}
-
-
diff --git a/test/src/utc_context_history.h b/test/src/utc_context_history.h
deleted file mode 100644 (file)
index 492c018..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CONTEXT_CONTEXT_HISTORY_API_TEST_H__
-#define __CONTEXT_CONTEXT_HISTORY_API_TEST_H__
-
-void utc_context_history_create_p(void);
-void utc_context_history_create_n(void);
-
-void utc_context_history_destroy_p(void);
-void utc_context_history_destroy_n(void);
-
-void utc_context_history_filter_create_p(void);
-void utc_context_history_filter_create_n(void);
-
-void utc_context_history_filter_destroy_p(void);
-void utc_context_history_filter_destroy_n(void);
-
-void utc_context_history_filter_set_int_p(void);
-void utc_context_history_filter_set_int_n(void);
-
-void utc_context_history_filter_set_string_p(void);
-void utc_context_history_filter_set_string_n(void);
-
-void utc_context_history_get_list_p(void);
-void utc_context_history_get_list_n(void);
-
-void utc_context_history_list_get_count_p(void);
-void utc_context_history_list_get_count_n(void);
-
-void utc_context_history_list_get_current_p(void);
-void utc_context_history_list_get_current_n(void);
-
-void utc_context_history_list_move_first_p(void);
-void utc_context_history_list_move_first_n(void);
-
-void utc_context_history_list_move_next_p(void);
-void utc_context_history_list_move_next_n(void);
-
-void utc_context_history_list_destroy_p(void);
-void utc_context_history_list_destroy_n(void);
-
-void utc_context_history_record_create_p(void);
-void utc_context_history_record_create_n(void);
-
-void utc_context_history_record_get_int_p(void);
-void utc_context_history_record_get_int_n(void);
-
-void utc_context_history_record_get_string_p(void);
-void utc_context_history_record_get_string_n(void);
-
-void utc_context_history_record_set_int_p(void);
-void utc_context_history_record_set_int_n(void);
-
-void utc_context_history_record_set_string_p(void);
-void utc_context_history_record_set_string_n(void);
-
-void utc_context_history_record_destroy_p(void);
-void utc_context_history_record_destroy_n(void);
-
-void utc_context_history_record_insert_p(void);
-void utc_context_history_record_insert_n(void);
-
-#endif /* __CONTEXT_CONTEXT_HISTORY_API_TEST_H__ */
diff --git a/test/src/utc_context_trigger.c b/test/src/utc_context_trigger.c
deleted file mode 100644 (file)
index d407bf9..0000000
+++ /dev/null
@@ -1,1187 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <glib.h>
-#include <dlog.h>
-#include <context_trigger.h>
-#include <context_trigger_internal.h>
-#include "utc_context_trigger.h"
-#include <stdlib.h>
-
-#define RED(X)         "\033[1;31m"X"\033[0m"
-#define GREEN(X)       "\033[1;32m"X"\033[0m"
-#define YELLOW(X)      "\033[1;33m"X"\033[0m"
-#define BLUE(X)                "\033[1;34m"X"\033[0m"
-
-static GMainLoop *mainloop = NULL;
-static int rid;
-
-app_control_h app;
-
-void initialize(void)
-{
-       g_print("Initialize");
-
-       int ret = app_control_create(&app);
-       g_assert_cmpint(ret, ==, APP_CONTROL_ERROR_NONE);
-
-       ret = app_control_set_operation(app, APP_CONTROL_OPERATION_DEFAULT);
-       g_assert_cmpint(ret, ==, APP_CONTROL_ERROR_NONE);
-
-       ret = app_control_set_app_id (app, "org.tizen.setting");
-       g_assert_cmpint(ret, ==, APP_CONTROL_ERROR_NONE);
-}
-
-void release(void)
-{
-       g_print("Release");
-
-       int ret = app_control_destroy(app);
-       g_assert_cmpint(ret, ==, APP_CONTROL_ERROR_NONE);
-}
-
-static void triggered_cb(int rule_id, context_trigger_error_e error, void* user_data)
-{
-       g_print(GREEN("#ContextTrigger# Rule%d triggered. error = %d\n"), rule_id, error);
-
-       g_main_loop_quit(mainloop);
-
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpint(rid, ==, rule_id);
-       rid = 0;
-}
-
-void utc_context_trigger_create_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-
-       error = context_trigger_create(&handle);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_create_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_create(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_destroy_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle;
-
-       context_trigger_create(&handle);
-       error = context_trigger_destroy(handle);
-
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-}
-
-void utc_context_trigger_destroy_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_set_callback_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-
-       error = context_trigger_create(&handle);
-
-       error = context_trigger_set_callback(handle, triggered_cb);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_set_callback_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-
-       error = context_trigger_create(&handle);
-
-       error = context_trigger_set_callback(NULL, triggered_cb);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_set_callback(handle, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_add_rule_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_h rule2 = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h event2 = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-       context_trigger_rule_entry_h condition2 = NULL;
-       context_trigger_rule_entry_h condition3 = NULL;
-       int rule_id;
-       int rule_id2;
-
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_DAY_OF_WEEK, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition3);
-       context_trigger_rule_entry_add_key(condition3, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "DayOfWeek");
-       context_trigger_rule_entry_add_comparison_string(condition3, "DayOfWeek", "==", "Mon");
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       context_trigger_rule_entry_add_comparison_int(event, "IsConnected", "==", CONTEXT_TRIGGER_TRUE);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Normal");
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_add_entry(rule, condition);
-       context_trigger_rule_add_entry(rule, condition3);
-       context_trigger_rule_set_action_app_control(rule, app);
-
-       error = context_trigger_add_rule(rule, &rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpint(rule_id, >, 0);
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule2);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, &event2);
-       context_trigger_rule_entry_add_key(event2, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, "IsConnected");
-       context_trigger_rule_entry_add_comparison_int(event2, "IsConnected", "==", CONTEXT_TRIGGER_TRUE);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, &condition2);
-       context_trigger_rule_entry_add_key(condition2, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition2, "Level", "==", "Normal");
-       context_trigger_rule_add_entry(rule2, event2);
-       context_trigger_rule_add_entry(rule2, condition3);
-       context_trigger_rule_add_entry(rule2, condition2);
-       context_trigger_rule_set_action_app_control(rule2, app);
-
-       error = context_trigger_add_rule(rule2, &rule_id2);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpint(rule_id, ==, rule_id2);
-
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_entry_destroy(event2);
-       context_trigger_rule_entry_destroy(condition2);
-       context_trigger_rule_entry_destroy(condition3);
-       context_trigger_rule_destroy(rule);
-       context_trigger_rule_destroy(rule2);
-}
-
-void utc_context_trigger_add_rule_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-       int rule_id;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       context_trigger_rule_entry_add_comparison_int(event, "IsConnected", "==", CONTEXT_TRIGGER_TRUE);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Normal");
-       context_trigger_rule_add_entry(rule, condition);
-
-       error = context_trigger_add_rule(rule, &rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       context_trigger_rule_add_entry(rule, event);
-
-       error = context_trigger_add_rule(rule, &rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       context_trigger_rule_set_action_app_control(rule, app);
-
-       error = context_trigger_add_rule(NULL, &rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_add_rule(rule, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_remove_rule_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-
-       error = context_trigger_remove_rule(rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_remove_rule_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_set_callback(handle, triggered_cb);
-       context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-
-       error = context_trigger_remove_rule(-1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_remove_rule(rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_ENABLED);
-
-       error = context_trigger_remove_rule(rule_id + 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST);
-
-       context_trigger_disable_rule_with_handle(handle, rule_id);
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_enable_rule_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       context_trigger_rule_entry_add_comparison_int(event, "IsConnected", "==", CONTEXT_TRIGGER_TRUE);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Normal");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "High");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Full");
-
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_add_entry(rule, condition);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_set_callback(handle, triggered_cb);
-       rid = rule_id;
-
-       error = context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       g_print(YELLOW("\n#ContextTrigger# When any type of headphone is connected, if battery is normal, high, or full...\n"));
-       mainloop = g_main_loop_new(NULL, FALSE);
-       g_main_loop_run(mainloop);
-
-       g_main_loop_unref(mainloop);
-
-       context_trigger_disable_rule_with_handle(handle, rule_id);
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_enable_rule_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-
-       error = context_trigger_enable_rule_with_handle(NULL, rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_enable_rule_with_handle(handle, -1, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_CALLBACK_NOT_REGISTERED);
-
-       context_trigger_set_callback(handle, triggered_cb);
-
-       error = context_trigger_enable_rule_with_handle(handle, rule_id+1, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST);
-
-       context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-
-       error = context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_ENABLED);
-
-       context_trigger_disable_rule_with_handle(handle, rule_id);
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_disable_rule_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_set_callback(handle, triggered_cb);
-       context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-
-       error = context_trigger_disable_rule_with_handle(handle, rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_disable_rule_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_set_callback(handle, triggered_cb);
-       context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-
-       error = context_trigger_disable_rule_with_handle(NULL, rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_disable_rule_with_handle(handle, -1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_disable_rule_with_handle(handle, rule_id + 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST);
-
-       context_trigger_disable_rule_with_handle(handle, rule_id);
-
-       error = context_trigger_disable_rule_with_handle(handle, rule_id);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_NOT_ENABLED);
-
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_get_own_rule_ids_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule1 = NULL;
-       context_trigger_rule_h rule2 = NULL;
-       context_trigger_rule_entry_h event1 = NULL;
-       context_trigger_rule_entry_h event2 = NULL;
-       int rule_id1;
-       int rule_id2;
-       int* enabled_arr;
-       int enabled_count;
-       int* disabled_arr;
-       int disabled_count;
-
-       error = context_trigger_get_own_rule_ids(&enabled_arr, &enabled_count, &disabled_arr, &disabled_count);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpint(enabled_count, ==, 0);
-       g_assert_cmpint(disabled_count, ==, 0);
-
-       if (enabled_arr) {
-               free(enabled_arr);
-               enabled_arr = NULL;
-       }
-
-       if (disabled_arr) {
-               free(disabled_arr);
-               disabled_arr = NULL;
-       }
-
-       context_trigger_create(&handle);
-       context_trigger_set_callback(handle, triggered_cb);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule1);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event1);
-       context_trigger_rule_add_entry(rule1, event1);
-       context_trigger_rule_set_action_app_control(rule1, app);
-       context_trigger_add_rule(rule1, &rule_id1);
-       context_trigger_enable_rule_with_handle(handle, rule_id1, NULL);
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule2);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event2);
-       context_trigger_rule_add_entry(rule2, event2);
-       context_trigger_rule_set_action_app_control(rule2, app);
-       context_trigger_add_rule(rule2, &rule_id2);
-
-       error = context_trigger_get_own_rule_ids(&enabled_arr, &enabled_count, &disabled_arr, &disabled_count);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpint(enabled_count, ==, 1);
-       g_assert_cmpint(disabled_count, ==, 1);
-       g_assert_cmpint(rule_id1, ==, enabled_arr[0]);
-       g_assert_cmpint(rule_id2, ==, disabled_arr[0]);
-
-       if (enabled_arr) {
-               free(enabled_arr);
-               enabled_arr = NULL;
-       }
-
-       if (disabled_arr) {
-               free(disabled_arr);
-               disabled_arr = NULL;
-       }
-
-       context_trigger_disable_rule_with_handle(handle, rule_id1);
-       context_trigger_remove_rule(rule_id1);
-       context_trigger_remove_rule(rule_id2);
-       context_trigger_rule_entry_destroy(event1);
-       context_trigger_rule_entry_destroy(event2);
-       context_trigger_rule_destroy(rule1);
-       context_trigger_rule_destroy(rule2);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_get_own_rule_ids_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       int* arr1;
-       int count1;
-       int* arr2;
-       int count2;
-
-       error = context_trigger_get_own_rule_ids(&arr1, NULL, NULL, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(NULL, &count1, NULL, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(NULL, NULL, &arr2, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(NULL, NULL, NULL, &count2);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(&arr1, &count1, &arr2, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(&arr1, &count1, NULL, &count2);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(NULL, &count1, &arr2, &count2);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_own_rule_ids(&arr1, NULL, &arr2, &count2);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_get_rule_by_id_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-       context_trigger_rule_h rule_result = NULL;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-
-       error = context_trigger_get_rule_by_id(rule_id, &rule_result);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_rule_destroy(rule_result);
-}
-
-void utc_context_trigger_get_rule_by_id_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-       context_trigger_rule_h rule_result = NULL;
-
-       error = context_trigger_get_rule_by_id(0, &rule_result);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-
-       error = context_trigger_get_rule_by_id(rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_get_rule_by_id(rule_id + 1, &rule_result);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_RULE_NOT_EXIST);
-
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_create_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-
-       error = context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_create_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-
-       error = context_trigger_rule_create(-1, &rule);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_destroy_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-
-       error = context_trigger_rule_destroy(rule);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-}
-
-void utc_context_trigger_rule_destroy_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_rule_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_add_entry_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Normal");
-
-       error = context_trigger_rule_add_entry(rule, event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       error = context_trigger_rule_add_entry(rule, condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_add_entry_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h event2 = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event2);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_DAY_OF_WEEK, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-
-       error = context_trigger_rule_add_entry(NULL, event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_add_entry(rule, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_add_entry(rule, event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       error = context_trigger_rule_add_entry(rule, event2);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       error = context_trigger_rule_add_entry(rule, condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       error = context_trigger_rule_add_entry(rule, condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(event2);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_set_action_app_control_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       context_trigger_rule_entry_add_comparison_int(event, "IsConnected", "==", CONTEXT_TRIGGER_TRUE);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Normal");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "High");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Full");
-
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_add_entry(rule, condition);
-
-       error = context_trigger_rule_set_action_app_control(rule, app);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_set_callback(handle, triggered_cb);
-
-       error = context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       rid = rule_id;
-
-       g_print(YELLOW("\n#ContextTrigger# When any type of headphone is connected, if battery is normal, high, or full.... setting app will be executed...\n"));
-       mainloop = g_main_loop_new(NULL, FALSE);
-       g_main_loop_run(mainloop);
-
-       g_main_loop_unref(mainloop);
-
-       context_trigger_disable_rule_with_handle(handle, rule_id);
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_rule_set_action_app_control_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_rule_set_action_app_control(NULL, app);
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       app_control_h invalid_app = NULL;
-
-       error = context_trigger_rule_set_action_app_control(rule, invalid_app);
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_set_action_notification_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_h handle = NULL;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-       int rule_id;
-
-       context_trigger_create(&handle);
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       context_trigger_rule_entry_add_comparison_int(event, "IsConnected", "==", CONTEXT_TRIGGER_TRUE);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       context_trigger_rule_entry_add_key(condition, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, "Level");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Normal");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "High");
-       context_trigger_rule_entry_add_comparison_string(condition, "Level", "==", "Full");
-
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_add_entry(rule, condition);
-
-       error = context_trigger_rule_set_action_notification(rule, "Notification title", "Notification content", NULL, app);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_set_callback(handle, triggered_cb);
-
-       error = context_trigger_enable_rule_with_handle(handle, rule_id, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       rid = rule_id;
-
-       g_print(YELLOW("\n#ContextTrigger# When any type of headphone is connected, if battery is normal, high, or full.... notification will be posted...\n"));
-       mainloop = g_main_loop_new(NULL, FALSE);
-       g_main_loop_run(mainloop);
-
-       g_main_loop_unref(mainloop);
-
-       context_trigger_disable_rule_with_handle(handle, rule_id);
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_entry_destroy(condition);
-       context_trigger_rule_destroy(rule);
-       context_trigger_destroy(handle);
-}
-
-void utc_context_trigger_rule_set_action_notification_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_rule_set_action_notification(NULL, "Notification title", "Notification content", NULL, NULL);
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-
-       error = context_trigger_rule_set_action_notification(rule, NULL, "Notification content", NULL, NULL);
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_set_action_notification(rule, "Notification title", NULL, NULL, NULL);
-       g_assert_cmpint(error, == , CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_set_description_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-
-       error = context_trigger_rule_set_description(rule, "Rule description test");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_destroy(rule);
-}
-
-void utc_context_trigger_rule_set_description_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_rule_set_description(NULL, "Rule description test");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_get_description_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-       context_trigger_rule_h rule_result = NULL;
-       const char* description = "When Headphone state changed";
-       char* des_result;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_set_description(rule, description);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_get_rule_by_id(rule_id, &rule_result);
-
-       error = context_trigger_rule_get_description(rule_result, &des_result);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert_cmpstr(des_result, ==, description);
-
-       if (des_result) {
-               free(des_result);
-               des_result = NULL;
-       }
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_rule_destroy(rule_result);
-}
-
-void utc_context_trigger_rule_get_description_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_h rule = NULL;
-       context_trigger_rule_entry_h event = NULL;
-       int rule_id;
-       context_trigger_rule_h rule_result = NULL;
-       const char* description = "When Headphone state changed";
-       char* des_result;
-
-       context_trigger_rule_create(CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &rule);
-       context_trigger_rule_set_description(rule, description);
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_add_entry(rule, event);
-       context_trigger_rule_set_action_app_control(rule, app);
-       context_trigger_add_rule(rule, &rule_id);
-       context_trigger_get_rule_by_id(rule_id, &rule_result);
-
-       error = context_trigger_rule_get_description(NULL, &des_result);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_get_description(rule_result, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_remove_rule(rule_id);
-       context_trigger_rule_entry_destroy(event);
-       context_trigger_rule_destroy(rule);
-       context_trigger_rule_destroy(rule_result);
-}
-
-void utc_context_trigger_rule_event_create_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       error = context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-void utc_context_trigger_rule_event_create_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       error = context_trigger_rule_event_create(-1, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, -1, &event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_event_is_supported_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       bool supported;
-
-       error = context_trigger_rule_event_is_supported(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, &supported);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert(supported);
-
-       error = context_trigger_rule_event_is_supported(CONTEXT_TRIGGER_EVENT_ON_TIME, &supported);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert(supported);
-}
-
-void utc_context_trigger_rule_event_is_supported_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       bool supported;
-
-       error = context_trigger_rule_event_is_supported(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_event_is_supported(-1, &supported);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_condition_create_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h condition = NULL;
-
-       error = context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(condition);
-}
-
-void utc_context_trigger_rule_condition_create_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h condition = NULL;
-
-       error = context_trigger_rule_condition_create(-1, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_HEADPHONE, -1, &condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_condition_is_supported_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       bool supported;
-
-       error = context_trigger_rule_condition_is_supported(CONTEXT_TRIGGER_CONDITION_SYSTEM_HEADPHONE, &supported);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert(supported);
-
-       error = context_trigger_rule_condition_is_supported(CONTEXT_TRIGGER_CONDITION_DAY_OF_MONTH, &supported);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-       g_assert(supported);
-}
-
-void utc_context_trigger_rule_condition_is_supported_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       bool supported;
-
-       error = context_trigger_rule_condition_is_supported(CONTEXT_TRIGGER_CONDITION_SYSTEM_HEADPHONE, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_condition_is_supported(-1, &supported);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_entry_destroy_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-       context_trigger_rule_entry_h condition = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_condition_create(CONTEXT_TRIGGER_CONDITION_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &condition);
-
-       error = context_trigger_rule_entry_destroy(event);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       error = context_trigger_rule_entry_destroy(condition);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-}
-
-void utc_context_trigger_rule_entry_destroy_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-
-       error = context_trigger_rule_entry_destroy(NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-}
-
-void utc_context_trigger_rule_entry_add_key_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-
-       error = context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-void utc_context_trigger_rule_entry_add_key_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_HEADPHONE, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-
-       error = context_trigger_rule_entry_add_key(NULL, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "IsConnected");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_key(event, -1, "IsConnected");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, NULL);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-void utc_context_trigger_rule_entry_add_comparison_int_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "TimeOfDay");
-
-       error = context_trigger_rule_entry_add_comparison_int(event, "TimeOfDay", "==", 16);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-void utc_context_trigger_rule_entry_add_comparison_int_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_ON_TIME, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-
-       error = context_trigger_rule_entry_add_comparison_int(event, "TimeOfDay", "==", 16);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NO_DATA);
-
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_DISJUNCTION, "TimeOfDay");
-
-       error = context_trigger_rule_entry_add_comparison_int(NULL, "TimeOfDay", "==", 16);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_int(event, NULL, "==", 16);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_int(event, "TimeOfDay", NULL, 16);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_int(event, "TimeOfDay", "and", 16);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-/*
-void utc_context_trigger_rule_entry_add_comparison_double_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "res");
-
-       error = context_trigger_rule_entry_add_comparison_double(event, "res", "==", 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-void utc_context_trigger_rule_entry_add_comparison_double_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-
-       error = context_trigger_rule_entry_add_comparison_double(event, "res", "==", 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NO_DATA);
-
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "res");
-
-       error = context_trigger_rule_entry_add_comparison_double(NULL, "res", "==", 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_double(event, NULL, "==", 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_double(event, "res", NULL, 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_double(event, "res", "and", 1);
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-*/
-void utc_context_trigger_rule_entry_add_comparison_string_p(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "Level");
-
-       error = context_trigger_rule_entry_add_comparison_string(event, "Level", "==", "Normal");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NONE);
-
-       context_trigger_rule_entry_destroy(event);
-}
-
-void utc_context_trigger_rule_entry_add_comparison_string_n(void)
-{
-       int error = CONTEXT_TRIGGER_ERROR_NONE;
-       context_trigger_rule_entry_h event = NULL;
-
-       context_trigger_rule_event_create(CONTEXT_TRIGGER_EVENT_SYSTEM_BATTERY, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, &event);
-       error = context_trigger_rule_entry_add_comparison_string(event, "Level", "==", "Normal");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_NO_DATA);
-
-       context_trigger_rule_entry_add_key(event, CONTEXT_TRIGGER_LOGICAL_CONJUNCTION, "Level");
-
-       error = context_trigger_rule_entry_add_comparison_string(NULL, "Level", "==", "Normal");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_string(event, NULL, "==", "Normal");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_string(event, "Level", NULL, "Normal");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER);
-
-       error = context_trigger_rule_entry_add_comparison_string(event, "Level", "and", "Normal");
-       g_assert_cmpint(error, ==, CONTEXT_TRIGGER_ERROR_INVALID_RULE);
-
-       context_trigger_rule_entry_destroy(event);
-}
diff --git a/test/src/utc_context_trigger.h b/test/src/utc_context_trigger.h
deleted file mode 100644 (file)
index df262b6..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CONTEXT_CONTEXT_TRIGGER_API_TEST_H__
-#define __CONTEXT_CONTEXT_TRIGGER_API_TEST_H__
-
-void initialize(void);
-void release(void);
-
-void utc_context_trigger_create_p(void);
-void utc_context_trigger_create_n(void);
-
-void utc_context_trigger_destroy_p(void);
-void utc_context_trigger_destroy_n(void);
-
-void utc_context_trigger_set_callback_p(void);
-void utc_context_trigger_set_callback_n(void);
-
-void utc_context_trigger_add_rule_p(void);
-void utc_context_trigger_add_rule_n(void);
-
-void utc_context_trigger_remove_rule_p(void);
-void utc_context_trigger_remove_rule_n(void);
-
-void utc_context_trigger_enable_rule_p(void);
-void utc_context_trigger_enable_rule_n(void);
-
-void utc_context_trigger_disable_rule_p(void);
-void utc_context_trigger_disable_rule_n(void);
-
-void utc_context_trigger_get_own_rule_ids_p(void);
-void utc_context_trigger_get_own_rule_ids_n(void);
-
-void utc_context_trigger_get_rule_by_id_p(void);
-void utc_context_trigger_get_rule_by_id_n(void);
-
-void utc_context_trigger_rule_create_p(void);
-void utc_context_trigger_rule_create_n(void);
-
-void utc_context_trigger_rule_destroy_p(void);
-void utc_context_trigger_rule_destroy_n(void);
-
-void utc_context_trigger_rule_add_entry_p(void);
-void utc_context_trigger_rule_add_entry_n(void);
-
-void utc_context_trigger_rule_set_action_app_control_p(void);
-void utc_context_trigger_rule_set_action_app_control_n(void);
-
-void utc_context_trigger_rule_set_action_notification_p(void);
-void utc_context_trigger_rule_set_action_notification_n(void);
-
-void utc_context_trigger_rule_set_description_p(void);
-void utc_context_trigger_rule_set_description_n(void);
-
-void utc_context_trigger_rule_get_description_p(void);
-void utc_context_trigger_rule_get_description_n(void);
-
-void utc_context_trigger_rule_event_create_p(void);
-void utc_context_trigger_rule_event_create_n(void);
-
-void utc_context_trigger_rule_event_is_supported_p(void);
-void utc_context_trigger_rule_event_is_supported_n(void);
-
-void utc_context_trigger_rule_condition_create_p(void);
-void utc_context_trigger_rule_condition_create_n(void);
-
-void utc_context_trigger_rule_condition_is_supported_p(void);
-void utc_context_trigger_rule_condition_is_supported_n(void);
-
-void utc_context_trigger_rule_entry_destroy_p(void);
-void utc_context_trigger_rule_entry_destroy_n(void);
-
-void utc_context_trigger_rule_entry_add_key_p(void);
-void utc_context_trigger_rule_entry_add_key_n(void);
-
-void utc_context_trigger_rule_entry_add_comparison_int_p(void);
-void utc_context_trigger_rule_entry_add_comparison_int_n(void);
-/*
-void utc_context_trigger_rule_entry_add_comparison_double_p(void);
-void utc_context_trigger_rule_entry_add_comparison_double_n(void);
-*/
-void utc_context_trigger_rule_entry_add_comparison_string_p(void);
-void utc_context_trigger_rule_entry_add_comparison_string_n(void);
-
-#endif /* __CONTEXT_CONTEXT_TRIGGER_API_TEST_H__ */