namespace Tizen { namespace Shell { namespace App
{
+using namespace std;
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
__updateTimer.StartAsRepeatable(__updateMillis);
}
- __pPendingTouchEventList = new ArrayListT<PendingTouchEvent*>();
+ __pPendingTouchEventList = new (nothrow) ArrayListT<PendingTouchEvent*>();
__pPendingTouchEventList->Construct();
- __pPendingEventList = new ArrayListT<PendingEvent*>();
+ __pPendingEventList = new (nothrow) ArrayListT<PendingEvent*>();
__pPendingEventList->Construct();
}
void
_AppWidgetContext::OnPopupCreated(double x, double y, int width, int height)
{
- __pAppWidgetPopup = new (std::nothrow) _AppWidgetPopupContext(GetUserInfo(), GetProviderId(), GetInstanceId(), GetWidth(), GetHeight(), GetPriority(), this);
+ __pAppWidgetPopup = new (nothrow) _AppWidgetPopupContext(GetUserInfo(), GetProviderId(), GetInstanceId(), GetWidth(), GetHeight(), GetPriority(), this);
__pAppWidgetPopup->SetIpcClientId(GetClientId());
__pAppWidgetPopup->OnPopupCreated(x, y, width, height);
}
{
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.release());
}
r = _AppWidgetRequestHelper::SendIpcRequest(GetClientId(), pEvent->operation, pEvent->pArg);
result r1 = __pPendingEventList->RemoveAt(0);
- SysTryLog(NID_SHELL, !IsFailed(r1), "Failed to execute remove context.");
+ SysTryLog(NID_SHELL, !IsFailed(r1), "Failed to remove the context.");
delete pEvent;
SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "SendIpcRequest failed.");
}
else
{
- __pPendingTouchEventList->Add(new PendingTouchEvent(eventType, timeStamp, x, y));
+ __pPendingTouchEventList->Add(new (nothrow) PendingTouchEvent(eventType, timeStamp, x, y));
if( AppManager::GetInstance()->IsRunning(this->GetAppId() ) == false)
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
// TODO: consider to remove these unused args.
- 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)));
+ pArgs->Add(new (nothrow) String(ARG_KEY_EVENT_TYPE), new (nothrow) String(Integer::ToString(eventType)));
+ 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());
}
if (!HasValidClientId() || __pAppContext->__isWaitingResult == true)
{
SysLog(NID_SHELL, "The application is running but IPC is not connected yet.");
- __pPendingEventList->Add(new PendingEvent(*new String(operation), pArgs));
+ __pPendingEventList->Add(new (nothrow) PendingEvent(operation, pArgs));
}
else
{
Tizen::Base::Collection::HashMap*
_AppWidgetContext::CreateRequestArgsN(void)
{
- 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;
}
void
OspAppWidgetService::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)
{
- if( operationId == OPERATION_MAIN)
+ if (operationId == OPERATION_MAIN)
{
static bool isServiceCreated = false;
- if( isServiceCreated == false)
+ if (isServiceCreated == false)
{
String key(KEY_NAME);
const String* pValue = dynamic_cast<const String*>(pExtraData->GetValue(key));
- std::unique_ptr<char[]> pIdForCoreDaemon(_StringConverter::CopyToCharArrayN(*pValue));
- AppWidgetManagerService* pSvc = AppWidgetManagerService::CreateInstance(pIdForCoreDaemon.get());
- AppAssertf( pSvc != null, "AppWidgetManagerService::GetInstance() failed.");
+ AppWidgetManagerService* pSvc = null;
+
+ if (pValue)
+ {
+ std::unique_ptr<char[]> pIdForCoreDaemon(_StringConverter::CopyToCharArrayN(*pValue));
+ pSvc = AppWidgetManagerService::CreateInstance(pIdForCoreDaemon.get());
+ }
+ else
+ {
+ pSvc = AppWidgetManagerService::CreateInstance("osp-appwidget-service");
+ }
+ AppAssertf(pSvc != null, "AppWidgetManagerService::GetInstance() failed.");
isServiceCreated = true;
}