From: Mu-Woong Date: Tue, 4 Aug 2015 11:58:24 +0000 (+0900) Subject: Merge Version 0.5.5 X-Git-Tag: submit/tizen_tv/20150810.020506^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96aaefcaebc6a70a59ec995c3327b5e9a97a2355;p=platform%2Fcore%2Fapi%2Fcontext.git Merge Version 0.5.5 - Remove unnecessary dependency to pkgmgr-info - Disable internal 'dbus call' trigger action api - Add an internal function to set 'dbus call' action Change-Id: I8ba890181055753371538192e824645a87d21704 Signed-off-by: Mu-Woong --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 888350b..d8935ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ FILE(GLOB_RECURSE SRCS src/*.cpp) MESSAGE("Sources: ${SRCS}") # Dependencies -SET(DEPS "aul bundle pkgmgr-info capi-appfw-app-control context-common") +SET(DEPS "aul bundle capi-appfw-app-control context-common") # Common Options INCLUDE(FindPkgConfig) @@ -37,7 +37,9 @@ SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER}) INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries) INSTALL( DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/context-service - FILES_MATCHING PATTERN "*.h" + FILES_MATCHING + PATTERN "context_trigger_internal.h" EXCLUDE + PATTERN "*.h" ) SET(VERSION ${FULLVER}) diff --git a/include/context_trigger_internal.h b/include/context_trigger_internal.h new file mode 100644 index 0000000..93f24f3 --- /dev/null +++ b/include/context_trigger_internal.h @@ -0,0 +1,45 @@ +/* + * 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. + */ + +#ifndef __TIZEN_CONTEXT_CONTEXT_TRIGGER_INTERNAL_H__ +#define __TIZEN_CONTEXT_CONTEXT_TRIGGER_INTERNAL_H__ + +#include + +/** + * @brief Sets a D-Bus method call as the action of a rule. + * @since_tizen 2.4 + * + * @param[in] rule The rule to set the action on + * @param[in] bus_name Destination remote bus name + * @param[in] object_path Path of the remote object + * @param[in] interface_name D-Bus interface to invoke method on + * @param[in] method_name The name of the method to invoke + * @param[in] user_data A user-defined string to be delivered as the first parameter of the method. + * @c NULL if not passing any values. + * + * @return 0 on success, otherwise a negative error value + * @retval #CONTEXT_TRIGGER_ERROR_NONE Successful + * @retval #CONTEXT_TRIGGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CONTEXT_TRIGGER_ERROR_PERMISSION_DENIED Permission denied + * @retval #CONTEXT_TRIGGER_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CONTEXT_TRIGGER_ERROR_OPERATION_FAILED Operation failed + */ +int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule, + const char *bus_name, const char *object_path, const char *interface_name, + const char *method_name, const char *user_data); + +#endif diff --git a/include/context_trigger_types_internal.h b/include/context_trigger_types_internal.h index 90b4803..94e5e0f 100644 --- a/include/context_trigger_types_internal.h +++ b/include/context_trigger_types_internal.h @@ -29,6 +29,7 @@ #define CT_RULE_ACTION_TYPE_APP_CONTROL "app_control" #define CT_RULE_ACTION_TYPE_NOTIFICATION "notification" +#define CT_RULE_ACTION_TYPE_DBUS_CALL "dbus_call" #define CT_RULE_ID "ID" #define CT_RULE_DESCRIPTION "DESCRIPTION" @@ -54,6 +55,12 @@ #define CT_RULE_ACTION_NOTI_CONTENT "ACTION_NOTI_CONTENT" #define CT_RULE_ACTION_NOTI_ICON_PATH "ACTION_NOTI_ICON_PATH" +#define CT_RULE_ACTION_DBUS_NAME "ACTION_DBUS_NAME" +#define CT_RULE_ACTION_DBUS_OBJECT "ACTION_DBUS_OBJ" +#define CT_RULE_ACTION_DBUS_INTERFACE "ACTION_DBUS_IFACE" +#define CT_RULE_ACTION_DBUS_METHOD "ACTION_DBUS_METHOD" +#define CT_RULE_ACTION_DBUS_USER_DATA "ACTION_DBUS_USERDATA" + #define CT_RESPONSE "RES" #define CT_EVENT_TIME "timer/event" diff --git a/packaging/context.spec b/packaging/context.spec index c924694..56d5752 100644 --- a/packaging/context.spec +++ b/packaging/context.spec @@ -1,6 +1,6 @@ Name: context Summary: Tizen Context Framework Native API -Version: 0.5.3 +Version: 0.5.5 Release: 1 Group: System/API License: Apache-2.0 @@ -10,7 +10,6 @@ BuildRequires: cmake BuildRequires: pkgconfig(aul) BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(capi-appfw-app-control) -BuildRequires: pkgconfig(pkgmgr-info) BuildRequires: pkgconfig(context-common) %description diff --git a/src/context_trigger.cpp b/src/context_trigger.cpp index 9b1f8f4..dbf366d 100644 --- a/src/context_trigger.cpp +++ b/src/context_trigger.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "rule_validator.h" @@ -431,6 +432,29 @@ EXTAPI int context_trigger_rule_set_action_notification(context_trigger_rule_h r return CONTEXT_TRIGGER_ERROR_NONE; } +#if 0 +EXTAPI int context_trigger_rule_set_action_dbus_call(context_trigger_rule_h rule, + const char *bus_name, const char *object_path, const char *interface_name, const char *method_name, const char *user_data) +{ + ASSERT_NOT_NULL(rule && bus_name && object_path && interface_name && method_name); + + // if action arleady exists + std::string type; + if ((rule->jrule).get(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_TYPE, &type)) + return CONTEXT_TRIGGER_ERROR_INVALID_RULE; + + // Set D-Bus info + (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_TYPE, CT_RULE_ACTION_TYPE_DBUS_CALL); + (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_NAME, bus_name); + (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_OBJECT, object_path); + (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_INTERFACE, interface_name); + (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_METHOD, method_name); + (rule->jrule).set(CT_RULE_DETAILS "." CT_RULE_ACTION, CT_RULE_ACTION_DBUS_USER_DATA, (user_data ? user_data : "")); + + return CONTEXT_TRIGGER_ERROR_NONE; +} +#endif + // Set description EXTAPI int context_trigger_rule_set_description(context_trigger_rule_h rule, const char* description) {