#include <FAppTypes.h>
#include <FBaseColArrayListT.h>
+#include <FBaseColHashMap.h>
+#include <FBaseColHashMapT.h>
namespace Tizen { namespace Base { namespace Collection
{
-class HashMap;
class IList;
}}}
struct PendingEvent
{
PendingEvent(const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pHashMap)
- : operation(operation), pArg(pHashMap) { }
+ : operation(operation), pArgs(pHashMap) { }
+
+ ~PendingEvent(void)
+ {
+ if (pArgs)
+ {
+ pArgs->RemoveAll(true);
+ delete pArgs;
+ }
+ }
Tizen::Base::String operation;
- Tizen::Base::Collection::HashMap* pArg;
+ Tizen::Base::Collection::HashMap* pArgs;
};
const Tizen::App::AppId __appId;
#include <unique_ptr.h>
#include <FBase.h>
#include <FBaseSysLog.h>
-#include <FBaseColHashMap.h>
-#include <FBaseColIMapEnumeratorT.h>
#include <FAppApp.h>
-#include <FBaseComparerT.h>
#include <FApp_AppManagerImpl.h>
#include "FShell_AppWidgetContext.h"
#include "FShell_AppWidgetContextHelper.h"
if (GetConnectionState() == CONNECTION_STATE_NONE || GetConnectionState() == CONNECTION_STATE_DISCONNECTED)
{
SysLog(NID_SHELL, "The application is not running.");
- result r = _AppWidgetRequestHelper::SendAppControlRequest(providerAppId, operation, pArgs);
+ r = _AppWidgetRequestHelper::SendAppControlRequest(providerAppId, operation, pArgs);
+ pArgs->RemoveAll(true);
+ delete pArgs;
+
SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "[%s] Failed to SendRequestToApp", GetErrorMessage(r));
SetWaitingStatus(true);
{
if (GetConnectionState() == CONNECTION_STATE_CONNECTING || GetWaitingStatus() == true)
{
- SysLog(NID_SHELL, "The application is running but IPC is not connected yet.");
+ SysLog(NID_SHELL, "The application is running but IPC is not connected yet. Queueing the request (%ls).", operation.GetPointer() );
__pPendingEventList->Add(new (nothrow) PendingEvent(operation, pArgs));
}
else
{
SysLog(NID_SHELL, "The application is running and IPC is connected.");
r = _AppWidgetRequestHelper::SendIpcRequest(GetClientId(), operation, pArgs);
-
pArgs->RemoveAll(true);
delete pArgs;
+ SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "[%s] Failed to SendRequestToApp", GetErrorMessage(r));
+
SetWaitingStatus(true);
}
}
_AppContext::SendPendingEvent(void)
{
SetWaitingStatus(false);
- TryReturn(__pPendingEventList->GetCount() > 0, E_DATA_NOT_FOUND, "This context has no pending event. Please find next pending event context.");
+ TryReturn(__pPendingEventList->GetCount() > 0, E_DATA_NOT_FOUND, "No pending event.");
PendingEvent* pEvent = null;
__pPendingEventList->GetAt(0, pEvent);
__pPendingEventList->RemoveAt(0);
SysLog(NID_SHELL, "(%d) Remains in __pPendingEventList.", __pPendingEventList->GetCount());
- result r = _AppWidgetRequestHelper::SendIpcRequest(GetClientId(), pEvent->operation, pEvent->pArg);
+ result r = _AppWidgetRequestHelper::SendIpcRequest(GetClientId(), pEvent->operation, pEvent->pArgs);
delete pEvent;
SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "SendIpcRequest failed.");