#include <provider.h>
#include <unique_ptr.h>
+#include <FBase.h>
#include <FBaseSysLog.h>
-#include <FBaseInteger.h>
-#include <FBaseDouble.h>
-#include <FBaseColHashMap.h>
-#include <FBaseColAllElementsDeleter.h>
#include <FSysSystemTime.h>
-#include <FAppAppManager.h>
-
+#include <FAppApp.h>
#include <FBase_StringConverter.h>
+#include <FApp_AppManagerImpl.h>
+#include "FShell_AppWidgetManagerImpl.h"
#include "FShell_AppWidgetManagerService.h"
#include "FShell_AppWidgetPopupContext.h"
#include "FShell_AppWidgetContext.h"
+#include "FShell_AppWidgetContextHelper.h"
+#include "FShell_AppWidgetRemoteBuffer.h"
namespace Tizen { namespace Shell { namespace App
{
+using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::System;
+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";
+
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 int UPDATE_PERIOD_MSEC_MIN = 1800000; // 30min
-_AppWidgetContext::_AppWidgetContext(const String& info, const String& providerId, const String& instanceId, int width, int height, int period, int priority)
- :_AppWidgetContextBase(TYPE_LB, info, providerId, instanceId, width, height, priority)
- ,__pAppWidgetPopup(null)
- ,__updateMillis(period)
+
+_AppWidgetContext::_AppWidgetContext(_AppContext* pAppContext, const String& instanceId, const String& providerId, int width, int height, const Tizen::Base::String& userInfo, int period, int priority)
+ :__instanceId(instanceId)
+ ,__providerId(providerId)
+ ,__appId(_AppWidgetHelper::ExtractAppId(providerId))
+ ,__providerName(_AppWidgetHelper::ExtractProviderName(providerId))
+ ,__userInfo(userInfo)
+ ,__width(width)
+ ,__height(height)
+ ,__priority(priority)
+ ,__updateMillis( (period > UPDATE_PERIOD_MSEC_MIN) ? period : UPDATE_PERIOD_MSEC_MIN )
+ ,__ipcClientId(-1)
+ ,__isForeground(true)
+ ,__isRemoteBufferProxyCreated(false)
,__lastUpdatedTime(0)
+ ,__hasPendingRequest(false)
+ ,__pAppContext(pAppContext)
+ ,__pAppWidgetPopup(null)
+ ,__pAppWidgetRemoteBuffer(null)
,__pPendingTouchEventList(null)
- , __hasPendingRequest(false)
{
+ SysSecureLog(NID_SHELL, "appId(%ls), providerId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d), period(%d)", __appId.GetPointer(), __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height, __priority, __updateMillis);
+
+ // for updating period
if (__updateMillis > 0)
{
- __updateMillis = (__updateMillis > UPDATE_PERIOD_MSEC_MIN) ? __updateMillis : UPDATE_PERIOD_MSEC_MIN;
- SysLog(NID_SHELL, "period(%d)", __updateMillis);
-
SystemTime::GetTicks(this->__lastUpdatedTime);
- __updateTimer.Construct(*this);
- __updateTimer.StartAsRepeatable(__updateMillis);
+ result r = __updateTimer.Construct(*this);
+ SysTryReturnVoidResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "");
+
+ r = __updateTimer.StartAsRepeatable(__updateMillis);
+ SysTryReturnVoidResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "");
}
- __pPendingTouchEventList = new ArrayListT<PendingTouchEvent*>();
+ __pPendingTouchEventList = new (nothrow) ArrayListT<PendingTouchEvent*>();
+ SysTryReturnVoidResult(NID_SHELL, __pPendingTouchEventList, E_OUT_OF_MEMORY, "");
__pPendingTouchEventList->Construct();
+
+ __pAppWidgetRemoteBuffer = new (nothrow) _AppWidgetRemoteBuffer(providerId, instanceId, TYPE_LB, this);
+ SysTryReturnVoidResult(NID_SHELL, __pAppWidgetRemoteBuffer, E_OUT_OF_MEMORY, "");
}
_AppWidgetContext::~_AppWidgetContext(void)
if (__pAppWidgetPopup)
{
SysLog(NID_SHELL, "Destroying dangling AppWidgetPopup instance..");
- __pAppWidgetPopup->OnPopupDestoyed();
delete __pAppWidgetPopup;
}
__pPendingTouchEventList->RemoveAll();
delete __pPendingTouchEventList;
}
+
+ if (__pAppWidgetRemoteBuffer)
+ {
+ delete __pAppWidgetRemoteBuffer;
+ }
+}
+
+_AppContext*
+_AppWidgetContext::GetAppContext(void) const
+{
+ return __pAppContext;
}
_AppWidgetPopupContext*
}
result
-_AppWidgetContext::OnRemoved(void)
+_AppWidgetContext::OnRemoved(bool isTriggeredByViewer)
{
- return SendRemoveRequest();
+ if (isTriggeredByViewer)
+ {
+ return SendRemoveRequest();
+ }
+ else
+ {
+ std::unique_ptr<char[]> providerId(_StringConverter::CopyToCharArrayN(GetProviderId()));
+ std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(GetInstanceId()));
+
+ int ret = provider_send_deleted(providerId.get(), id.get());
+ SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "Failed to execute provider_send_deleted.");
+ }
+ return E_SUCCESS;
}
void
_AppWidgetContext::OnUpdate(const String& argument)
{
+ SysLog(NID_SHELL, "argument(%ls)", argument.GetPointer());
ClearLastResult();
- AppWidgetManagerService* pMgrService = AppWidgetManagerService::GetInstance();
- SysTryReturnVoidResult(NID_SHELL, pMgrService, E_SYSTEM, "[E_SYSTEM] Failed to get an instance of AppWidgetManagerService.");
+ if (this->IsForeground())
+ {
+ result r = this->SendUpdateRequest(GetWidth(), GetHeight(), argument);
+ SysTryLog(NID_SHELL, !IsFailed(r), "Failed to execute SendUpdateRequest.");
- // Queueing the pointer of paused context.
- if (this->IsPaused())
+ SystemTime::GetTicks(this->__lastUpdatedTime);
+ SysLog(NID_SHELL, "The last updated time is %lld.", this->__lastUpdatedTime);
+
+ __hasPendingRequest = false;
+ __pendingArgument.Clear();
+ }
+ else
{
- // Saving the data
+ // Queueing the pointer of background context.
if (!argument.IsEmpty())
{
__pendingArgument = argument;
}
__hasPendingRequest = true;
- SysLog(NID_SHELL, "Update is requested but the %ls is paused.", (this->GetAppId()).GetPointer());
+ SysLog(NID_SHELL, "Update is requested but the %ls is background.", (this->GetProviderId()).GetPointer());
}
- else
- {
- this->SendUpdateRequest(GetWidth(), GetHeight(), argument);
+}
- SystemTime::GetTicks(this->__lastUpdatedTime);
- SysLog(NID_SHELL, "The last updated time is %lld.", this->__lastUpdatedTime);
+result
+_AppWidgetContext::OnUpdateAsync(_AppContext* pAppContext, const String& argument)
+{
+ ArrayList* pArray = new (std::nothrow) ArrayList();
+ SysTryReturnResult(NID_SHELL, pArray, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
- __hasPendingRequest = false;
- __pendingArgument.Clear();
- }
+ pArray->Construct();
+ pArray->Add(pAppContext);
+ pArray->Add(this);
+ pArray->Add(new String(argument));
+
+ result r = Tizen::App::App::GetInstance()->SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
+ SysTryLog(NID_SHELL, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
+ SysLog(NID_SHELL, "UserEvent(%d) is sent for '%ls.%ls'.", LOCAL_EVENT_REQUEST_UPDATE, GetAppId().GetPointer(), GetProviderName().GetPointer() );
+
+ return E_SUCCESS;
}
void
void
_AppWidgetContext::OnForeground(void)
{
- SysLog(NID_SHELL, "OnForeground");
-
- if (!IsPaused())
+ if (IsForeground())
{
- SysLog(NID_SHELL, "%ls is already resumed.", (this->GetAppId()).GetPointer());
+ SysLog(NID_SHELL, "%ls is already foreground.", (this->GetAppId()).GetPointer());
return;
}
- this->SetForeground(true);
+ __isForeground = true;
if (__hasPendingRequest == true)
{
- OnUpdate(__pendingArgument);
+ SysLog(NID_SHELL, "There is pending request.");
+ OnUpdateAsync(__pAppContext, __pendingArgument);
}
else
{
- if (this->GetPeriod() > 0)
+ if (IsUpdatePeriodExpired() == true)
{
- long long currentTicks = 0;
- SystemTime::GetTicks(currentTicks);
-
- SysLog(NID_SHELL, "current[%lld] - updatedTime[%lld] = [%lld], period[%d]",
- currentTicks, this->GetLastUpdatedTime(), currentTicks - this->GetLastUpdatedTime(), this->GetPeriod());
-
- bool isPeriodExpired = (currentTicks - this->GetLastUpdatedTime()) >= (this->GetPeriod());
- if (isPeriodExpired)
- {
- SysLog(NID_SHELL, "The period is expired.");
- OnUpdate(L"");
- }
+ SysLog(NID_SHELL, "The period is expired.");
+ OnUpdateAsync(__pAppContext, L"");
}
}
}
+bool
+_AppWidgetContext::IsUpdatePeriodExpired(void) const
+{
+ if (this->GetPeriod() <= 0)
+ {
+ return false;
+ }
+
+ long long currentTicks = 0;
+ SystemTime::GetTicks(currentTicks);
+
+ SysLog(NID_SHELL, "current[%lld] - last updated time[%lld] = [%lld], period[%d]",
+ currentTicks, this->GetLastUpdatedTime(), currentTicks - this->GetLastUpdatedTime(), this->GetPeriod());
+
+ bool isPeriodExpired = (currentTicks - this->GetLastUpdatedTime()) >= (this->GetPeriod());
+ return isPeriodExpired;
+}
+
void
_AppWidgetContext::OnBackground(void)
{
- SysLog(NID_SHELL, "OnBackground");
-
- if (IsPaused())
+ if (!IsForeground())
{
- SysLog(NID_SHELL, "%ls is already paused.", (this->GetAppId()).GetPointer());
+ SysLog(NID_SHELL, "%ls is already background.", (this->GetAppId()).GetPointer());
return;
}
- SetForeground(false);
-}
-bool
-_AppWidgetContext::IsPaused(void) const
-{
- return IsForeground() ? false : true;
+ SysLog(NID_SHELL, "OnBackground");
+ __isForeground = false;
}
void
_AppWidgetContext::OnPopupCreated(double x, double y, int width, int height)
{
- __pAppWidgetPopup = new (std::nothrow) _AppWidgetPopupContext(GetUserInfo(), GetProviderId(), GetInstanceId(), GetWidth(), GetHeight(), GetPriority(), this);
- __pAppWidgetPopup->SetIpcClientId(GetClientId());
+ __pAppWidgetPopup = new (nothrow) _AppWidgetPopupContext(this);
+ SysTryReturnVoidResult(NID_SHELL, __pAppWidgetPopup, E_OUT_OF_MEMORY, "");
+
__pAppWidgetPopup->OnPopupCreated(x, y, width, height);
}
if (__pAppWidgetPopup)
{
- __pAppWidgetPopup->OnPopupDestoyed();
delete __pAppWidgetPopup;
__pAppWidgetPopup = null;
}
}
result
-_AppWidgetContext::SendAddRequest(int width, int height)
+_AppWidgetContext::SendAddRequest(int width, int height) const
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_ADD, pArgs.get());
+ return __pAppContext->SendRequestToApp(GetAppId(), APPWIDGET_ON_ADD, pArgs.release());
}
result
-_AppWidgetContext::SendUpdateRequest(int width, int height, const String& argument)
+_AppWidgetContext::SendUpdateRequest(int width, int height, const String& argument) const
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
- pArgs->Add(new String(ARG_KEY_ARGUMENT), new String(argument));
+ pArgs->Add(new (nothrow) String(ARG_KEY_ARGUMENT), new (nothrow) String(argument));
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_UPDATE, pArgs.get());
+ return __pAppContext->SendRequestToApp(GetAppId(), APPWIDGET_ON_UPDATE, pArgs.release());
}
result
-_AppWidgetContext::SendResizeRequest(int width, int height)
+_AppWidgetContext::SendResizeRequest(int width, int height) const
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_RESIZE, pArgs.get());
+ return __pAppContext->SendRequestToApp(GetAppId(), APPWIDGET_ON_RESIZE, pArgs.release());
}
result
-_AppWidgetContext::SendRemoveRequest(void)
+_AppWidgetContext::SendRemoveRequest(void) const
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_REMOVE, pArgs.get());
+ return __pAppContext->SendRequestToApp(GetAppId(), APPWIDGET_ON_REMOVE, pArgs.release());
}
void
__pPendingTouchEventList->RemoveAll();
}
-result
-_AppWidgetContext::SendTouchEvent(buffer_event eventType, double timeStamp, double x, double y)
+void
+_AppWidgetContext::OnTouchEventReceived(buffer_event event, double timestamp, double x, double y)
{
- if (HasValidClientId() && IsRunning())
+ if (__pAppContext->GetConnectionState() == CONNECTION_STATE_CONNECTED && __isRemoteBufferProxyCreated)
{
- SysAssert(IsSharedMemCreated() == true);
- SysLog(NID_SHELL, "send IPC message");
- AppWidgetManagerService::GetInstance()->SendTouchEvent(GetClientId(), GetInstanceId(), eventType, timeStamp, x, y);
+ SysLog(NID_SHELL, "%d, %f, %f", event, x, y);
+ AppWidgetManagerService::GetInstance()->SendTouchEvent(GetClientId(), GetInstanceId(), event, timestamp, x, y);
}
else
{
- SysLog(NID_SHELL, "request to start AppControl");
- __pPendingTouchEventList->Add(new PendingTouchEvent(eventType, timeStamp, x, y));
+ __pPendingTouchEventList->Add(new (nothrow) PendingTouchEvent(event, timestamp, x, y));
- if( AppManager::GetInstance()->IsRunning(this->GetAppId() ) == false)
+ if( _AppManagerImpl::GetInstance()->IsRunning(this->GetAppId() ) == false ||
+ ( __pAppContext->GetConnectionState() == CONNECTION_STATE_CONNECTED && __isRemoteBufferProxyCreated == false))
{
+ SysLog(NID_SHELL, "request to start AppControl");
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
- pArgs->Add(new String(ARG_KEY_EVENT_TYPE), new String(Integer::ToString(eventType)));
- pArgs->Add(new String(ARG_KEY_TIME_STAMP), new String(Double::ToString(timeStamp)));
- pArgs->Add(new String(ARG_KEY_X), new String(Double::ToString(x)));
- pArgs->Add(new String(ARG_KEY_Y), new String(Double::ToString(y)));
+ // TODO: consider to remove these unused args.
+ pArgs->Add(new (nothrow) String(ARG_KEY_EVENT_TYPE), new (nothrow) String(Integer::ToString(event)));
+ pArgs->Add(new (nothrow) String(ARG_KEY_TIME_STAMP), new (nothrow) String(Double::ToString(timestamp)));
+ pArgs->Add(new (nothrow) String(ARG_KEY_X), new (nothrow) String(Double::ToString(x)));
+ pArgs->Add(new (nothrow) String(ARG_KEY_Y), new (nothrow) String(Double::ToString(y)));
- return SendRequestToApp(GetAppId(), APPWIDGET_ON_TOUCH, pArgs.get());
+ _AppWidgetRequestHelper::SendAppControlRequest(GetAppId(), APPWIDGET_ON_TOUCH, pArgs.get());
}
}
+}
+
+result
+_AppWidgetContext::SyncRemoteBuffer(int width, int height)
+{
+ std::unique_ptr<char[]> providerId(_StringConverter::CopyToCharArrayN(GetProviderId()));
+ std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(GetInstanceId()));
+ std::unique_ptr<char[]> content_info(_StringConverter::CopyToCharArrayN(GetUserInfo()));
+
+ int ret = provider_send_updated(providerId.get(), id.get(), width, height, GetPriority(), content_info.get(), null);
+ SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "[E_SYSTEM] failed to provider_send_updated");
+
+ SendPendingTouchEvent();
+ SysLog(NID_SHELL, "Done");
return E_SUCCESS;
}
result
-_AppWidgetContext::SendRequestToApp(const AppId& appId, const String& operation, HashMap* pArgs)
+_AppWidgetContext::SyncRemoteBufferForPD(void) const
{
- return _AppWidgetContextBase::SendRequestToApp(appId, operation, pArgs);
+ _AppWidgetPopupContext* pPopupContext = GetAppWidgetPopup();
+ SysSecureTryReturnResult(NID_SHELL, pPopupContext , E_SYSTEM, "pPopupContext is null for (%ls)", GetProviderId().GetPointer());
+
+ return pPopupContext->SyncRemoteBuffer();
}
result
-_AppWidgetContext::RequestUpdateRemote(int width, int height)
+_AppWidgetContext::SendAccessStatus(int accessStatus) const
{
- std::unique_ptr<char[]> packageName(_StringConverter::CopyToCharArrayN(GetProviderId()));
+ std::unique_ptr<char[]> providerId(_StringConverter::CopyToCharArrayN(GetProviderId()));
std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(GetInstanceId()));
- std::unique_ptr<char[]> content_info(_StringConverter::CopyToCharArrayN(GetUserInfo()));
- int ret = provider_send_updated(packageName.get(), id.get(), width, height, GetPriority(), content_info.get(), null);
- SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "[E_SYSTEM] failed to provider_send_updated");
+ int ret = provider_send_access_status(providerId.get(), id.get(), accessStatus);
+ SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "[E_SYSTEM] failed to provider_send_access_status");
- SendPendingTouchEvent();
- SysLog(NID_SHELL, "Done");
return E_SUCCESS;
}
Tizen::Base::Collection::HashMap*
-_AppWidgetContext::CreateRequestArgsN(void)
+_AppWidgetContext::CreateRequestArgsN(void) const
{
- HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
+ HashMap* pArgs = new (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()));
- pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(GetWidth())));
- pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(GetHeight())));
+
+ pArgs->Add(new (nothrow) String(ARG_KEY_INSTANCE_ID), new (nothrow) String(GetInstanceId()));
+ pArgs->Add(new (nothrow) String(ARG_KEY_PROVIDER_NAME), new (nothrow) String(GetProviderName()));
+ pArgs->Add(new (nothrow) String(ARG_KEY_USER_INFO), new (nothrow) String(GetUserInfo()));
+ pArgs->Add(new (nothrow) String(ARG_KEY_WIDTH), new (nothrow) String(Integer::ToString(GetWidth())));
+ pArgs->Add(new (nothrow) String(ARG_KEY_HEIGHT), new (nothrow) String(Integer::ToString(GetHeight())));
return pArgs;
}
int
_AppWidgetContext::GetPeriod(void) const
{
- SysLog(NID_SHELL, "GetPeriod[%d]", __updateMillis);
return __updateMillis;
}
return __lastUpdatedTime;
}
+int
+_AppWidgetContext::GetClientId(void) const
+{
+ return GetAppContext()->GetClientId();
+}
+
+int
+_AppWidgetContext::GetWidth(void) const
+{
+ return __width;
+}
+
+void
+_AppWidgetContext::SetWidth(int width)
+{
+ __width = width;
+}
+
+int
+_AppWidgetContext::GetHeight(void) const
+{
+ return __height;
+}
+
+void
+_AppWidgetContext::SetHeight(int height)
+{
+ __height = height;
+}
+
+String
+_AppWidgetContext::GetProviderId(void) const
+{
+ return __providerId;
+}
+
+/*void
+_AppWidgetContext::SetProviderId(const String& providerId)
+{
+ __providerId = providerId;
+}*/
+
+String
+_AppWidgetContext::GetAppId(void) const
+{
+ return __appId;
+}
+
+int
+_AppWidgetContext::GetPriority(void) const
+{
+ return __priority;
+}
+
+/*void
+_AppWidgetContext::SetPriority(int priority)
+{
+ __priority = priority;
+}*/
+
+String
+_AppWidgetContext::GetProviderName(void) const
+{
+ return __providerName;
+}
+
+bool
+_AppWidgetContext::IsForeground(void) const
+{
+ return __isForeground;
+}
+
+String
+_AppWidgetContext::GetUserInfo(void) const
+{
+ return __userInfo;
+}
+
+/*void
+_AppWidgetContext::SetUserInfo(const String& userInfo)
+{
+ __userInfo = userInfo;
+}*/
+
+String
+_AppWidgetContext::GetInstanceId(void) const
+{
+ return __instanceId;
+}
+
void
_AppWidgetContext::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
{
}
}
+void
+_AppWidgetContext::OnDisconnected(void)
+{
+ SysSecureLog(NID_SHELL, "%ls, %ls", GetInstanceId().GetPointer(), GetProviderId().GetPointer());
+
+ __isRemoteBufferProxyCreated = false;
+ if (GetAppWidgetPopup())
+ {
+ OnPopupDestoyed();
+ }
+}
+
+int
+_AppWidgetContext::AcquireRemoteBuffer(int w, int h) const
+{
+ int id = __pAppWidgetRemoteBuffer->Acquire(w, h);
+ if (id != -1)
+ {
+ __isRemoteBufferProxyCreated = true;
+ }
+ return id;
+}
+
+int
+_AppWidgetContext::AcquireRemoteBufferForPD(int w, int h) const
+{
+ _AppWidgetPopupContext* pPopupContext = GetAppWidgetPopup();
+ SysSecureTryReturnResult(NID_SHELL, pPopupContext , E_SYSTEM, "pPopupContext is null for (%ls)", GetProviderId().GetPointer());
+
+ int bufferId = pPopupContext->AcquireRemoteBuffer(w, h);
+ SysSecureTryReturnResult(NID_SHELL, bufferId != -1, E_SYSTEM, "Failed to AcquireRemoteBuffer for (%ls)", GetProviderId().GetPointer());
+
+ return bufferId;
+}
+
}}} // Tizen::Shell::App