Addition check added for Conditional launch Argument 59/14659/1 accepted/tizen/mobile accepted/tizen/mobile/20140113.182336 submit/tizen/20140112.150110
authorJiban Prakash <p.jiban@samsung.com>
Sat, 16 Nov 2013 03:38:29 +0000 (12:38 +0900)
committerKeebong <keebong.bahn@samsung.com>
Thu, 9 Jan 2014 07:56:42 +0000 (16:56 +0900)
Change-Id: I1944a1c5a12d0eb1c472a4646c95f60f7e97a314
Signed-off-by: Jiban Prakash <p.jiban@samsung.com>
plugins/alarm-condition-handler/AlarmConditionHandler.cpp

index e955985..11f3e36 100644 (file)
@@ -538,20 +538,26 @@ _AlarmConditionHandler::SettingEventCb(keynode_t* node, void* userData)
                        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);
                }