From 987b12d41a1e26b7bf177f4853a8b002918891af Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Fri, 23 Aug 2013 16:29:29 +0900 Subject: [PATCH] minor appid refactoring Change-Id: I1b81ca955c28d1c831a505d838c5c722d91af9b2 Signed-off-by: Young Ik Cho --- src/app/FApp_AppControlManager.cpp | 19 ++++++------------- src/app/FApp_AppImpl.cpp | 10 ++++------ src/app/FApp_NotificationManagerImpl.cpp | 11 +++-------- src/app/FApp_RequestManagerT.cpp | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/app/FApp_AppControlManager.cpp b/src/app/FApp_AppControlManager.cpp index cd7d7eb..bc39ebd 100644 --- a/src/app/FApp_AppControlManager.cpp +++ b/src/app/FApp_AppControlManager.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -75,22 +76,14 @@ using namespace Tizen::Base::Runtime; using namespace Tizen::Base::Utility; using namespace Tizen::Io; -namespace Tizen { namespace App -{ - -const wchar_t TIZEN_OPERATION_PICK[] = L"http://tizen.org/appcontrol/operation/pick"; -const wchar_t SELECTOR_NOTI_KEY[] = L"__APP_SVC_CALLER_NOTI__"; -const int _MAX_PACKAGE_ID_LENGTH = 10; - -_InProcessInfo::~_InProcessInfo(void) +namespace { - delete pLib; +const char SELECTOR_NOTI_KEY[] = "__APP_SVC_CALLER_NOTI__"; } -_LaunchInfo::~_LaunchInfo(void) +namespace Tizen { namespace App { - delete pArg; -} +const wchar_t TIZEN_OPERATION_PICK[] = L"http://tizen.org/appcontrol/operation/pick"; _AppControlManager::_AppControlManager(void) @@ -841,7 +834,7 @@ _AppControlManager::LaunchAppImplicit(_AppArg* pArg, int req) if (req >= 0) { pArg->UpdateRequestId(req); - _AppMessageImpl::AddData(kb, SELECTOR_NOTI_KEY, _AppInfo::GetApplicationId()); + appsvc_add_data(kb, SELECTOR_NOTI_KEY, appinfo_get_appid()); } if (_AppImpl::GetInstance() != null) diff --git a/src/app/FApp_AppImpl.cpp b/src/app/FApp_AppImpl.cpp index 3f4386c..bfa3875 100644 --- a/src/app/FApp_AppImpl.cpp +++ b/src/app/FApp_AppImpl.cpp @@ -195,9 +195,7 @@ _AppImpl::Execute(_IAppImpl* pIAppImpl) } // clear outstanding ongoing notification - const AppId& appId = _AppInfo::GetApplicationId(); - std::unique_ptr pAppId(_StringConverter::CopyToCharArrayN(appId)); - notification_delete_all_by_type(pAppId.get(), NOTIFICATION_TYPE_ONGOING); + notification_delete_all_by_type(appinfo_get_appid(), NOTIFICATION_TYPE_ONGOING); return r; } @@ -688,7 +686,7 @@ _AppImpl::OnAppControlRequestReceived(const _AppArg& arg, RequestId reqId) return; } - const String& appId = _AppInfo::GetApplicationId(); + const char* pAppId = appinfo_get_appid(); const char* p = appsvc_get_operation(arg.GetBundle()); String operationId = (p) ? String(p) : TIZEN_OPERATION_MAIN; @@ -697,7 +695,7 @@ _AppImpl::OnAppControlRequestReceived(const _AppArg& arg, RequestId reqId) operationId = TIZEN_OPERATION_MAIN; } - SysLog(NID_APP, "AppControl (%ls, %ls).", appId.GetPointer(), operationId.GetPointer()); + SysLog(NID_APP, "AppControl (%s, %ls).", pAppId, operationId.GetPointer()); String uri; String mime; @@ -728,7 +726,7 @@ _AppImpl::OnAppControlRequestReceived(const _AppArg& arg, RequestId reqId) pAppControlProviderEventListener->OnAppControlRequestReceived(reqId, operationId, pUri, pMime, pMap.get()); - SysLog(NID_APP, "AppControl (%ls, %ls) invocation finished.", appId.GetPointer(), operationId.GetPointer()); + SysLog(NID_APP, "AppControl (%s, %ls) invocation finished.", pAppId, operationId.GetPointer()); } diff --git a/src/app/FApp_NotificationManagerImpl.cpp b/src/app/FApp_NotificationManagerImpl.cpp index c88337a..7b8233c 100644 --- a/src/app/FApp_NotificationManagerImpl.cpp +++ b/src/app/FApp_NotificationManagerImpl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -138,11 +139,7 @@ _NotificationManagerImpl::GetBadgeNumber(void) const { unsigned int count = 0; - const AppId appId = _AppInfo::GetApplicationId(); - - std::unique_ptr pAppId(_StringConverter::CopyToCharArrayN(appId)); - - badge_error_e badgeError = badge_get_count(pAppId.get(), &count); + badge_error_e badgeError = badge_get_count(appinfo_get_appid(), &count); if (badgeError == BADGE_ERROR_NONE) { @@ -233,9 +230,7 @@ _NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber, if (badgeNumber >= 0) { - const AppId appId = _AppInfo::GetApplicationId(); - std::unique_ptr pAppId(_StringConverter::CopyToCharArrayN(appId)); - badge_error_e badgeError = badge_set_count(pAppId.get(), badgeNumber); + badge_error_e badgeError = badge_set_count(appinfo_get_appid(), badgeNumber); SysTryLog(NID_APP, badgeError == BADGE_ERROR_NONE, "badge_set_count failed(%d).", badgeError); } diff --git a/src/app/FApp_RequestManagerT.cpp b/src/app/FApp_RequestManagerT.cpp index 8826226..8d1ea46 100644 --- a/src/app/FApp_RequestManagerT.cpp +++ b/src/app/FApp_RequestManagerT.cpp @@ -21,10 +21,14 @@ #include +#include + #include "FApp_RequestManagerT.h" #include "FApp_LaunchInfo.h" #include "FApp_AppArg.h" +using namespace Tizen::Base::Runtime; + namespace Tizen { namespace App { @@ -35,6 +39,16 @@ _ResultInfo::~_ResultInfo(void) delete pArg; } +_InProcessInfo::~_InProcessInfo(void) +{ + delete pLib; +} + +_LaunchInfo::~_LaunchInfo(void) +{ + delete pArg; +} + template _RequestManagerT::_RequestManagerT(void) -- 2.7.4