summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyeonghun Lee <kh9090.lee@samsung.com>2016-04-06 11:59:05 +0900
committerKyeonghun Lee <kh9090.lee@samsung.com>2016-04-06 11:59:05 +0900
commita30b939bc03bb25f26b3ffc0fb65c6adcadde222 (patch)
tree61e1ea44dea6a213a5a33bf787ef5626da65f1df
parentd35fe7a1ed2cd493b8f00966bdd49c69d936ba46 (diff)
downloadmsg-service-a30b939bc03bb25f26b3ffc0fb65c6adcadde222.tar.gz
msg-service-a30b939bc03bb25f26b3ffc0fb65c6adcadde222.tar.bz2
msg-service-a30b939bc03bb25f26b3ffc0fb65c6adcadde222.zip
Change-Id: If7d377571e9386ef9d1c6bd3b752c5855dd44b70 Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
-rwxr-xr-xframework/CMakeLists.txt2
-rwxr-xr-xframework/deliver-handler/MsgDeliverHandler.cpp144
-rwxr-xr-xinclude/utils/MsgUtilFile.h1
-rwxr-xr-xinclude/utils/MsgUtilFunction.h4
-rwxr-xr-xpackaging/msg-service.spec2
-rwxr-xr-xutils/CMakeLists.txt2
-rwxr-xr-xutils/MsgUtilFile.cpp32
-rwxr-xr-xutils/MsgUtilFunction.cpp25
8 files changed, 89 insertions, 123 deletions
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
index 2e639c3..1fc04c9 100755
--- a/framework/CMakeLists.txt
+++ b/framework/CMakeLists.txt
@@ -70,7 +70,7 @@ INCLUDE_DIRECTORIES(
)
INCLUDE(FindPkgConfig)
-pkg_check_modules(fw_handler_pkgs REQUIRED glib-2.0 gio-2.0 dlog vconf capi-appfw-application)
+pkg_check_modules(fw_handler_pkgs REQUIRED glib-2.0 gio-2.0 dlog vconf)
FOREACH(flag ${fw_handler_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -std=c++0x")
diff --git a/framework/deliver-handler/MsgDeliverHandler.cpp b/framework/deliver-handler/MsgDeliverHandler.cpp
index 3d04847..b57b995 100755
--- a/framework/deliver-handler/MsgDeliverHandler.cpp
+++ b/framework/deliver-handler/MsgDeliverHandler.cpp
@@ -14,9 +14,6 @@
* limitations under the License.
*/
-#ifndef MSG_WEARABLE_PROFILE
-#include <app_control.h>
-#endif // MSG_WEARABLE_PROFILE
#include <bundle.h>
#include <eventsystem.h>
@@ -45,28 +42,20 @@ void MsgLaunchClass0(msg_message_id_t msgId)
{
MSG_BEGIN();
#ifndef MSG_WEARABLE_PROFILE
- app_control_h svc_h;
-
- int ret = APP_CONTROL_ERROR_NONE;
-
- ret = app_control_create(&svc_h);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_create() is failed : %d", ret);
- app_control_destroy(svc_h);
- return;
- }
+ int ret = 0;
+ msg_error_t err = MSG_SUCCESS;
+ bundle *b = NULL;
- ret = app_control_set_app_id(svc_h, "org.tizen.msg-ui-class0");
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_set_app_id() is failed : %d", ret);
- app_control_destroy(svc_h);
+ b = bundle_create();
+ if (b == NULL) {
+ MSG_DEBUG("bundle_create() is failed");
return;
}
- ret = app_control_add_extra_data(svc_h, "type", "msg_id");
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_add_extra_data() is failed : %d", ret);
- app_control_destroy(svc_h);
+ ret = bundle_add_str(b, "type", "msg_id");
+ if (ret != 0) {
+ MSG_DEBUG("bundle_add_str() is failed : %d", ret);
+ bundle_free(b);
return;
}
@@ -74,21 +63,19 @@ void MsgLaunchClass0(msg_message_id_t msgId)
memset(&tmpStrMsgId, 0x00, sizeof(tmpStrMsgId));
snprintf(tmpStrMsgId, sizeof(tmpStrMsgId), "%d", msgId);
MSG_DEBUG("tmpStrMsgId [%s]", tmpStrMsgId);
- ret = app_control_add_extra_data(svc_h, "msgId", tmpStrMsgId);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_add_extra_data() is failed : %d", ret);
- app_control_destroy(svc_h);
+ ret = bundle_add_str(b, "msgId", tmpStrMsgId);
+ if (ret != 0) {
+ MSG_DEBUG("bundle_add_str() is failed : %d", ret);
+ bundle_free(b);
return;
}
- ret = app_control_send_launch_request(svc_h, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_send_launch_request() is failed : %d", ret);
- app_control_destroy(svc_h);
- return;
+ err = msg_launch_app("org.tizen.msg-ui-class0", b);
+ if (err != MSG_SUCCESS) {
+ MSG_DEBUG("msg_launch_app() is failed : %d", err);
}
- app_control_destroy(svc_h);
+ bundle_free(b);
#endif // MSG_WEARABLE_PROFILE
MSG_END();
}
@@ -411,91 +398,76 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO
MSG_INFO("MsgSettingGetInt() is failed");
}
MSG_PUSH_SERVICE_TYPE_T serviceType = (MSG_PUSH_SERVICE_TYPE_T)tmpVal;
- app_control_h svc_handle = NULL;
-
switch (pMsgInfo->msgType.subType) {
case MSG_WAP_SL_SMS: {
*pSendNoti = true;
if (serviceType == MSG_PUSH_SERVICE_ALWAYS) {
- if (app_control_create(&svc_handle) < 0) {
- MSG_DEBUG("Fail to create service handle");
- break;
- }
- if (!svc_handle) {
- MSG_DEBUG("Service handle is NULL");
+ bundle *b = NULL;
+ b = bundle_create();
+ if (b == NULL) {
+ MSG_DEBUG("bundle_create() is failed");
break;
}
- if (app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_VIEW) < 0) {
- MSG_DEBUG("Fail to create service handle");
- app_control_destroy(svc_handle);
- break;
- }
- if (app_control_set_uri(svc_handle, pMsgInfo->msgText) < 0) {
- MSG_DEBUG("Fail to set uri");
- app_control_destroy(svc_handle);
- break;
- }
- if (app_control_set_app_id(svc_handle, MSG_SVC_PKG_NAME_BROWSER) < 0) {
- MSG_DEBUG("Fail to set package");
- app_control_destroy(svc_handle);
+
+ err = msg_aul_svc_set_operation(b, "http://tizen.org/appcontrol/operation/view");
+ if (err != MSG_SUCCESS) {
+ MSG_DEBUG("msg_aul_svc_set_operation() is failed : %d", err);
+ bundle_free(b);
break;
}
- if (app_control_send_launch_request(svc_handle, NULL, NULL) < 0) {
- MSG_DEBUG("Fail to launch browser");
- app_control_destroy(svc_handle);
+
+ err = msg_aul_svc_set_uri(b, pMsgInfo->msgText);
+ if (err != MSG_SUCCESS) {
+ MSG_DEBUG("msg_aul_svc_set_uri() is failed : %d", err);
+ bundle_free(b);
break;
}
- app_control_destroy(svc_handle);
+ err = msg_launch_app(MSG_SVC_PKG_NAME_BROWSER, b);
+ if (err != MSG_SUCCESS) {
+ MSG_DEBUG("msg_launch_app() is failed : %d", err);
+ }
+ bundle_free(b);
} else if (serviceType == MSG_PUSH_SERVICE_PROMPT) {
MSG_DEBUG("WAP Message SL(Always Ask) start.");
- app_control_h svc_h;
- int ret = APP_CONTROL_ERROR_NONE;
-
- ret = app_control_create(&svc_h);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_create() is failed : %d", ret);
- break;
- }
-
- ret = app_control_set_app_id(svc_h, "org.tizen.message-dialog");
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_set_app_id() is failed : %d", ret);
- app_control_destroy(svc_h);
+ int ret = 0;
+ bundle *b = NULL;
+ b = bundle_create();
+ if (b == NULL) {
+ MSG_DEBUG("bundle_create() is failed");
break;
}
- ret = app_control_add_extra_data(svc_h, "mode", "WAP_PUSH_SL");
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_add_extra_data() is failed : %d", ret);
- app_control_destroy(svc_h);
+ ret = bundle_add_str(b, "mode", "WAP_PUSH_SL");
+ if (ret != 0) {
+ MSG_DEBUG("bundle_add_str() is failed : %d", ret);
+ bundle_free(b);
break;
}
- ret = app_control_add_extra_data(svc_h, "url", pMsgInfo->msgText);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_add_extra_data() is failed : %d", ret);
- app_control_destroy(svc_h);
+ ret = bundle_add_str(b, "url", pMsgInfo->msgText);
+ if (ret != 0) {
+ MSG_DEBUG("bundle_add_str() is failed : %d", ret);
+ bundle_free(b);
break;
}
- ret = app_control_add_extra_data(svc_h, "address", pMsgInfo->addressList[0].addressVal);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_add_extra_data() is failed : %d", ret);
- app_control_destroy(svc_h);
+ ret = bundle_add_str(b, "address", pMsgInfo->addressList[0].addressVal);
+ if (ret != 0) {
+ MSG_DEBUG("bundle_add_str() is failed : %d", ret);
+ bundle_free(b);
break;
}
- ret = app_control_send_launch_request(svc_h, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- MSG_DEBUG("app_control_send_launch_request() is failed : %d", ret);
+ err = msg_launch_app("org.tizen.message-dialog", b);
+ if (err != MSG_SUCCESS) {
+ MSG_DEBUG("msg_launch_app() is failed : %d", err);
}
- app_control_destroy(svc_h);
- MSG_DEBUG("app_control_destroy() returns : %d", ret);
+ bundle_free(b);
}
}
break;
diff --git a/include/utils/MsgUtilFile.h b/include/utils/MsgUtilFile.h
index 88596c5..0407143 100755
--- a/include/utils/MsgUtilFile.h
+++ b/include/utils/MsgUtilFile.h
@@ -63,7 +63,6 @@ char *MsgGetDirName(char *file_path);
char *MsgGetFileName(char *file_path);
int MsgCheckFilepathSmack(const char *app_smack_label, char *file_path);
-bool MsgScanFile(char *filePath);
void MsgGetMimeType(char *filePath, char *mimeType, int size);
int MsgTcsScanFile(const char *filepath, int *bLevel);
bool MsgAclInit();
diff --git a/include/utils/MsgUtilFunction.h b/include/utils/MsgUtilFunction.h
index 8472c2a..1442320 100755
--- a/include/utils/MsgUtilFunction.h
+++ b/include/utils/MsgUtilFunction.h
@@ -158,6 +158,10 @@ uid_t msg_get_login_user();
msg_error_t msg_launch_app(const char *app_id, bundle *bundle_data);
+msg_error_t msg_aul_svc_set_operation(bundle *bundle_data, const char *operation);
+
+msg_error_t msg_aul_svc_set_uri(bundle *bundle_data, char *uri);
+
/* Dbus function */
void MsgDbusInit();
void MsgDbusDeinit();
diff --git a/packaging/msg-service.spec b/packaging/msg-service.spec
index 63bf915..e59e437 100755
--- a/packaging/msg-service.spec
+++ b/packaging/msg-service.spec
@@ -26,7 +26,6 @@ BuildRequires: pkgconfig(badge)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-appfw-package-manager)
-BuildRequires: pkgconfig(capi-content-media-content)
BuildRequires: pkgconfig(capi-media-image-util)
BuildRequires: pkgconfig(capi-media-metadata-extractor)
BuildRequires: pkgconfig(capi-media-player)
@@ -35,7 +34,6 @@ BuildRequires: pkgconfig(capi-media-thumbnail-util)
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(capi-system-device)
BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(capi-telephony)
BuildRequires: pkgconfig(csr-framework)
BuildRequires: pkgconfig(cynara-client)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 8af74a5..6379beb 100755
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -46,7 +46,7 @@ INCLUDE_DIRECTORIES(
INCLUDE(FindPkgConfig)
-SET(PKG_MODULES glib-2.0 vconf dlog libxml-2.0 storage json-glib-1.0 capi-system-info capi-media-thumbnail-util capi-media-image-util capi-content-media-content aul sqlite3 capi-media-metadata-extractor icu-uc libsystemd-login csr-framework)
+SET(PKG_MODULES glib-2.0 vconf dlog libxml-2.0 storage json-glib-1.0 capi-system-info capi-media-thumbnail-util capi-media-image-util aul sqlite3 capi-media-metadata-extractor icu-uc libsystemd-login csr-framework)
pkg_check_modules(utils_pkgs REQUIRED ${PKG_MODULES})
FOREACH(flag ${utils_pkgs_CFLAGS})
diff --git a/utils/MsgUtilFile.cpp b/utils/MsgUtilFile.cpp
index 36894a7..71fc128 100755
--- a/utils/MsgUtilFile.cpp
+++ b/utils/MsgUtilFile.cpp
@@ -28,7 +28,6 @@
#include <libgen.h>
#include <acl/libacl.h>
-#include <media_content.h>
#include <thumbnail_util.h>
#include <image_util.h>
#include <TCSImpl.h>
@@ -1228,37 +1227,6 @@ __RETURN:
}
-bool MsgScanFile(char *filePath)
-{
- if (filePath == NULL) {
- MSG_DEBUG("Invalid Parameter src = %p", filePath);
- return false;
- }
-
- msg_error_t ret = media_content_connect();
-
- if (ret == MEDIA_CONTENT_ERROR_NONE) {
- if (media_content_scan_file(filePath) != MEDIA_CONTENT_ERROR_NONE) {
- MSG_ERR("media_content_scan_file() is failed , %d", ret);
- media_content_disconnect();
- return false;
- }
-
- ret = media_content_disconnect();
-
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- MSG_ERR("media_content_disconnect is failed , %d", ret);
- return false;
- }
- } else {
- MSG_ERR("media_content_connect is failed , %d", ret);
- return false;
- }
-
- return true;
-}
-
-
void MsgGetMimeType(char *filePath, char *mimeType, int size)
{
aul_get_mime_from_file(filePath, mimeType, size);
diff --git a/utils/MsgUtilFunction.cpp b/utils/MsgUtilFunction.cpp
index 050c4a2..a2946b5 100755
--- a/utils/MsgUtilFunction.cpp
+++ b/utils/MsgUtilFunction.cpp
@@ -29,6 +29,7 @@
#include <vconf.h>
#include <ctype.h>
#include <aul.h>
+#include <aul_svc.h>
#define DEFAULT_MIN_MATCH_DIGIT 8
@@ -1250,6 +1251,30 @@ msg_error_t msg_launch_app(const char *app_id, bundle *bundle_data)
}
+msg_error_t msg_aul_svc_set_operation(bundle *bundle_data, const char *operation)
+{
+ int ret = aul_svc_set_operation(bundle_data, operation);
+ if (ret < 0) {
+ MSG_DEBUG("aul_svc_set_operation() is failed : %d", ret);
+ return MSG_ERR_UNKNOWN;
+ }
+
+ return MSG_SUCCESS;
+}
+
+
+msg_error_t msg_aul_svc_set_uri(bundle *bundle_data, char *uri)
+{
+ int ret = aul_svc_set_uri(bundle_data, uri);
+ if (ret < 0) {
+ MSG_DEBUG("aul_svc_set_uri() is failed : %d", ret);
+ return MSG_ERR_UNKNOWN;
+ }
+
+ return MSG_SUCCESS;
+}
+
+
void MsgDbusInit()
{
MSG_DEBUG();