virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y);
result RequestUpdateRemote(int width, int height);
+ result SendPendingEvent(void);
int GetPeriod(void) const;
long long GetLastUpdatedTime(void) const;
+ virtual void SetIpcClientId(int clientId);
private:
result SendAddRequest(int width, int height);
result SendRemoveRequest(void);
result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
void SendPendingTouchEvent(void);
+ result RequestUpdate(const Tizen::Base::String& argument);
virtual Tizen::Base::Collection::HashMap* CreateRequestArgsN(void);
virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
double y;
};
+ struct PendingEvent
+ {
+ PendingEvent(const Tizen::Base::String& instanceId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pHashMap)
+ : instanceId(instanceId), operation(operation), pArg(pHashMap) { }
+
+ Tizen::Base::String instanceId;
+ Tizen::Base::String operation;
+ Tizen::Base::Collection::HashMap* pArg;
+ };
+
private:
_AppWidgetPopupContext* __pAppWidgetPopup;
Tizen::Base::Runtime::Timer __updateTimer;
int __updateMillis;
long long __lastUpdatedTime;
Tizen::Base::Collection::ArrayListT<PendingTouchEvent*>* __pPendingTouchEventList;
+ Tizen::Base::Collection::ArrayListT<PendingEvent*>* __pPendingEventList;
Tizen::Base::String __pendingArgument;
bool __hasPendingRequest;
virtual void OnPopupCreated(double x, double y, int width, int height) = 0;
virtual void OnPopupDestoyed(void) = 0;
virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y) = 0;
- void SetIpcClientId(int clientId);
+ //virtual result SendPendingEvent(void) = 0;
+ virtual void SetIpcClientId(int clientId);
int GetClientId(void) const;
bool HasValidClientId(void) const;
// for buffered appWidget
Tizen::Base::String GetAppId(void) const;
int GetPriority(void) const;
Tizen::Base::String GetProviderName(void) const;
+ bool IsRunning(void) const;
protected:
- bool IsRunning(void) const;
bool IsSharedMemCreated(void) const;
virtual Tizen::Base::Collection::HashMap* CreateRequestArgsN(void) = 0;
result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
+ result SendRequestToApp(const int clientId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
void SetForeground(bool forground);
bool IsForeground(void) const;
Tizen::Base::String GetUserInfo(void) const;
-
void SetWidth(int width);
void SetHeight(int height);
{
public:
static result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
+ static result SendRequestToApp(const int clientId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
+
}; // class _AppWidgetRequestHelper
-extern const wchar_t ARG_KEY_INSTANCE_ID[];
-extern const wchar_t ARG_KEY_PROVIDER_NAME[];
-extern const wchar_t ARG_KEY_USER_INFO[];
-extern const wchar_t ARG_KEY_X[];
-extern const wchar_t ARG_KEY_Y[];
-extern const wchar_t ARG_KEY_WIDTH[];
-extern const wchar_t ARG_KEY_HEIGHT[];
-extern const wchar_t ARG_KEY_POPUP_WIDTH[];
-extern const wchar_t ARG_KEY_POPUP_HEIGHT[];
-extern const wchar_t ARG_KEY_ARGUMENT[];
-extern const wchar_t ARG_KEY_EVENT_TYPE[];
-extern const wchar_t ARG_KEY_TIME_STAMP[];
+extern const Tizen::Base::String ARG_KEY_INSTANCE_ID;
+extern const Tizen::Base::String ARG_KEY_PROVIDER_NAME;
+extern const Tizen::Base::String ARG_KEY_USER_INFO;
+extern const Tizen::Base::String ARG_KEY_X;
+extern const Tizen::Base::String ARG_KEY_Y;
+extern const Tizen::Base::String ARG_KEY_WIDTH;
+extern const Tizen::Base::String ARG_KEY_HEIGHT;
+extern const Tizen::Base::String ARG_KEY_POPUP_WIDTH;
+extern const Tizen::Base::String ARG_KEY_POPUP_HEIGHT;
+extern const Tizen::Base::String ARG_KEY_ARGUMENT;
+extern const Tizen::Base::String ARG_KEY_EVENT_TYPE;
+extern const Tizen::Base::String ARG_KEY_TIME_STAMP;
}}} // Tizen::Shell::App
static AppWidgetManagerService* CreateInstance(const char* pServiceIdForCoreDaemon);
result AddAppWidget(_AppWidgetContext* pAppWidget);
result RemoveAppWidget(const char* pPackageName, const char* pId, bool free);
+ int Find(const Tizen::App::AppId& appId) const;
+ result RequestUpdate(_AppWidgetContext* pAppWidgetContext, const Tizen::Base::String& argument);
private:
result Construct(const char* pServiceIdForCoreDaemon);
result InitializeCoreDaemonEventReceiver(const char* pServiceIdForCoreDaemon);
result DeinitializeCoreDaemonEventReceiver(void);
- // master daemon callbacks
+ // core daemon callbacks
static int AppWidgetConnected(struct event_arg *arg, void* data);
static int AppWidgetDisconnected(struct event_arg *arg, void* data);
static int OnAppWidgetCreate(struct event_arg *arg, int *width, int *height, double *priority, void* data);
AppWidgetManagerService(void);
virtual ~AppWidgetManagerService(void);
+ // ipc
virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
void StartPingTimer(void);
virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
+
_AppWidgetContext* Find(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId) const;
- int Find(const Tizen::App::AppId& appId) const;
+ result RequestPendingEvent(void);
class _TaskHandlerThread
: public Tizen::Base::Runtime::Thread
Tizen::Base::Collection::ArrayListT<_AppWidgetContext*> __appWidgetContextList;
Tizen::Base::Runtime::Timer __pingTimer;
_TaskHandlerThread __handlerThread;
+
}; // class AppWidgetManagerService
}}} // Tizen::Shell::App
#include <FBaseRtIEventListener.h>
#include <FIo_IIpcServerEventListener.h>
+namespace Tizen { namespace Base { namespace Collection
+{
+class HashMap;
+}}}
+
namespace Tizen { namespace Shell { namespace App {
/**
{
public:
+ bool SendAppWidgetEvent(const int clientId, const Tizen::Base::String& instanceId, const Tizen::Base::String& operationId, Tizen::Base::Collection::HashMap* pArgs);
bool SendTouchEvent(const int clientId, const Tizen::Base::String& instanceId, int eventType, double timestamp, double x, double y);
bool SendTouchEventForPD(const int clientId, const Tizen::Base::String& instanceId, int eventType, double timestamp, double x, double y);
using namespace Tizen::Base::Collection;
using namespace Tizen::System;
-const wchar_t APPWIDGET_ON_ADD[] = L"http://tizen.org/appcontrol/appwidget/add";
-const wchar_t APPWIDGET_ON_REMOVE[] = L"http://tizen.org/appcontrol/appwidget/remove";
-const wchar_t APPWIDGET_ON_UPDATE[] = L"http://tizen.org/appcontrol/appwidget/update";
-const wchar_t APPWIDGET_ON_RESIZE[] = L"http://tizen.org/appcontrol/appwidget/resize";
-const wchar_t APPWIDGET_ON_TOUCH[] = L"http://tizen.org/appcontrol/appwidget/touch";
+const String APPWIDGET_ON_ADD = L"http://tizen.org/appcontrol/appwidget/add";
+const String APPWIDGET_ON_REMOVE = L"http://tizen.org/appcontrol/appwidget/remove";
+const String APPWIDGET_ON_UPDATE = L"http://tizen.org/appcontrol/appwidget/update";
+const String APPWIDGET_ON_RESIZE = L"http://tizen.org/appcontrol/appwidget/resize";
+const String APPWIDGET_ON_TOUCH = L"http://tizen.org/appcontrol/appwidget/touch";
const int UPDATE_PERIOD_MSEC_MIN = 1800000; // 30min
,__updateMillis(period)
,__lastUpdatedTime(0)
,__pPendingTouchEventList(null)
+ ,__pPendingEventList(null)
, __hasPendingRequest(false)
{
if (__updateMillis > 0)
__pPendingTouchEventList = new ArrayListT<PendingTouchEvent*>();
__pPendingTouchEventList->Construct();
+
+ __pPendingEventList = new ArrayListT<PendingEvent*>();
+ __pPendingEventList->Construct();
+
+
}
_AppWidgetContext::~_AppWidgetContext(void)
__pPendingTouchEventList->RemoveAll();
delete __pPendingTouchEventList;
}
+
+ if (__pPendingEventList)
+ {
+ for (int i = 0; i < __pPendingEventList->GetCount(); i++)
+ {
+ PendingEvent* pEvent = null;
+ __pPendingEventList->GetAt(i, pEvent);
+ delete pEvent;
+ }
+ __pPendingEventList->RemoveAll();
+ delete __pPendingEventList;
+ }
}
_AppWidgetPopupContext*
}
else
{
- this->SendUpdateRequest(GetWidth(), GetHeight(), argument);
+ result r = this->SendUpdateRequest(GetWidth(), GetHeight(), argument);
+ SysTryLog(NID_SHELL, !IsFailed(r), "Failed to execute SendUpdateRequest.");
SystemTime::GetTicks(this->__lastUpdatedTime);
SysLog(NID_SHELL, "The last updated time is %lld.", this->__lastUpdatedTime);
SendResizeRequest(width, height);
}
+result
+_AppWidgetContext::RequestUpdate(const String& argument)
+{
+ AppWidgetManagerService* pMgrService = AppWidgetManagerService::GetInstance();
+ SysTryReturnResult(NID_SHELL, pMgrService, E_SYSTEM, "[E_SYSTEM] Failed to get an instance of AppWidgetManagerService.");
+
+ result r = pMgrService->RequestUpdate(this, argument);
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), r, "Failed to request update.");
+
+ return r;
+}
+
void
_AppWidgetContext::OnForeground(void)
{
- SysLog(NID_SHELL, "OnForeground");
+ SysLog(NID_SHELL, "I");
if (!IsPaused())
{
if (__hasPendingRequest == true)
{
- OnUpdate(__pendingArgument);
+ RequestUpdate(__pendingArgument);
}
else
{
if (isPeriodExpired)
{
SysLog(NID_SHELL, "The period is expired.");
- OnUpdate(L"");
+ RequestUpdate(L"");
}
}
}
+
+ SysLog(NID_SHELL, "O");
}
void
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_ADD, pArgs.get());
+ return SendRequestToApp(GetAppId(), APPWIDGET_ON_ADD, pArgs.release());
}
result
pArgs->Add(new String(ARG_KEY_ARGUMENT), new String(argument));
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_UPDATE, pArgs.get());
+ return SendRequestToApp(GetAppId(), APPWIDGET_ON_UPDATE, pArgs.release());
}
result
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_RESIZE, pArgs.get());
+ return SendRequestToApp(GetAppId(), APPWIDGET_ON_RESIZE, pArgs.release());
}
result
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_REMOVE, pArgs.get());
+ return SendRequestToApp(GetAppId(), APPWIDGET_ON_REMOVE, pArgs.release());
+}
+
+result
+_AppWidgetContext::SendPendingEvent(void)
+{
+ SysTryReturnResult(NID_SHELL, __pPendingEventList->GetCount() > 0 , E_SUCCESS, "There is no pending event.");
+
+ PendingEvent* pEvent = null;
+ __pPendingEventList->GetAt(0, pEvent);
+
+ if (pEvent != null)
+ {
+ SysLog(NID_SHELL, "SendPendingEvent by IPC [%d existed.]", __pPendingEventList->GetCount());
+ _AppWidgetRequestHelper::SendRequestToApp(GetClientId(), pEvent->operation, pEvent->pArg);
+ __pPendingEventList->RemoveAt(0);
+ }
+ else
+ {
+ SysLog(NID_SHELL, "SendPendingEvent by IPC [0 existed.]");
+ }
+
+ return E_SUCCESS;
}
void
result
_AppWidgetContext::SendRequestToApp(const AppId& appId, const String& operation, HashMap* pArgs)
{
- return _AppWidgetContextBase::SendRequestToApp(appId, operation, pArgs);
+ result r = E_SUCCESS;
+
+ if (AppManager::GetInstance()->IsRunning(appId) == false)
+ {
+ SysLog(NID_SHELL, "The application is not running.");
+ return _AppWidgetContextBase::SendRequestToApp(appId, operation, pArgs);
+ }
+ else
+ {
+ if(!HasValidClientId())
+ {
+ SysLog(NID_SHELL, "The application is running but IPC is not connected yet.");
+ __pPendingEventList->Add(new PendingEvent(*new String(GetInstanceId()), *new String(operation), pArgs));
+ }
+ else
+ {
+ SysLog(NID_SHELL, "The application is running and IPC is connected.");
+ r = _AppWidgetRequestHelper::SendRequestToApp(GetClientId(), operation, pArgs);
+
+// pArgs->RemoveAll(true);
+// delete pArgs;
+ }
+ }
+
+ return E_SUCCESS;
}
result
{
HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
pArgs->Construct();
+
pArgs->Add(new String(ARG_KEY_INSTANCE_ID), new String(GetInstanceId()));
pArgs->Add(new String(ARG_KEY_PROVIDER_NAME), new String(GetProviderName()));
pArgs->Add(new String(ARG_KEY_USER_INFO), new String(GetUserInfo()));
}
void
+_AppWidgetContext::SetIpcClientId(int clientId)
+{
+ _AppWidgetContextBase::SetIpcClientId(clientId);
+}
+
+void
_AppWidgetContext::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
{
if (&timer == &__updateTimer)
#include <FApp_AppControlManager.h>
#include "FShell_AppWidgetManagerImpl.h"
#include "FShell_AppWidgetContextBase.h"
+#include "FShell_AppWidgetManagerService.h"
// provider/src/fb.c
struct fb_info {
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
-const wchar_t ARG_KEY_INSTANCE_ID[] = L"_InstanceId";
-const wchar_t ARG_KEY_PROVIDER_NAME[] = L"_ProviderName";
-const wchar_t ARG_KEY_USER_INFO[] = L"_UserInfo";
-const wchar_t ARG_KEY_X[] = L"_X";
-const wchar_t ARG_KEY_Y[] = L"_Y";
-const wchar_t ARG_KEY_WIDTH[] = L"_Width";
-const wchar_t ARG_KEY_HEIGHT[] = L"_Height";
-const wchar_t ARG_KEY_POPUP_WIDTH[] = L"_PopupWidth";
-const wchar_t ARG_KEY_POPUP_HEIGHT[] = L"_PopupHeight";
-const wchar_t ARG_KEY_ARGUMENT[] = L"_Argument";
-const wchar_t ARG_KEY_EVENT_TYPE[] = L"_EventType";
-const wchar_t ARG_KEY_TIME_STAMP[] = L"_TimeStamp";
+extern const String ARG_KEY_INSTANCE_ID = L"_InstanceId";
+extern const String ARG_KEY_PROVIDER_NAME = L"_ProviderName";
+extern const String ARG_KEY_USER_INFO = L"_UserInfo";
+extern const String ARG_KEY_X = L"_X";
+extern const String ARG_KEY_Y = L"_Y";
+extern const String ARG_KEY_WIDTH = L"_Width";
+extern const String ARG_KEY_HEIGHT = L"_Height";
+extern const String ARG_KEY_POPUP_WIDTH = L"_PopupWidth";
+extern const String ARG_KEY_POPUP_HEIGHT = L"_PopupHeight";
+extern const String ARG_KEY_ARGUMENT = L"_Argument";
+extern const String ARG_KEY_EVENT_TYPE = L"_EventType";
+extern const String ARG_KEY_TIME_STAMP = L"_TimeStamp";
_AppWidgetContextBase::_AppWidgetContextBase(target_type type, const String& userInfo, const String& providerId, const String& instanceId, int width, int height, int priority)
:__type(type)
result
_AppWidgetContextBase::SendRequestToApp(const AppId& appId, const String& operation, HashMap* pArgs)
{
- return _AppWidgetRequestHelper::SendRequestToApp(appId, operation, pArgs);
+ result r = _AppWidgetRequestHelper::SendRequestToApp(appId, operation, pArgs);
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "Failed to SendRequestToApp");
+
+ return r;
}
String
result
_AppWidgetRequestHelper::SendRequestToApp(const AppId& appId, const String& operation, HashMap* pArgs)
{
- SysLog(NID_SHELL, "appId(%ls), operation(%ls), arg count(%d)", appId.GetPointer(), operation.GetPointer(), pArgs->GetCount() );
+ const String* pInstanceId = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_INSTANCE_ID));
+ SysTryReturnResult(NID_SHELL, pInstanceId, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_INSTANCE_ID.GetPointer() );
+
+ SysSecureLog(NID_SHELL, "[ac] pInstanceId(%ls), operation(%ls), appId(%ls), arg count(%d)", pInstanceId->GetPointer(), operation.GetPointer(), appId.GetPointer(), pArgs->GetCount());
_AppMessageImpl msg;
msg.AddData(OSP_K_APPCONTROL_INTERNAL_OPERATION, L"appwidget");
std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId) );
std::unique_ptr<char[]> pOperation(_StringConverter::CopyToCharArrayN(operation) );
-
const int TRY_COUNT = 3;
const int TRY_SLEEP_TIME = 65;
return r;
}
+result
+_AppWidgetRequestHelper::SendRequestToApp(const int clientId, const String& operation, HashMap* pArgs)
+{
+ const String* pInstanceId = dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_INSTANCE_ID));
+ SysTryReturnResult(NID_SHELL, pInstanceId, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_INSTANCE_ID.GetPointer() );
+
+ SysSecureLog(NID_SHELL, "[ipc] pInstanceId(%ls), operation(%ls), clientId(%d)", pInstanceId->GetPointer(), operation.GetPointer(), clientId);
+
+ bool sendResult = AppWidgetManagerService::GetInstance()->SendAppWidgetEvent(clientId, *pInstanceId, operation, pArgs);
+ SysTryReturnResult(NID_SHELL, sendResult, E_FAILURE, "Propagated.");
+
+ return E_SUCCESS;
+}
+
}}} // Tizen::Shell::App
////////////////////////////////////////////
}
extern const int UPDATE_PERIOD_MSEC_MIN;
+const wchar_t INVALID_INSTANCE[] = L"file://invalid instance id";
AppWidgetManagerService* AppWidgetManagerService::__pTheInstance = null;
int
AppWidgetManagerService::OnAppWidgetPauseAll(struct event_arg *arg, void* data)
{
- SysLog(NID_SHELL, "OnAppWidgetPauseAll");
+ SysLog(NID_SHELL, "I");
AppWidgetManagerService* pAppManagerService = AppWidgetManagerService::GetInstance();
pAppWidgetContext->OnBackground();
}
+ SysLog(NID_SHELL, "O");
return 0;
}
int
AppWidgetManagerService::OnAppWidgetResumeAll(struct event_arg *pArg, void* pData)
{
- SysLog(NID_SHELL, "OnAppWidgetResumeAll");
+ SysLog(NID_SHELL, "I");
AppWidgetManagerService* pAppManagerService = AppWidgetManagerService::GetInstance();
pAppWidgetContext->OnForeground();
}
+ SysLog(NID_SHELL, "O");
return 0;
}
return (found) ? E_SUCCESS : E_OBJ_NOT_FOUND;
}
+// for resuming
+result
+AppWidgetManagerService::RequestUpdate(_AppWidgetContext* pAppWidgetContext, const String& argument)
+{
+ if (pAppWidgetContext)
+ {
+ ArrayList* pArray = new (std::nothrow) ArrayList();
+ SysTryReturnResult(NID_SHELL, pArray, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+
+ pArray->Construct();
+ pArray->Add(pAppWidgetContext);
+ pArray->Add(new String(argument));
+
+ result r = __handlerThread.SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
+ SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
+ }
+ else
+ {
+ SysLog(NID_SHELL, "pAppWidgetContext is null.");
+ }
+
+ SysLog(NID_SHELL, "O");
+ return E_SUCCESS;
+}
+
result
AppWidgetManagerService::RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument)
{
result
AppWidgetManagerService::SendResult(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, bool isSucceeded)
{
+ _AppWidgetContext* pAppWidgetContext = null;
+
if (!isSucceeded)
{
- _AppWidgetContext* pAppWidgetContext = this->Find(appId, instanceId);
- SysSecureTryReturnResult(NID_SHELL, pAppWidgetContext, E_SYSTEM, "[E_SYSTEM] pAppWidgetContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
+ SysLog(NID_SHELL, "SendResult is called[false].");
+
+ if (instanceId == INVALID_INSTANCE)
+ {
+ for (int i = 0; i < __appWidgetContextList.GetCount(); i++)
+ {
+ __appWidgetContextList.GetAt(i, pAppWidgetContext);
+
+ if (!pAppWidgetContext->IsRunning())
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ pAppWidgetContext = this->Find(appId, instanceId);
+ SysSecureTryReturnResult(NID_SHELL, pAppWidgetContext, E_SYSTEM, "pAppWidgetContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
+ }
std::unique_ptr<char[]> packageName(_StringConverter::CopyToCharArrayN(pAppWidgetContext->GetProviderId()));
std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(pAppWidgetContext->GetInstanceId()));
SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "Failed to execute provider_send_deleted.");
result r = pAppWidgetContext->OnRemoved();
- SysTryReturn(NID_SHELL, !IsFailed(r), 0, E_SYSTEM, "[E_SYSTEM] Failed to execute OnRemoved.");
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "Failed to execute OnRemoved.");
r = RemoveAppWidget(packageName.get(), id.get(), true);
- SysTryReturn(NID_SHELL, !IsFailed(r), 0, E_SYSTEM, "[E_SYSTEM] Failed to execute RemoveAppWidget.");
+ SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "Failed to execute RemoveAppWidget.");
+
+ RequestPendingEvent();
+ }
+ else // for pending event excluding touch event.
+ {
+ SysLog(NID_SHELL, "SendResult is called[true].");
+
+ pAppWidgetContext = this->Find(appId, instanceId);
+
+ if (pAppWidgetContext)
+ {
+ SysLog(NID_SHELL, "AppWidgetContext for %ls exists.", instanceId.GetPointer());
+ RequestPendingEvent();
+ }
+ else
+ {
+ SysLog(NID_SHELL, "AppWidgetContext for %ls is empty.", instanceId.GetPointer());
+ }
}
return E_SUCCESS;
}
+result
+AppWidgetManagerService::RequestPendingEvent(void)
+{
+ for (int i = 0; i < __appWidgetContextList.GetCount(); i++ )
+ {
+ _AppWidgetContext* pAppWidgetContext = null;
+ __appWidgetContextList.GetAt(i, pAppWidgetContext);
+
+ pAppWidgetContext->SendPendingEvent();
+ }
+
+ return E_SUCCESS;
+}
AppWidgetManagerService::_TaskHandlerThread::~_TaskHandlerThread(void)
{
*/
#include <FBaseSysLog.h>
+#include <FBaseColHashMap.h>
#include <FIo_IpcServer.h>
#include "FShell_AppWidgetManagerIpcMessage.h"
#include "FShell_AppWidgetManagerStub.h"
};
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Io;
using namespace Tizen::Text;
using namespace Tizen::Security;
}
bool
+_AppWidgetManagerStub::SendAppWidgetEvent(const int clientId, const String& instanceId, const String& operationId, HashMap* pArgs)
+{
+ SysLog(NID_SHELL, "The operation type is %ls", operationId.GetPointer());
+ result r = __pIpcServer->SendResponse(clientId, new AppWidgetManager_SendAppWidgetEvent(instanceId, operationId, *pArgs));
+ SysTryReturn(NID_SHELL, !IsFailed(r), false, r, "[%s] Propagated.", GetErrorMessage(r));
+
+ return true;
+}
+
+bool
_AppWidgetManagerStub::SendTouchEvent(const int clientId, const String& instanceId, int eventType, double timestamp, double x, double y)
{
SysLog(NID_SHELL,"");
result r = __pIpcServer->SendResponse(clientId, new AppWidgetManager_SendTouchEvent(instanceId, eventType, timestamp, x, y));
SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "[%s] Propagated.", GetErrorMessage(r));
+
return true;
}
{
SysLog(NID_SHELL,"");
result r = __pIpcServer->SendResponse(clientId, new AppWidgetManager_SendTouchEventForPD(instanceId, eventType, timestamp, x, y));
- SysTryReturn(NID_SHELL, !IsFailed(r), r, r, "[%s] Propagated.", GetErrorMessage(r));
+ SysTryReturn(NID_SHELL, !IsFailed(r), false, r, "[%s] Propagated.", GetErrorMessage(r));
return true;
}