From: jungmin76.park Date: Wed, 13 Nov 2013 04:45:15 +0000 (+0900) Subject: Merge branch 'tizen_2.2' into tizen X-Git-Tag: accepted/tizen/20131113.172018^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F12249%2F2;p=platform%2Fframework%2Fnative%2Fshell.git Merge branch 'tizen_2.2' into tizen - clean up code - Fixed the uts-app failed testcases Change-Id: I4bf7195ece9efd8e8d3f718aab46ca51374f4231 Signed-off-by: jungmin76.park --- diff --git a/packaging/osp-shell.spec b/packaging/osp-shell.spec index dfe8b37..5e5fa41 100644 --- a/packaging/osp-shell.spec +++ b/packaging/osp-shell.spec @@ -66,7 +66,7 @@ Requires: pkgconfig(osp-image) The Shell library of OSP (DEV) %package internal-devel -Summary: osp shell internel (Internal) +Summary: osp shell internal (Internal) Group: System/Libraries Requires: %{name} = %{version}-%{release} Requires: %{name}-devel diff --git a/src/FShellAppWidgetProviderManager.cpp b/src/FShellAppWidgetProviderManager.cpp index 9271d06..7dc6689 100644 --- a/src/FShellAppWidgetProviderManager.cpp +++ b/src/FShellAppWidgetProviderManager.cpp @@ -127,7 +127,7 @@ AppWidgetProviderManager::SetAppWidgetPopupProviderFactory(IAppWidgetPopupProvid result AppWidgetProviderManager::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument) { - SysLog(NID_SHELL, "Enter."); + SysLog(NID_SHELL, "Invoked"); return __pAppWidgetProviderManagerImpl->RequestUpdate(appId, providerName, argument); } diff --git a/src/FShell_AppWidgetManagerImpl.cpp b/src/FShell_AppWidgetManagerImpl.cpp index 68d7ea4..24c15b7 100644 --- a/src/FShell_AppWidgetManagerImpl.cpp +++ b/src/FShell_AppWidgetManagerImpl.cpp @@ -45,7 +45,6 @@ #include #include -#include #include #include "FShell_ShortcutManagerImpl.h" @@ -175,7 +174,7 @@ _AppWidgetManagerImpl::IsAppWidgetProviderDefault(const Tizen::App::AppId& appId // c - style callback for shortcut_set_request_cb int AppWidgetRequestHandlerCallback(const char* providerId, const char* text, int type, const char* content_info, const char* icon, int pid, double period, int allowDuplication, void *data) { - SysLog(NID_SHELL, "Enter"); + SysLog(NID_SHELL, "Called"); SysTryReturn(NID_SHELL, providerId, 0, E_SYSTEM, "[E_SYSTEM] providerId is null!"); _AppWidgetManagerImpl* pAppWidgetManager = static_cast<_AppWidgetManagerImpl*>(data); diff --git a/src/FShell_AppWidgetManagerProxy.cpp b/src/FShell_AppWidgetManagerProxy.cpp index 7767a70..dc27c6f 100644 --- a/src/FShell_AppWidgetManagerProxy.cpp +++ b/src/FShell_AppWidgetManagerProxy.cpp @@ -224,49 +224,36 @@ _AppWidgetManagerProxy::SyncRemoteBufferForPD(const Tizen::Base::String& instanc result _AppWidgetManagerProxy::ReleaseRemoteBuffer(const Tizen::Base::String& instanceId) { - SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null."); - SysLog(NID_SHELL, ""); - - result ret = E_FAILURE; - std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBuffer(instanceId, &ret)); - result r = __pIpcClient->SendRequest(*pMsg.get()); - SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed."); +// SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null."); +// SysLog(NID_SHELL, ""); +// +// result ret = E_FAILURE; +// std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBuffer(instanceId, &ret)); +// result r = __pIpcClient->SendRequest(*pMsg.get()); +// SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed."); return E_SUCCESS; } result _AppWidgetManagerProxy::ReleaseRemoteBufferForPD(const Tizen::Base::String& instanceId) { - SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null."); - SysLog(NID_SHELL, ""); - - result ret = E_FAILURE; - std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBufferForPD(instanceId, &ret)); - result r = __pIpcClient->SendRequest(*pMsg.get()); - SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed."); - return E_SUCCESS; -} - -result -_AppWidgetManagerProxy::RequestProviderCount(const Tizen::Base::String& instanceId, int &count) -{ - SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null."); - SysLog(NID_SHELL, ""); - - std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_RequestProviderCount(instanceId, &count)); - result r = __pIpcClient->SendRequest(*pMsg.get()); - SysTryReturnResult(NID_SHELL, !IsFailed(r), r, "SendRequest failed."); - +// SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null."); +// SysLog(NID_SHELL, ""); +// +// result ret = E_FAILURE; +// std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_ReleaseRemoteBufferForPD(instanceId, &ret)); +// result r = __pIpcClient->SendRequest(*pMsg.get()); +// SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "SendRequest failed."); return E_SUCCESS; } result -_AppWidgetManagerProxy::SendResult(const Tizen::Base::String& instanceId, bool isSucceeded) +_AppWidgetManagerProxy::SendResponse(const Tizen::Base::String& instanceId, bool isSucceeded) { SysTryReturnResult(NID_SHELL, __pIpcClient != null, E_SYSTEM, "__pIpcClient instance must not be null."); SysLog(NID_SHELL, ""); - std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_SendResult(instanceId, isSucceeded)); + std::auto_ptr pMsg (new (std::nothrow) AppWidgetManager_SendResponse(instanceId, isSucceeded)); result r = __pIpcClient->SendRequest(*pMsg.get()); SysTryReturnResult(NID_SHELL, !IsFailed(r), r, "SendRequest failed."); @@ -296,7 +283,6 @@ void _AppWidgetManagerProxy::OnIpcResponseReceived(_IpcClient& client, const IPC::Message& message) { SysLog(NID_SHELL, "Enter."); -// SysAssertf(__pAppWidgetServiceRequestListener, "__pAppWidgetServiceRequestListener should not be null!" IPC_BEGIN_MESSAGE_MAP(_AppWidgetManagerProxy, message) IPC_MESSAGE_HANDLER_EX(AppWidgetManager_SendAppWidgetEvent, &client, OnAppWidgetServiceRequestReceived) diff --git a/src/FShell_AppWidgetProviderManagerImpl.cpp b/src/FShell_AppWidgetProviderManagerImpl.cpp index 6741e97..37a29cf 100644 --- a/src/FShell_AppWidgetProviderManagerImpl.cpp +++ b/src/FShell_AppWidgetProviderManagerImpl.cpp @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include #include "FShell_AppWidgetManagerProxy.h" @@ -126,7 +126,7 @@ _AppWidgetProviderManagerImpl::SetAppWidgetProviderFactory(IAppWidgetProviderFac { SysLogException(NID_SHELL, E_INVALID_OPERATION, "The application's attribute does not meet the condition to provide AppWidget. 'LifeDuration' and 'UseUi' attribute should be specified in application manifest and it's not allowed that declaring 'AUTO_RESTART' attribute for AppWidget."); - r = SendResult(INVALID_INSTANCE, false); + r = SendResponse(INVALID_INSTANCE, false); SysTryLog(NID_SHELL, !IsFailed(r), "Because the context for this dynamic box is removed, POLLRDHUP occurs."); return E_INVALID_OPERATION; @@ -143,7 +143,7 @@ _AppWidgetProviderManagerImpl::SetAppWidgetPopupProviderFactory(IAppWidgetPopupP { SysLogException(NID_SHELL, E_INVALID_OPERATION, "The application's attribute does not meet the condition to provide AppWidget. 'LifeDuration' and 'UseUi' attribute should be specified in application manifest and it's not allowed that declaring 'AUTO_RESTART' attribute for AppWidget."); - r = SendResult(INVALID_INSTANCE, false); + r = SendResponse(INVALID_INSTANCE, false); SysTryLog(NID_SHELL, !IsFailed(r), "Because the context for this dynamic box is removed, POLLRDHUP occurs."); return E_INVALID_OPERATION; @@ -170,7 +170,6 @@ _AppWidgetProviderManagerImpl::SetAppWidgetPopupEventListener(_IAppWidgetTouchEv result _AppWidgetProviderManagerImpl::RequestUpdate(const AppId& appId, const String& providerName, const String& argument) { - SysLog(NID_SHELL, "Enter."); SysTryReturnResult(NID_SHELL, _Aul::IsInstalled(appId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", appId.GetPointer()); result r = _PackageManagerUtil::CompareCertification(Tizen::App::App::GetInstance()->GetAppId(), appId); @@ -226,7 +225,7 @@ _AppWidgetProviderManagerImpl::RequestUpdateInstance(const String& instanceId, c { SysLog(NID_SHELL, "Failed to update."); - result r = SendResult(instanceId, false); + result r = SendResponse(instanceId, false); SysTryLog(NID_SHELL, !IsFailed(r), "Failed to send the result."); return E_SYSTEM; @@ -324,11 +323,11 @@ _AppWidgetProviderManagerImpl::UpdateAppWidget(const String& instanceId, float w { SysSecureLog(NID_SHELL, "instanceId(%ls), w:%f, h:%f, argument:%ls", instanceId.GetPointer(), width, height, argument.GetPointer()); - AppWidgetProvider* pAppWidget = null; - __appwidgetProviders.GetValue(instanceId, pAppWidget); - SysTryReturnResult(NID_SHELL, pAppWidget, E_SYSTEM, "Can't find the AppWidget provider"); + AppWidgetProvider* pAppWidgetProvider = null; + __appwidgetProviders.GetValue(instanceId, pAppWidgetProvider); + SysTryReturnResult(NID_SHELL, pAppWidgetProvider, E_SYSTEM, "Can't find the AppWidget provider"); - bool ret = pAppWidget->OnAppWidgetProviderUpdating(argument); + bool ret = pAppWidgetProvider->OnAppWidgetProviderUpdating(argument); SysTryReturnResult(NID_SHELL, ret == true, E_OPERATION_CANCELED, "OnAppWidgetProviderUpdating returns 'false'. The provider will be removed."); return E_SUCCESS; diff --git a/src/FShell_AppWidgetServiceRequestDispatcher.cpp b/src/FShell_AppWidgetServiceRequestDispatcher.cpp index 86a856e..23927e4 100644 --- a/src/FShell_AppWidgetServiceRequestDispatcher.cpp +++ b/src/FShell_AppWidgetServiceRequestDispatcher.cpp @@ -146,23 +146,21 @@ _AppWidgetServiceRequestDispatcher::HandleRequest(const String& instanceId, cons } CATCH: + bool isSuccessed = true; + if (r == E_OPERATION_CANCELED) { - SysLog(NID_SHELL, "[E_OPERATION_CANCELED] user code returned 'false' in virtual method for this operation."); - SendResult(instanceId, false); + SysLog(NID_SHELL, "[E_OPERATION_CANCELED] user code returned 'false' in virtual method for the operation(%ls).", operationId.GetPointer()); + + isSuccessed = false; if (operationId == APPWIDGET_ON_UPDATE) { - SysTryLog(NID_SHELL, !IsFailed(r), "Failed to get the count of a provider."); RemoveAppWidget(instanceId); } - - return r; - } - else - { - SendResult(instanceId, true); } + + SendResponse(instanceId, isSuccessed); #endif// HANDLE_MESSAGE_BY_EVENT SysLog(NID_SHELL, "Exit"); @@ -352,23 +350,14 @@ _AppWidgetServiceRequestDispatcher::OnDestroyAppWidgetPopup(const Tizen::Base::S } result -_AppWidgetServiceRequestDispatcher::RequestProviderCount(const String& instanceId, int& providerCount) -{ - _AppWidgetManagerProxy* pProxy = _AppWidgetManagerProxy::GetInstance(); - SysTryReturnResult(NID_SHELL, pProxy, E_SYSTEM, "Failed to get proxy instance!"); - - return pProxy->RequestProviderCount(instanceId, providerCount); -} - -result -_AppWidgetServiceRequestDispatcher::SendResult(const String& instanceId, bool isSucceeded) +_AppWidgetServiceRequestDispatcher::SendResponse(const String& instanceId, bool isSucceeded) { SysLog(NID_SHELL, "%s", isSucceeded ? "true":"false"); _AppWidgetManagerProxy* pProxy = _AppWidgetManagerProxy::GetInstance(); SysTryReturnResult(NID_SHELL, pProxy, E_SYSTEM, "Failed to get proxy instance!"); - return pProxy->SendResult(instanceId, isSucceeded); + return pProxy->SendResponse(instanceId, isSucceeded); } @@ -406,21 +395,18 @@ _AppWidgetServiceRequestDispatcher::OnAppWidgetManagerEventRecieved(const String SysLog(NID_SHELL, "E_OPERATION_CANCELED"); if (operationId == APPWIDGET_ON_UPDATE) { - int count = 0; - result r = RequestProviderCount(*pInstanceId, count); - SysTryLog(NID_SHELL, !IsFailed(r), "Failed to get the count of a provider."); RemoveAppWidget(*pInstanceId); } else { - SendResult(*pInstanceId, false); + SendResponse(*pInstanceId, false); } } else { - SendResult(*pInstanceId, true); + SendResponse(*pInstanceId, true); } -// SendResult(*pInstanceId, (r == E_SUCCESS) ? true:false); +// SendResponse(*pInstanceId, (r == E_SUCCESS) ? true:false); } } diff --git a/src/core/FShell_NotificationManagerImpl.cpp b/src/core/FShell_NotificationManagerImpl.cpp index 3b195b8..ab641e8 100644 --- a/src/core/FShell_NotificationManagerImpl.cpp +++ b/src/core/FShell_NotificationManagerImpl.cpp @@ -356,8 +356,6 @@ _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messag { SysTryReturnResult(NID_SHELL, badgeNumber <= MAX_NOTIFICATION_BADGE_NUMBER, E_INVALID_ARG, "badgeNumber is greater than MAX_NOTIFICATION_BADGE_NUMBER."); - SysTryReturnResult(NID_SHELL, launchArguments.GetLength() > 0 && launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG, - "launchArguments is less than 1 or greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH."); NotificationRequest request; request.SetAlertText(messageText); @@ -370,10 +368,6 @@ _NotificationManagerImpl::NotifyByAppId(const AppId& appId, const String& messag result _NotificationManagerImpl::NotifyOngoingActivityByAppId(const AppId& appId, const String& messageText, const String& launchArguments) { - SysTryReturnResult(NID_SHELL, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0."); - SysTryReturnResult(NID_SHELL, launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG, - "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH."); - NotificationRequest request; request.SetAlertText(messageText); request.SetAppMessage(launchArguments); @@ -1052,12 +1046,12 @@ _NotificationManagerImpl::RemoveNotification(bool onGoing) { err = notification_delete(notiHandle); SysLog(NID_SHELL, "Notification deleted."); + err = notification_free(notiHandle); } else { SysLog(NID_SHELL, "Notification already deleted."); } - err = notification_free(notiHandle); } else { @@ -1090,12 +1084,12 @@ _NotificationManagerImpl::RemoveNotificationByAppId(const Tizen::App::AppId& app { err = notification_delete(notiHandle); SysLog(NID_SHELL, "Notification deleted."); + err = notification_free(notiHandle); } else { SysLog(NID_SHELL, "Notification already deleted."); } - err = notification_free(notiHandle); } else { diff --git a/src/inc/FShell_AppWidgetManagerIpcMessage.h b/src/inc/FShell_AppWidgetManagerIpcMessage.h index 021e2bd..de8e962 100644 --- a/src/inc/FShell_AppWidgetManagerIpcMessage.h +++ b/src/inc/FShell_AppWidgetManagerIpcMessage.h @@ -39,8 +39,7 @@ IPC_SYNC_MESSAGE_CONTROL3_1(AppWidgetManager_SyncRemoteBuffer, Tizen::Base::Stri IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_SyncRemoteBufferForPD, Tizen::Base::String, result) IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_ReleaseRemoteBuffer, Tizen::Base::String, result) IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_ReleaseRemoteBufferForPD, Tizen::Base::String, result) -IPC_SYNC_MESSAGE_CONTROL1_1(AppWidgetManager_RequestProviderCount, Tizen::Base::String, int) -IPC_MESSAGE_CONTROL2(AppWidgetManager_SendResult, Tizen::Base::String, bool) +IPC_MESSAGE_CONTROL2(AppWidgetManager_SendResponse, Tizen::Base::String, bool) IPC_MESSAGE_CONTROL2(AppWidgetManager_SendAccessStatus, Tizen::Base::String, int) // Message from service diff --git a/src/inc/FShell_AppWidgetManagerProxy.h b/src/inc/FShell_AppWidgetManagerProxy.h index 024c22c..11b793c 100644 --- a/src/inc/FShell_AppWidgetManagerProxy.h +++ b/src/inc/FShell_AppWidgetManagerProxy.h @@ -73,8 +73,7 @@ public: result SendAccessStatus(const Tizen::Base::String& instanceId, int accessStatus); // response - result SendResult(const Tizen::Base::String& instanceId, bool isSucceeded); - result RequestProviderCount(const Tizen::Base::String& instanceId, int& providerCount); + result SendResponse(const Tizen::Base::String& instanceId, bool isSucceeded); // Received messages from server virtual result OnAppWidgetServiceRequestReceived(const Tizen::Base::String& instanceId, const Tizen::Base::String& operationId, const Tizen::Base::Collection::HashMap& args); diff --git a/src/inc/FShell_AppWidgetProviderManagerImpl.h b/src/inc/FShell_AppWidgetProviderManagerImpl.h index 10df9cc..8d69093 100644 --- a/src/inc/FShell_AppWidgetProviderManagerImpl.h +++ b/src/inc/FShell_AppWidgetProviderManagerImpl.h @@ -34,6 +34,7 @@ //#define HANDLE_MESSAGE_BY_EVENT + namespace Tizen { namespace Shell { class IAppWidgetProviderFactory; diff --git a/src/inc/FShell_AppWidgetServiceRequestDispatcher.h b/src/inc/FShell_AppWidgetServiceRequestDispatcher.h index 75e5054..2ff2c74 100644 --- a/src/inc/FShell_AppWidgetServiceRequestDispatcher.h +++ b/src/inc/FShell_AppWidgetServiceRequestDispatcher.h @@ -124,8 +124,7 @@ protected: #endif protected: - result SendResult(const Tizen::Base::String& instanceId, bool isSucceeded); - result RequestProviderCount(const Tizen::Base::String& instanceId, int& providerCount); + result SendResponse(const Tizen::Base::String& instanceId, bool isSucceeded); private: #ifdef HANDLE_MESSAGE_BY_EVENT diff --git a/src/inc/FShell_TemplateUtil.h b/src/inc/FShell_TemplateUtil.h deleted file mode 100644 index a983e42..0000000 --- a/src/inc/FShell_TemplateUtil.h +++ /dev/null @@ -1,138 +0,0 @@ -// -// Copyright (c) 2012 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. -// - -/** - * @file FShell_TemplateUtil.h - * @brief This is the header file for the internal Tizen::Shell template utilities. - */ - -#ifndef FSHELL_INTERNAL_TEMPLATE_UTIL_H_ -#define FSHELL_INTERNAL_TEMPLATE_UTIL_H_ - - -#include -#include -#include - -namespace Tizen { namespace Shell -{ - -template void -_DeleteCollection(Tizen::Base::Collection::ICollectionT& col) -{ - Tizen::Base::Collection::IEnumeratorT* pEnum = col.GetEnumeratorN(); - - if (pEnum) - { - while (pEnum->MoveNext() == E_SUCCESS) - { - Type* pElem = null; - pEnum->GetCurrent(pElem); - - delete pElem; - } - - delete pEnum; - } -} - -template void -_DeleteCollectionMapValue(Tizen::Base::Collection::IMapT& col) -{ - Tizen::Base::Collection::IMapEnumeratorT* pEnum = col.GetMapEnumeratorN(); - - if (pEnum) - { - while (pEnum->MoveNext() == E_SUCCESS) - { - ValueType* pValue = null; - pEnum->GetValue(pValue); - - delete pValue; - } - - delete pEnum; - } -} - -template void -_DeleteCollectionMapValue(Tizen::Base::Collection::IMultiMapT& col) -{ - Tizen::Base::Collection::IMapEnumeratorT* pEnum = col.GetMapEnumeratorN(); - - if (pEnum) - { - while (pEnum->MoveNext() == E_SUCCESS) - { - ValueType* pValue = null; - pEnum->GetValue(pValue); - - delete pValue; - } - - delete pEnum; - } -} - -}} // Tizen::Shell - - -namespace Tizen { namespace Base -{ - -namespace Collection -{ - -template <> -class __HashMapDefaultProviderT -: public IHashCodeProviderT -, public Object -{ - public: - __HashMapDefaultProviderT(void) {} - - virtual ~__HashMapDefaultProviderT(void) {} - - virtual int GetHashCode(const String& obj) const - { - return obj.GetHashCode(); - } -}; - -template<> -class __MultiHashMapDefaultProviderT -: public IHashCodeProviderT -, public Object -{ - public: - __MultiHashMapDefaultProviderT(void) {} - - virtual ~__MultiHashMapDefaultProviderT(void) {} - - virtual int GetHashCode(const String& obj) const - { - return obj.GetHashCode(); - } -}; - - -} // Collection - -}} // Tizen::Base - - - -#endif // FSHELL_INTERNAL_TEMPLATE_UTIL_H_