String condition(pAppLaunchCondition->GetConditionString());
IList* pArgs = pAppLaunchCondition->GetLaunchArgs();
- std::unique_ptr<Tizen::Base::Collection::ArrayList> pArguments(new (std::nothrow) ArrayList(SingleObjectDeleter));
- SysTryCatch(NID_APP, pArguments != null, r = E_OUT_OF_MEMORY, r, "failed to allocate 'pArguments'!");
+ if (pArgs != null && pArgs->GetCount() > 0)
+ {
+ std::unique_ptr<Tizen::Base::Collection::ArrayList> pArguments(new (std::nothrow) ArrayList(SingleObjectDeleter));
+ SysTryCatch(NID_APP, pArguments != null, r = E_OUT_OF_MEMORY, r, "It is failed to allocate 'pArguments'!");
- pArguments->Construct();
+ pArguments->Construct();
+ for (int i = 0; i < pArgs->GetCount() ; i++)
+ {
+ r = pArguments->Add(* new (std::nothrow) String(* static_cast<const String*>(pArgs->GetAt(i))));
+ SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s]", GetErrorMessage(r));
+ }
- for (int i = 0; i < pArgs->GetCount() ; i++)
+ pNewAppLaunchCondition = pAlarmCondHandler->GetAppLaunchConditionN(*(new AppId(appId)), *(new String(condition)), pArguments.release());
+ SysTryCatch(NID_SYS, pNewAppLaunchCondition != null, r = E_OUT_OF_MEMORY, r, "It is failed to create pAppLaunchCondition");
+ }
+ else
{
- r = pArguments->Add(* new (std::nothrow) String(* static_cast<const String*>(pArgs->GetAt(i))));
- SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s]", GetErrorMessage(r));
+ pNewAppLaunchCondition = pAlarmCondHandler->GetAppLaunchConditionN(*(new AppId(appId)), *(new String(condition)), null);
+ SysTryCatch(NID_SYS, pNewAppLaunchCondition != null, r = E_OUT_OF_MEMORY, r, "It is failed to create pAppLaunchCondition");
}
-
- pNewAppLaunchCondition = pAlarmCondHandler->GetAppLaunchConditionN(*(new AppId(appId)), *(new String(condition)), pArguments.release());
- SysTryCatch(NID_SYS, pNewAppLaunchCondition != null, r = E_OUT_OF_MEMORY, r, "It is failed to create pAppLaunchCondition");
-
updateList.Add(pKey, pNewAppLaunchCondition);
}