minor code cleanup
[platform/framework/native/appfw.git] / src / app / FApp_AppControlImpl.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FApp_AppControlImpl.cpp
19  * @brief               This is the implementation for the Application Control class.
20  */
21
22 #include <new>
23 #include <typeinfo>
24 #include <unique_ptr.h>
25
26 #include <appsvc/appsvc.h>
27
28 #include <FBaseColHashMap.h>
29 #include <FBaseSysLog.h>
30 #include <FAppAppControl.h>
31 #include <FAppAppManager.h>
32 #include <FAppPkgPackageAppInfo.h>
33 #include <FAppIAppControlEventListener.h>
34 #include <FAppIAppControlResponseListener.h>
35
36 #include "FApp_AppControlImpl.h"
37 #include "FApp_AppControlManager.h"
38 #include "FApp_IAppControlPluginProvider.h"
39 #include "FApp_AppArg.h"
40 #include "FApp_AppControlRegistry.h"
41 #include "FApp_AppMessageImpl.h"
42 #include "FApp_AppInfo.h"
43 #include "FAppPkg_PackageManagerImpl.h"
44 #include "FApp_Aul.h"
45 #include "FApp_AppControlEventArg.h"
46 #include "FApp_AppControlResponseEvent.h"
47 #include "FBaseRt_ThreadImpl.h"
48
49 using namespace Tizen::Base;
50 using namespace Tizen::Base::Collection;
51 using namespace Tizen::Base::Runtime;
52 using namespace Tizen::App;
53 using namespace Tizen::App::Package;
54 using namespace Tizen::Io;
55
56 namespace
57 {
58
59 const wchar_t ACTL_IMPLICIT_PLUGIN[] = L"libosp-ac-implicit.so";
60 const wchar_t TIZEN_ALIAS_APPID_PREFIX[] = L"tizen.";
61
62 }
63
64 namespace Tizen { namespace App
65 {
66
67 _AppControlImpl::_AppControlImpl(const AppControl& value)
68         : _appControl(value)
69         , _reqId(APPCONTROL_REQUEST_ID_INVALID)
70         , _property(_APPCONTROL_PROPERTY_NONE)
71         , _processId(APPCONTROL_REQUEST_ID_INVALID)
72 {
73         __appControlResponseEventList.Construct();
74 }
75
76 _AppControlImpl::~_AppControlImpl(void)
77 {
78         IEnumeratorT<int>* pEnum = __appControlResponseEventList.GetEnumeratorN();
79         IMapT<int, _AppControlResponseEvent*>* pResponseEventContainer = null;
80         if(pEnum != null)
81         {
82                 pResponseEventContainer = _AppControlManager::GetInstance()->GetAppControlResponseEventContainer();
83         }
84
85         while(pEnum->MoveNext() == E_SUCCESS)
86         {
87                 int reqId;
88                 pEnum->GetCurrent(reqId);
89                 if (pResponseEventContainer != null)
90                 {
91                         _AppControlResponseEvent* pResponseEvent = null;
92                         pResponseEventContainer->GetValue(reqId, pResponseEvent);
93                         delete pResponseEvent;
94
95                         pResponseEventContainer->Remove(reqId);
96                         SysLog(NID_APP, "pResponseEvent gets deleted. reqId(%d)", reqId);
97                 }
98         }
99         delete pEnum;
100 }
101
102 AppControl*
103 _AppControlImpl::CreateN(const String& path, const String& aId, const String& oId, int prop)
104 {
105         SysTryReturn(NID_APP, !path.IsEmpty(), null, E_INVALID_ARG, "[E_INVALID_ARG] Path is empty.");
106         SysTryReturn(NID_APP, !aId.IsEmpty(), null, E_INVALID_ARG, "[E_INVALID_ARG] Provider Id is empty.");
107
108         String actualAppId = aId;
109         if (aId.StartsWith(TIZEN_ALIAS_APPID_PREFIX, 0))
110         {
111                 // little bit of performance tweak
112                 actualAppId = _AppControlRegistry::GetInstance()->GetAliasAppId(aId);
113         }
114
115         const bool isInstalled = _Aul::IsInstalled(actualAppId);
116         SysTryReturn(NID_APP, isInstalled, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] %ls not installed.", actualAppId.GetPointer());
117
118
119         AppControl* pAc = new (std::nothrow) AppControl;
120         SysTryReturn(NID_APP, pAc != null, null, E_OUT_OF_MEMORY, "AppControl allocation failure.");
121
122         _AppControlImpl* pImpl = pAc->__pAppControlImpl;
123         SysTryReturn(NID_APP, pImpl != null, null, E_OUT_OF_MEMORY, "AppControlImpl instance must not be null.");
124
125         pImpl->_path = path;
126         pImpl->_appId = aId;
127         pImpl->_opId = oId;
128         pImpl->_property = prop;
129
130         return pAc;
131 }
132
133
134 _IAppControlPluginProvider*
135 _AppControlImpl::GetAppControlPluginProvider(const String& path)
136 {
137         _LibraryImpl lib;
138         lib.Construct(path, _LIBRARY_OPTION);
139
140         APP_CONTROL_PROVIDER_GET_FN pProvider = reinterpret_cast<APP_CONTROL_PROVIDER_GET_FN>(lib.GetProcAddress(L"GetAppControlProviderPlugin"));
141
142         if (!pProvider)
143         {
144                 SysLogException(NID_APP, E_SYSTEM, "Cannot load plugin properly for %ls.", path.GetPointer());
145                 return null;
146         }
147
148         return (*pProvider)();
149 }
150
151
152 result
153 _AppControlImpl::FindAndStart(const String& operationId, const String* pUriPattern, const String* pDataType, const String* pCategory, const IMap* pExtraData, IAppControlResponseListener* pListener)
154 {
155         // [FIXME] valid argument size checking required
156         SysLog(NID_APP, "Enter");
157
158         std::unique_ptr<bundle, BundleDeleter> pBundle(bundle_create());
159         SysTryReturnResult(NID_APP, pBundle.get(), E_OUT_OF_MEMORY, "Bundle creation failure.");
160
161         _AppMessageImpl::SetOperation(pBundle.get(), operationId);
162
163         if (pUriPattern)
164         {
165                 _AppMessageImpl::SetUri(pBundle.get(), *pUriPattern);
166         }
167
168         if (pDataType)
169         {
170                 const String& mimeType = _AppControlManager::GetMimeTypeFromDataType(*pDataType);
171
172                 _AppMessageImpl::SetMime(pBundle.get(), mimeType);
173         }
174
175         if (pCategory)
176         {
177                 _AppMessageImpl::SetCategory(pBundle.get(), *pCategory);
178         }
179
180         return StartImplicit(pBundle.get(), pExtraData, pListener);
181 }
182
183
184 result
185 _AppControlImpl::StartImplicit(const _AppMessageImpl& msg, IEventListener* pListener, bool isLegacy)
186 {
187         SysLog(NID_APP, "Enter");
188         int req = APPCONTROL_REQUEST_ID_INVALID;
189
190         _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(ACTL_IMPLICIT_PLUGIN);
191         if (pProvider == null)
192         {
193                 SysPropagate(NID_APP, E_OBJ_NOT_FOUND);
194                 return E_OBJ_NOT_FOUND;
195         }
196
197         if (pListener)
198         {
199                 _InProcessInfo* pItem = new (std::nothrow) _InProcessInfo(isLegacy, pProvider, pListener);
200                 if (pItem)
201                 {
202                         req = _AppControlManager::GetInstance()->__inAppManager.InsertItem(pItem);
203                 }
204         }
205
206         result r = InvokeStartAppControl(pProvider, req, L"", msg);
207
208         if (pListener == null)
209         {
210                 pProvider->Release();
211         }
212
213         // after acquring request number, pLib should be managed from the list, not CATCH
214         if (IsFailed(r))
215         {
216                 _AppControlManager::GetInstance()->__inAppManager.RemoveItem(req);
217                 SysLog(NID_APP, "[%s] A system error has occurred.", GetErrorMessage(r));
218
219                 return r;
220         }
221
222         SysLog(NID_APP, "Exit %d", req);
223         return E_SUCCESS;
224 }
225
226
227 result
228 _AppControlImpl::StartImplicit(bundle* pBundle, const IList* pDataList, IAppControlEventListener* pListener)
229 {
230         _AppMessageImpl msg(pBundle);
231         msg.AddData(pDataList);
232
233         return StartImplicit(msg, pListener, true);
234 }
235
236
237 result
238 _AppControlImpl::StartImplicit(bundle* pBundle, const IMap* pData, IAppControlResponseListener* pListener)
239 {
240         _AppMessageImpl msg(pBundle);
241         _AppArg::AddStrMap(msg.GetBundle(), pData);
242
243         return StartImplicit(msg, pListener, false);
244 }
245
246
247 result
248 _AppControlImpl::Start(const IList* pDataList, IAppControlEventListener* pListener)
249 {
250         SysLog(NID_APP, "Enter");
251         _InProcessInfo* pInfo = _AppControlManager::GetInstance()->__inAppManager.FindItem(_reqId);
252         SysTryReturnResult(NID_APP, pInfo == null, E_IN_PROGRESS, "Request ID %d is already in progress.", _reqId);
253
254         int req = APPCONTROL_REQUEST_ID_INVALID;
255
256         _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(_path);
257         if (pProvider == null)
258         {
259                 SysPropagate(NID_APP, E_OBJ_NOT_FOUND);
260                 return E_OBJ_NOT_FOUND;
261         }
262
263         if (pListener)
264         {
265                 _InProcessInfo* pItem = new (std::nothrow) _InProcessInfo(_appId, _opId, _property, true, pProvider, pListener);
266                 if (pItem)
267                 {
268                         req = _AppControlManager::GetInstance()->__inAppManager.InsertItem(pItem);
269                 }
270         }
271
272         result r = InvokeStartAppControl(pProvider, req, _appId, _opId, pDataList);
273
274         if (pListener == null)
275         {
276                 pProvider->Release();
277         }
278
279         if (IsFailed(r))
280         {
281                 _AppControlManager::GetInstance()->__inAppManager.RemoveItem(req);
282                 SysLog(NID_APP, "[%s] A system error has occurred.", GetErrorMessage(r));
283
284                 return r;
285         }
286
287         _reqId = req;
288
289         SysLog(NID_APP, "Exit %d", req);
290         return E_SUCCESS;
291 }
292
293 result
294 _AppControlImpl::Start(const String* pUriData, const String* pMimeType, const IMap* pDataList, IAppControlResponseListener* pListener)
295 {
296         SysLog(NID_APP, "Enter");
297         _InProcessInfo* pInfo = _AppControlManager::GetInstance()->__inAppManager.FindItem(_reqId);
298         SysTryReturnResult(NID_APP, pInfo == null, E_IN_PROGRESS, "Request ID %d is already in progress.", _reqId);
299
300         int req = APPCONTROL_REQUEST_ID_INVALID;
301         result r = E_SUCCESS;
302
303         _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(_path);
304         if (pProvider == null)
305         {
306                 SysPropagate(NID_APP, E_OBJ_NOT_FOUND);
307                 return E_OBJ_NOT_FOUND;
308         }
309
310         if (pListener)
311         {
312                 _InProcessInfo* pItem = new (std::nothrow) _InProcessInfo(_appId, _opId, _property, false, pProvider, pListener);
313                 if (pItem)
314                 {
315                         req = _AppControlManager::GetInstance()->__inAppManager.InsertItem(pItem);
316                 }
317
318                 if (_ThreadImpl::GetCurrentThreadImpl()->GetThreadType() == THREAD_TYPE_EVENT_DRIVEN)
319                 {
320                         _AppControlResponseEvent* pAppControlResponseEvent = new (std::nothrow) _AppControlResponseEvent();
321
322                         if (pAppControlResponseEvent != null)
323                         {
324                                 r = pAppControlResponseEvent->Construct();
325                                 SysTryLog(NID_APP, r == E_SUCCESS, "[%s]_AppControlResponseEvent::Construct() is failed", GetErrorMessage(r));
326
327                                 r = pAppControlResponseEvent->AddListener(*this, true);
328                                 SysTryLog(NID_APP, r == E_SUCCESS, "[%s]_AppControlResponseEvent::AddListener() is failed", GetErrorMessage(r));
329
330                                 IMapT<int, _AppControlResponseEvent*>* pResponseEventContainer = _AppControlManager::GetInstance()->GetAppControlResponseEventContainer();
331                                 if (pResponseEventContainer != null)
332                                 {
333                                         int responseEventRequestId = RESPONSE_EVENT_REQID_MAGIC + req;
334                                         pResponseEventContainer->Add(responseEventRequestId, pAppControlResponseEvent);
335                                         __appControlResponseEventList.Add(responseEventRequestId);
336                                         SysLog(NID_APP, "pResponseEvent gets added. reqId(%d)", responseEventRequestId);
337                                 }
338                         }
339                 }
340         }
341         r = InvokeStartAppControl(pProvider, req, _appId, _opId, pUriData, pMimeType, pDataList);
342
343         if (pListener == null)
344         {
345                 pProvider->Release();
346         }
347
348         if (IsFailed(r))
349         {
350                 _AppControlManager::GetInstance()->__inAppManager.RemoveItem(req);
351                 SysLog(NID_APP, "[%s] A system error has occurred.", GetErrorMessage(r));
352
353                 return r;
354         }
355
356         _reqId = req;
357         SysLog(NID_APP, "Exit %d", req);
358
359         return E_SUCCESS;
360 }
361
362 result
363 _AppControlImpl::InvokeStartAppControl(_IAppControlPluginProvider* pProvider, int req, const String& appId, const String& oId, const IList* pList)
364 {
365         SysLog(NID_APP, "Legacy stuff for converting argument");
366
367         HashMap map(SingleObjectDeleter);
368         HashMap* pMap = null;
369         if (pList)
370         {
371                 map.Construct();
372
373                 _AppArg::FillMapFromList(&map, pList);
374
375                 pMap = &map;
376         }
377
378         return InvokeStartAppControl(pProvider, req, appId, oId, null, null, pMap);
379 }
380
381
382 result
383 _AppControlImpl::InvokeStartAppControl(_IAppControlPluginProvider* pProvider, int req, const String& appId, const String& oId, const String* pUri, const String* pMime, const IMap* pMap)
384 {
385         String data;
386
387         if (pMime)
388         {
389                 data = _AppControlManager::GetMimeTypeFromDataType(*pMime);
390         }
391
392         _AppMessageImpl msg(appId, oId, pUri, &data, pMap);
393
394         return InvokeStartAppControl(pProvider, req, appId, msg);
395 }
396
397
398 result
399 _AppControlImpl::InvokeStartAppControl(_IAppControlPluginProvider* pProvider, int req, const String& appId, const _AppMessageImpl& message)
400 {
401         SysTryReturnResult(NID_APP, pProvider != null, E_SYSTEM, "Wrong AppControl provider plugin for %ls(%d).", appId.GetPointer(), req);
402
403         return pProvider->StartAppControlPlugin(req, appId, message, null);
404 }
405
406
407 static bool
408 IsValidAppControl(const String& appcontrolID)
409 {
410         return ((appcontrolID == L"osp.appcontrol.provider.audio")
411                 || (appcontrolID == L"osp.appcontrol.provider.bluetooth")
412                 || (appcontrolID == L"osp.appcontrol.provider.calendar")
413                 || (appcontrolID == L"osp.appcontrol.provider.camera")
414                 || (appcontrolID == L"osp.appcontrol.provider.contact")
415                 || (appcontrolID == L"osp.appcontrol.provider.certificatemanager")
416                 || (appcontrolID == L"osp.appcontrol.provider.email")
417                 || (appcontrolID == L"osp.appcontrol.provider.image")
418                 || (appcontrolID == L"osp.appcontrol.provider.media")
419                 || (appcontrolID == L"osp.appcontrol.provider.message")
420                 || (appcontrolID == L"osp.appcontrol.provider.video")
421                 || (appcontrolID == L"osp.appcontrol.provider.imageeditor")
422                 || (appcontrolID == L"osp.appcontrol.provider.allshare")
423                 || (appcontrolID == L"tizen.filemanager")
424                 || (appcontrolID == L"tizen.camera")
425                 || (appcontrolID == L"tizen.gallery")
426                 || (appcontrolID == L"tizen.imageviewer")
427                 || (appcontrolID == L"tizen.videoplayer")
428                 || (appcontrolID == L"tizen.memo")
429                 || (appcontrolID == L"tizen.contacts")
430                 || (appcontrolID == L"tizen.calendar")
431                 || (appcontrolID == L"tizen.todo")
432                 || (appcontrolID == L"tizen.email")
433                 || (appcontrolID == L"tizen.settings")
434                 || (appcontrolID == L"tizen.messages")
435                 || (appcontrolID == L"tizen.musicplayer")
436                 || (appcontrolID == L"tizen.bluetooth")
437                 || (appcontrolID == L"samsung.snote")
438                 || (appcontrolID == L"0pnxz8hbsr.MyFiles")
439                 || (appcontrolID == L"hdufar9ycj.Camera")
440                 || (appcontrolID == L"ijudt7w61q.Gallery")
441                 || (appcontrolID == L"jysyv9o1dc.ImageViewer")
442                 || (appcontrolID == L"npwf0scb88.VideoPlayer")
443                 || (appcontrolID == L"zunqjlsnce.Memo")
444                 || (appcontrolID == L"f9uev8hsyo.Contacts")
445                 || (appcontrolID == L"ph1vq2phrp.Calendar")
446                 || (appcontrolID == L"vxqbrefica.Email")
447                 || (appcontrolID == L"kto5jikgul.Settings")
448                 || (appcontrolID == L"8r4r5ddzzn.Messages")
449                 || (appcontrolID == L"dhrul6qzj3.MusicPlayer")
450                 || (appcontrolID == L"smemo-efl"));
451 }
452
453 result
454 _AppControlImpl::Stop(void)
455 {
456         const String appcontrolID(GetAppControlProviderId());
457         SysTryReturnResult(NID_APP, IsValidAppControl(appcontrolID), E_INVALID_OPERATION, "Invalid appcontrolID(%ls)", appcontrolID.GetPointer());
458
459         result (*pStop)(int req) = null;
460
461         if (_reqId != APPCONTROL_REQUEST_ID_INVALID)
462         {
463                 _InProcessInfo* pInfo = _AppControlManager::GetInstance()->__inAppManager.FindItem(_reqId);
464                 SysTryReturnResult(NID_APP, pInfo != null, E_INVALID_OPERATION, "Request ID %d is not found.", _reqId);
465
466                 if (pInfo->pProvider)
467                 {
468                         pInfo->pProvider->StopAppControlPlugin(_reqId);
469                 }
470
471                 _AppControlManager::GetInstance()->__inAppManager.RemoveItem(_reqId);
472
473                 _reqId = APPCONTROL_REQUEST_ID_INVALID;
474         }
475         else
476         {
477                 _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(_path);
478                 if (pProvider)
479                 {
480                         pProvider->StopAppControlPlugin(-1);
481                         SysLog(NID_APP, "Request is stopped.");
482
483                         pProvider->Release();
484                 }
485         }
486
487         return E_SUCCESS;
488 }
489
490 String
491 _AppControlImpl::GetAppName(void) const
492 {
493         if (_appName.IsEmpty())
494         {
495                 AppId appId = GetAppId();
496                 AppId aliasAppId = _AppControlRegistry::GetInstance()->GetAliasAppId(appId);
497                 if (!aliasAppId.IsEmpty())
498                 {
499                         appId = aliasAppId;
500                 }
501
502                 std::unique_ptr<PackageAppInfo> pInfo(_PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId));
503                 if (pInfo.get())
504                 {
505                         SysLog(NID_APP, "PackageInfo of appId(%ls) exists", appId.GetPointer());
506                         const String& name = pInfo->GetAppName();
507                         if (name == String(SUBMODE_NAME))
508                         {
509                                 // workaround for special case: requery with actual appId
510                                 const PackageId& packageId = _PackageManagerImpl::GetPackageIdByAppId(appId);
511                                 const String& defaultName = _PackageManagerImpl::GetInstance()->GetDefaultAppExecutableName(packageId);
512
513                                 const String& convertedAppId = packageId + L'.' + defaultName;
514
515                                 std::unique_ptr<PackageAppInfo> pNewInfo(_PackageManagerImpl::GetInstance()->GetPackageAppInfoN(convertedAppId));
516
517                                 if (pNewInfo.get())
518                                 {
519                                         _appName = pNewInfo->GetAppDisplayName();
520                                 }
521                                 else
522                                 {
523                                         SysLog(NID_APP, "No default applicaiton information, possible database error.");
524                                 }
525                         }
526                         else
527                         {
528                                 _appName = pInfo->GetAppDisplayName();
529                         }
530                 }
531                 else
532                 {
533                         SysLog(NID_APP, "PackageInfo of appId(%ls) does not exist", appId.GetPointer());
534                 }
535         }
536
537         return _appName;
538 }
539
540
541 IList*
542 _AppControlImpl::GetCategoryListN(void) const
543 {
544         AppId appId = GetAppId();
545         SysTryReturn(NID_APP, !appId.IsEmpty(), null, E_SYSTEM, "[E_SYSTEM] Empty appId.");
546
547         AppId aliasAppId = _AppControlRegistry::GetInstance()->GetAliasAppId(appId);
548         if (!aliasAppId.IsEmpty())
549         {
550                 appId = aliasAppId;
551         }
552
553         SysLog(NID_APP, "Acquiring category for app %ls.", appId.GetPointer());
554
555         std::unique_ptr<PackageAppInfo> pAppInfo(_PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId));
556         SysTryReturn(NID_APP, pAppInfo.get() != null, null, E_SYSTEM, "[E_SYSTEM] Getting PackageAppInfo failed.");
557
558         return pAppInfo->GetAppCategoryListN();
559 }
560
561 void
562 _AppControlImpl::StopAppControlResponseListener(IAppControlResponseListener* pListener)
563 {
564         _AppControlManager::GetInstance()->StopAppControlResponseListener(pListener);
565 }
566
567 void
568 _AppControlImpl::OnAppControlResponseEventReceivedN(const Tizen::Base::Runtime::IEventArg* arg)
569 {
570         const _AppControlResponseEventArg* pEventArg = dynamic_cast<const _AppControlResponseEventArg*>(arg);
571
572         if (pEventArg != null)
573         {
574                 IAppControlResponseListener* pResponseListener = pEventArg->GetListener();
575
576                 if(pResponseListener != null)
577                 {
578                         if(pEventArg->GetType() == _APPCONTROL_RESPONSETYPE_COMPLETE)
579                         {
580                                 _AppControlManager::InvokeAppControlCompleteListener(*pResponseListener, pEventArg->GetAppId(), pEventArg->GetOperationId(), pEventArg->GetAppControlResult(), pEventArg->GetExtraData(), pEventArg->IsSubMode());
581
582                                 _AppControlResponseEvent* pResponseEvent = null;
583                                 _AppControlManager::GetInstance()->GetAppControlResponseEventContainer()->GetValue(pEventArg->GetRequestId(), pResponseEvent);
584                                 _AppControlManager::GetInstance()->GetAppControlResponseEventContainer()->Remove(pEventArg->GetRequestId());
585                                 delete pResponseEvent;
586                                 SysLog(NID_APP, "pResponseEvent gets deleted, reqId(%d)", pEventArg->GetRequestId());
587                         }
588                         else
589                         {
590                                 SysLog(NID_APP, "Unexpected AppControlResponseType(%d)", pEventArg->GetType());
591                         }
592                 }
593                 else
594                 {
595                         SysLog(NID_APP, "Invalid ResponseListener");
596                 }
597         }
598         else
599         {
600                 SysLog(NID_APP, "Invalid AppControl arguments : arg(0x%x)", &arg);
601         }
602
603 }
604 }}    //Tizen::App