fix prevent issue for AppControl
[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.IsEmpty()) ? TIZEN_OPERATION_MAIN : 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                 const _ThreadImpl* pThreadImpl = _ThreadImpl::GetCurrentThreadImpl();
319                 if (pThreadImpl && pThreadImpl->GetThreadType() == THREAD_TYPE_EVENT_DRIVEN)
320                 {
321                         _AppControlResponseEvent* pAppControlResponseEvent = new (std::nothrow) _AppControlResponseEvent();
322
323                         if (pAppControlResponseEvent != null)
324                         {
325                                 r = pAppControlResponseEvent->Construct();
326                                 SysTryLog(NID_APP, r == E_SUCCESS, "[%s]_AppControlResponseEvent::Construct() is failed", GetErrorMessage(r));
327
328                                 r = pAppControlResponseEvent->AddListener(*this, true);
329                                 SysTryLog(NID_APP, r == E_SUCCESS, "[%s]_AppControlResponseEvent::AddListener() is failed", GetErrorMessage(r));
330
331                                 IMapT<int, _AppControlResponseEvent*>* pResponseEventContainer = _AppControlManager::GetInstance()->GetAppControlResponseEventContainer();
332                                 if (pResponseEventContainer != null)
333                                 {
334                                         int responseEventRequestId = RESPONSE_EVENT_REQID_MAGIC + req;
335                                         pResponseEventContainer->Add(responseEventRequestId, pAppControlResponseEvent);
336                                         __appControlResponseEventList.Add(responseEventRequestId);
337                                         SysLog(NID_APP, "pResponseEvent gets added. reqId(%d)", responseEventRequestId);
338                                 }
339                         }
340                 }
341         }
342         r = InvokeStartAppControl(pProvider, req, _appId, _opId, pUriData, pMimeType, pDataList);
343
344         if (pListener == null)
345         {
346                 pProvider->Release();
347         }
348
349         if (IsFailed(r))
350         {
351                 _AppControlManager::GetInstance()->__inAppManager.RemoveItem(req);
352                 SysLog(NID_APP, "[%s] A system error has occurred.", GetErrorMessage(r));
353
354                 return r;
355         }
356
357         _reqId = req;
358         SysLog(NID_APP, "Exit %d", req);
359
360         return E_SUCCESS;
361 }
362
363 result
364 _AppControlImpl::InvokeStartAppControl(_IAppControlPluginProvider* pProvider, int req, const String& appId, const String& oId, const IList* pList)
365 {
366         SysLog(NID_APP, "Legacy stuff for converting argument");
367
368         HashMap map(SingleObjectDeleter);
369         HashMap* pMap = null;
370         if (pList)
371         {
372                 map.Construct();
373
374                 _AppArg::FillMapFromList(&map, pList);
375
376                 pMap = &map;
377         }
378
379         return InvokeStartAppControl(pProvider, req, appId, oId, null, null, pMap);
380 }
381
382
383 result
384 _AppControlImpl::InvokeStartAppControl(_IAppControlPluginProvider* pProvider, int req, const String& appId, const String& oId, const String* pUri, const String* pMime, const IMap* pMap)
385 {
386         String data;
387
388         if (pMime)
389         {
390                 data = _AppControlManager::GetMimeTypeFromDataType(*pMime);
391         }
392
393         _AppMessageImpl msg(appId, oId, pUri, &data, pMap);
394
395         return InvokeStartAppControl(pProvider, req, appId, msg);
396 }
397
398
399 result
400 _AppControlImpl::InvokeStartAppControl(_IAppControlPluginProvider* pProvider, int req, const String& appId, const _AppMessageImpl& message)
401 {
402         SysTryReturnResult(NID_APP, pProvider != null, E_SYSTEM, "Wrong AppControl provider plugin for %ls(%d).", appId.GetPointer(), req);
403
404         return pProvider->StartAppControlPlugin(req, appId, message, null);
405 }
406
407
408 static bool
409 IsValidAppControl(const String& appcontrolID)
410 {
411         return ((appcontrolID == L"osp.appcontrol.provider.audio")
412                 || (appcontrolID == L"osp.appcontrol.provider.bluetooth")
413                 || (appcontrolID == L"osp.appcontrol.provider.calendar")
414                 || (appcontrolID == L"osp.appcontrol.provider.camera")
415                 || (appcontrolID == L"osp.appcontrol.provider.contact")
416                 || (appcontrolID == L"osp.appcontrol.provider.certificatemanager")
417                 || (appcontrolID == L"osp.appcontrol.provider.email")
418                 || (appcontrolID == L"osp.appcontrol.provider.image")
419                 || (appcontrolID == L"osp.appcontrol.provider.media")
420                 || (appcontrolID == L"osp.appcontrol.provider.message")
421                 || (appcontrolID == L"osp.appcontrol.provider.video")
422                 || (appcontrolID == L"osp.appcontrol.provider.imageeditor")
423                 || (appcontrolID == L"osp.appcontrol.provider.allshare")
424                 || (appcontrolID == L"tizen.filemanager")
425                 || (appcontrolID == L"tizen.camera")
426                 || (appcontrolID == L"tizen.gallery")
427                 || (appcontrolID == L"tizen.imageviewer")
428                 || (appcontrolID == L"tizen.videoplayer")
429                 || (appcontrolID == L"tizen.memo")
430                 || (appcontrolID == L"tizen.contacts")
431                 || (appcontrolID == L"tizen.calendar")
432                 || (appcontrolID == L"tizen.todo")
433                 || (appcontrolID == L"tizen.email")
434                 || (appcontrolID == L"tizen.settings")
435                 || (appcontrolID == L"tizen.messages")
436                 || (appcontrolID == L"tizen.musicplayer")
437                 || (appcontrolID == L"tizen.bluetooth")
438                 || (appcontrolID == L"samsung.snote")
439                 || (appcontrolID == L"0pnxz8hbsr.MyFiles")
440                 || (appcontrolID == L"hdufar9ycj.Camera")
441                 || (appcontrolID == L"ijudt7w61q.Gallery")
442                 || (appcontrolID == L"jysyv9o1dc.ImageViewer")
443                 || (appcontrolID == L"npwf0scb88.VideoPlayer")
444                 || (appcontrolID == L"zunqjlsnce.Memo")
445                 || (appcontrolID == L"f9uev8hsyo.Contacts")
446                 || (appcontrolID == L"ph1vq2phrp.Calendar")
447                 || (appcontrolID == L"vxqbrefica.Email")
448                 || (appcontrolID == L"kto5jikgul.Settings")
449                 || (appcontrolID == L"8r4r5ddzzn.Messages")
450                 || (appcontrolID == L"dhrul6qzj3.MusicPlayer")
451                 || (appcontrolID == L"smemo-efl"));
452 }
453
454 result
455 _AppControlImpl::Stop(void)
456 {
457         const String appcontrolID(GetAppControlProviderId());
458         SysTryReturnResult(NID_APP, IsValidAppControl(appcontrolID), E_INVALID_OPERATION, "Invalid appcontrolID(%ls)", appcontrolID.GetPointer());
459
460         result (*pStop)(int req) = null;
461
462         if (_reqId != APPCONTROL_REQUEST_ID_INVALID)
463         {
464                 _InProcessInfo* pInfo = _AppControlManager::GetInstance()->__inAppManager.FindItem(_reqId);
465                 SysTryReturnResult(NID_APP, pInfo != null, E_INVALID_OPERATION, "Request ID %d is not found.", _reqId);
466
467                 if (pInfo->pProvider)
468                 {
469                         pInfo->pProvider->StopAppControlPlugin(_reqId);
470                 }
471
472                 _AppControlManager::GetInstance()->__inAppManager.RemoveItem(_reqId);
473
474                 _reqId = APPCONTROL_REQUEST_ID_INVALID;
475         }
476         else
477         {
478                 _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(_path);
479                 if (pProvider)
480                 {
481                         pProvider->StopAppControlPlugin(-1);
482                         SysLog(NID_APP, "Request is stopped.");
483
484                         pProvider->Release();
485                 }
486         }
487
488         return E_SUCCESS;
489 }
490
491 String
492 _AppControlImpl::GetAppName(void) const
493 {
494         if (_appName.IsEmpty())
495         {
496                 AppId appId = GetAppId();
497                 AppId aliasAppId = _AppControlRegistry::GetInstance()->GetAliasAppId(appId);
498                 if (!aliasAppId.IsEmpty())
499                 {
500                         appId = aliasAppId;
501                 }
502
503                 std::unique_ptr<PackageAppInfo> pInfo(_PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId));
504                 if (pInfo.get())
505                 {
506                         SysLog(NID_APP, "PackageInfo of appId(%ls) exists", appId.GetPointer());
507                         const String& name = pInfo->GetAppName();
508                         if (name == String(SUBMODE_NAME))
509                         {
510                                 // workaround for special case: requery with actual appId
511                                 const PackageId& packageId = _PackageManagerImpl::GetPackageIdByAppId(appId);
512                                 const String& defaultName = _PackageManagerImpl::GetInstance()->GetDefaultAppExecutableName(packageId);
513
514                                 const String& convertedAppId = packageId + L'.' + defaultName;
515
516                                 std::unique_ptr<PackageAppInfo> pNewInfo(_PackageManagerImpl::GetInstance()->GetPackageAppInfoN(convertedAppId));
517
518                                 if (pNewInfo.get())
519                                 {
520                                         _appName = pNewInfo->GetAppDisplayName();
521                                 }
522                                 else
523                                 {
524                                         SysLog(NID_APP, "No default applicaiton information, possible database error.");
525                                 }
526                         }
527                         else
528                         {
529                                 _appName = pInfo->GetAppDisplayName();
530                         }
531                 }
532                 else
533                 {
534                         SysLog(NID_APP, "PackageInfo of appId(%ls) does not exist", appId.GetPointer());
535                 }
536         }
537
538         return _appName;
539 }
540
541
542 IList*
543 _AppControlImpl::GetCategoryListN(void) const
544 {
545         AppId appId = GetAppId();
546         SysTryReturn(NID_APP, !appId.IsEmpty(), null, E_SYSTEM, "[E_SYSTEM] Empty appId.");
547
548         AppId aliasAppId = _AppControlRegistry::GetInstance()->GetAliasAppId(appId);
549         if (!aliasAppId.IsEmpty())
550         {
551                 appId = aliasAppId;
552         }
553
554         SysLog(NID_APP, "Acquiring category for app %ls.", appId.GetPointer());
555
556         std::unique_ptr<PackageAppInfo> pAppInfo(_PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId));
557         SysTryReturn(NID_APP, pAppInfo.get() != null, null, E_SYSTEM, "[E_SYSTEM] Getting PackageAppInfo failed.");
558
559         return pAppInfo->GetAppCategoryListN();
560 }
561
562 void
563 _AppControlImpl::StopAppControlResponseListener(IAppControlResponseListener* pListener)
564 {
565         _AppControlManager::GetInstance()->StopAppControlResponseListener(pListener);
566 }
567
568 void
569 _AppControlImpl::OnAppControlResponseEventReceivedN(const Tizen::Base::Runtime::IEventArg* arg)
570 {
571         const _AppControlResponseEventArg* pEventArg = dynamic_cast<const _AppControlResponseEventArg*>(arg);
572
573         if (pEventArg != null)
574         {
575                 IAppControlResponseListener* pResponseListener = pEventArg->GetListener();
576
577                 if(pResponseListener != null)
578                 {
579                         if(pEventArg->GetType() == _APPCONTROL_RESPONSETYPE_COMPLETE)
580                         {
581                                 _AppControlManager::InvokeAppControlCompleteListener(*pResponseListener, pEventArg->GetAppId(), pEventArg->GetOperationId(), pEventArg->GetAppControlResult(), pEventArg->GetExtraData(), pEventArg->IsSubMode());
582
583                                 _AppControlResponseEvent* pResponseEvent = null;
584                                 _AppControlManager::GetInstance()->GetAppControlResponseEventContainer()->GetValue(pEventArg->GetRequestId(), pResponseEvent);
585                                 _AppControlManager::GetInstance()->GetAppControlResponseEventContainer()->Remove(pEventArg->GetRequestId());
586                                 delete pResponseEvent;
587                                 SysLog(NID_APP, "pResponseEvent gets deleted, reqId(%d)", pEventArg->GetRequestId());
588                         }
589                         else
590                         {
591                                 SysLog(NID_APP, "Unexpected AppControlResponseType(%d)", pEventArg->GetType());
592                         }
593                 }
594                 else
595                 {
596                         SysLog(NID_APP, "Invalid ResponseListener");
597                 }
598         }
599         else
600         {
601                 SysLog(NID_APP, "Invalid AppControl arguments : arg(0x%x)", &arg);
602         }
603
604 }
605 }}    //Tizen::App