From: Jiban Prakash Date: Wed, 29 May 2013 05:43:39 +0000 (+0530) Subject: added the RECREATE event implementation X-Git-Tag: submit/tizen/20130912.075546~33^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b89cc4c198a55b3a7dbdc81193564099aa1a717;p=platform%2Fframework%2Fnative%2Fappwidget-service.git added the RECREATE event implementation Change-Id: I01ca6b30fac93e3cea536a3a21e3cc92b94c0ad8 Signed-off-by: Jiban Prakash --- diff --git a/src/FShell_AppWidgetManagerService.cpp b/src/FShell_AppWidgetManagerService.cpp index 3b6e0f6..b1d54c5 100644 --- a/src/FShell_AppWidgetManagerService.cpp +++ b/src/FShell_AppWidgetManagerService.cpp @@ -466,7 +466,33 @@ AppWidgetManagerService::OnAppWidgetPeriodChaned(struct event_arg *arg, void* da int AppWidgetManagerService::OnAppWidgetRecreate(struct event_arg *arg, void* data) { - SysLog(NID_SHELL, ""); + SysTryReturn(NID_SHELL, arg != null, EINVAL, E_INVALID_ARG, "[E_INVALID_ARG]"); + SysTryReturn(NID_SHELL, arg->pkgname != null, EINVAL, E_INVALID_ARG, "[E_INVALID_ARG]"); + SysTryReturn(NID_SHELL, arg->id != null, EINVAL, E_INVALID_ARG, "[E_INVALID_ARG]"); + + SysSecureLog(NID_SHELL, "packageName(%s) id(%s) content(%s) cluster(%s) category(%s)", arg->pkgname, arg->id, arg->info.lb_recreate.content, arg->info.lb_recreate.cluster, arg->info.lb_recreate.category); + + double default_priority = 1.0f; + _AppWidgetContext* pAppWidgetContext = new (std::nothrow)_AppWidgetContext( arg->info.lb_recreate.content, arg->pkgname, arg->id, + arg->info.lb_recreate.width, arg->info.lb_recreate.height, arg->info.lb_recreate.period * 1000, default_priority); + SysTryReturn(NID_SHELL, pAppWidgetContext, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]"); + + int clientId = AppWidgetManagerService::GetInstance()->Find(arg->pkgname); + if (clientId != -1) + { + SysLog(NID_SHELL, "There is same parent application."); + pAppWidgetContext->SetIpcClientId(clientId); + } + else + { + SysLog(NID_SHELL, "There is no same parent application."); + } + + AppWidgetManagerService* pAppWidgetService = AppWidgetManagerService::GetInstance(); + pAppWidgetService->AddAppWidget(pAppWidgetContext); + pAppWidgetContext->OnAdded(); + + SysLog(NID_SHELL, "Exit. %d appWidget(s)", pAppWidgetService->__appWidgetContextList.GetCount()); return 0; }