34a4ef27cb61de42b93c04889729c2310c94980c
[platform/framework/native/installer.git] / src / XmlHandler / ManifestHandler.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        ManifestHandler.cpp
19  * @brief       This is the implementation file for %ManifestHandler class.
20  */
21
22 #include <system_info.h>
23
24 #include <FIoFile.h>
25 #include <FBase_StringConverter.h>
26
27 #include "ManifestHandler.h"
28 #include "PrivilegeHandler.h"
29 #include "InstallerUtil.h"
30 #include "ManifestLiveboxesParser.h"
31 #include "ManifestAccountsParser.h"
32 #include "ManifestAppControlsParser.h"
33
34 using namespace Tizen::Base;
35 using namespace Tizen::Base::Collection;
36 using namespace Tizen::Base::Utility;
37 using namespace Tizen::App;
38 using namespace Tizen::Io;
39
40 ManifestHandler::ManifestHandler(void)
41 :__pContext(null)
42 ,__pPrivilegeList(null)
43 ,__pContentDataList(null)
44 ,__pAppControlInfoImpl(null)
45 ,__pAppControlCapabilityInfoImpl(null)
46 ,__pAppControlResolutionInfoImpl(null)
47 ,__pDataControlInfo(null)
48 ,__pDataControlType(null)
49 ,__pContentData(null)
50 ,__pDefaultIconType(null)
51 ,__isDefaultMainmenu(false)
52 ,__isDefaultSetting(false)
53 ,__isDefaultTicker(false)
54 ,__isDefaultQuickpanel(false)
55 ,__isDefaultLaunchImage(false)
56 ,__isDefaultName(false)
57 ,__isDefaultAppDetected(false)
58 ,__isInternalStorage(false)
59 ,__pAppData(null)
60 ,__isParserMode(false)
61 ,__pParser(null)
62 {
63 }
64
65 ManifestHandler::~ManifestHandler(void)
66 {
67         delete[] __pDefaultIconType;
68         __pDefaultIconType = null;
69 }
70
71 bool
72 ManifestHandler::Construct(InstallationContext* pContext)
73 {
74         __pContext = pContext;
75
76         return true;
77 }
78
79 InstallationContext*
80 ManifestHandler::GetContext(void)
81 {
82         return __pContext;
83 }
84
85 bool
86 ManifestHandler::Parse(const char *pFilepath)
87 {
88         return ParseDocument(pFilepath);
89 }
90
91 bool
92 ManifestHandler::OnStartElement(const char *pName)
93 {
94         TryReturn(pName, true, "pName is null.");
95
96         bool status = true;
97
98         if (__isParserMode == true)
99         {
100                 TryReturn(__pParser, false, "__pParser is null");
101                 return __pParser->OnStartElement(pName);
102         }
103
104         if (strcasecmp(pName, "Manifest") == 0)
105         {
106                 AppLog("------------------------------------------");
107                 AppLog("manifest.xml");
108                 AppLog("------------------------------------------");
109                 AppLog("<%s>", pName);
110         }
111         else if (strcasecmp(pName, "Apps") == 0)
112         {
113                 AppLog("<%s>", pName);
114         }
115         else if (strcasecmp(pName, "UiApp") == 0)
116         {
117                 status = OnUiAppStartElement();
118         }
119         else if (strcasecmp(pName, "ServiceApp") == 0)
120         {
121                 status = OnServiceAppStartElement();
122         }
123         else if (strcasecmp(pName, "DataControl") == 0)
124         {
125                 status = OnDataControlStartElement();
126         }
127         else if (strcasecmp(pName, "Privileges") == 0)
128         {
129                 status = OnPrivilegesStartElement();
130         }
131         else if (strcasecmp(pName, "UiScalability") == 0)
132         {
133                 status = OnUiScalabilityStartElement();
134         }
135         else if (strcasecmp(pName, "UiTheme") == 0)
136         {
137                 status = OnUiThemeStartElement();
138         }
139         else if (strcasecmp(pName, "Icons") == 0)
140         {
141                 status = OnIconsStartElement();
142         }
143         else if (strcasecmp(pName, "Contents") == 0)
144         {
145                 status = OnContentsStartElement();
146         }
147         else if (strcasecmp(pName, "Content") == 0)
148         {
149                 status = OnContentStartElement();
150         }
151         else if (strcasecmp(pName, "Metadata") == 0)
152         {
153                 status = OnMetadataStartElement();
154         }
155         else if ((strcasecmp(pName, "Liveboxes") == 0) || strcasecmp(pName, "AppWidgets") == 0)
156         {
157                 status = OnLiveboxesStartElement(pName);
158         }
159         else if (strcasecmp(pName, "Accounts") == 0)
160         {
161                 status = OnAccountsStartElement(pName);
162         }
163         else if (strcasecmp(pName, "AppControls") == 0)
164         {
165                 status = OnAppControlsStartElement(pName);
166         }
167         else if (strcasecmp(pName, "Permission") == 0)
168         {
169                 status = OnPermissionStartElement(pName);
170         }
171         else if (strcasecmp(pName, "DirectoryConfig") == 0)
172         {
173                 status = OnDirectoryConfigStartElement();
174         }
175         else if (strcasecmp(pName, "SymbolicLink") == 0)
176         {
177                 status = OnSymbolicLinkStartElement();
178         }
179
180         if (!status)
181         {
182                 __isParserMode = false;
183                 return false;
184         }
185
186         return true;
187 }
188
189 bool
190 ManifestHandler::OnEndElement(const char *pName)
191 {
192         TryReturn(pName, true, "pName is null.");
193
194         bool status = true;
195
196         if (__isParserMode == true)
197         {
198                 TryReturn(__pParser, false, "__pParser is null");
199                 __pParser->OnEndElement(pName);
200
201                 if ((strcasecmp(pName, "Liveboxes") == 0) || strcasecmp(pName, "AppWidgets") == 0)
202                 {
203                         status = OnLiveboxesEndElement();
204                 }
205                 else if (strcasecmp(pName, "Accounts") == 0)
206                 {
207                         status = OnAccountsEndElement();
208                 }
209                 else if (strcasecmp(pName, "AppControls") == 0)
210                 {
211                         status = OnAppControlsEndElement();
212                 }
213
214                 return status;
215         }
216
217         if (strcasecmp(pName, "Privileges") == 0)
218         {
219                 status = OnPrivilegesEndElement();
220         }
221         else if (strcasecmp(pName, "UiApp") == 0)
222         {
223                 status = OnUiAppEndElement();
224         }
225         else if (strcasecmp(pName, "ServiceApp") == 0)
226         {
227                 status = OnServiceAppEndElement();
228         }
229         else if (strcasecmp(pName, "DataControl") == 0)
230         {
231                 status = OnDataControlEndElement();
232         }
233         else if (strcasecmp(pName, "DataControlType") == 0)
234         {
235                 status = OnDataControlTypeEndElement();
236         }
237         else if (strcasecmp(pName, "Apps") == 0)
238         {
239                 status = OnAppsEndElement();
240         }
241         else if (strcasecmp(pName, "UiScalability") == 0)
242         {
243                 AppLog("</%s>", pName);
244         }
245         else if (strcasecmp(pName, "Icons") == 0)
246         {
247                 status = OnIconsEndElement();
248         }
249         else if (strcasecmp(pName, "Contents") == 0)
250         {
251                 status = OnContentsEndElement();
252         }
253         else if (strcasecmp(pName, "Content") == 0)
254         {
255                 status = OnContentEndElement();
256         }
257         else if (strcasecmp(pName, "Metadata") == 0)
258         {
259                 status = OnMetadataEndElement();
260         }
261         else if (strcasecmp(pName, "Manifest") == 0)
262         {
263                 status = OnManifestEndElement();
264         }
265
266         if (!status)
267         {
268                 return false;
269         }
270
271         return true;
272 }
273
274 bool
275 ManifestHandler::OnCharacters(const char *pCharacters)
276 {
277         bool status = true;
278
279         char* pName = GetElementName();
280         TryReturn(pName, true, "pName is null.");
281
282         if (__isParserMode == true)
283         {
284                 TryReturn(__pParser, false, "__pParser is null");
285                 return __pParser->OnCharacters(pCharacters);
286         }
287
288         if (strcasecmp(pName, "Id") == 0)
289         {
290                 status = OnIdValue(pCharacters);
291         }
292         else if (strcasecmp(pName, "Version") == 0)
293         {
294                 status = OnVersionValue(pCharacters);
295         }
296         else if (strcasecmp(pName, "Type") == 0)
297         {
298                 status = OnTypeValue(pCharacters);
299         }
300         else if (strcasecmp(pName, "Url") == 0)
301         {
302                 status = OnUrlValue(pCharacters);
303         }
304         else if (strcasecmp(pName, "ApiVersion") == 0)
305         {
306                 status = OnApiVersionValue(pCharacters);
307         }
308         else if (strcasecmp(pName, "Privilege") == 0)
309         {
310                 status = OnPrivilegeValue(pCharacters);
311         }
312         else if (strcasecmp(pName, "Name") == 0)
313         {
314                 status = OnNameValue(pCharacters);
315         }
316         else if (strcasecmp(pName, "DisplayName") == 0)
317         {
318                 status = OnNameValue(pCharacters);
319         }
320         else if (strcasecmp(pName, "Author") == 0)
321         {
322                 status = OnAuthorValue(pCharacters);
323         }
324         else if (strcasecmp(pName, "Description") == 0)
325         {
326                 status = OnDescriptionValue(pCharacters);
327         }
328         else if (strcasecmp(pName, "Icon") == 0)
329         {
330                 status = OnIconValue(pCharacters);
331         }
332         else if (strcasecmp(pName, "DataControlType") == 0)
333         {
334                 status = OnDataControlTypeValue(pCharacters);
335         }
336         else if (strcasecmp(pName, "Condition") == 0)
337         {
338                 status = OnConditionValue(pCharacters);
339         }
340         else if (strcasecmp(pName, "Notification") == 0)
341         {
342                 status = OnNotificationValue(pCharacters);
343         }
344         else if (strcasecmp(pName, "InstallLocation") == 0)
345         {
346                 status = OnInstallLocationValue(pCharacters);
347         }
348         else if (strcasecmp(pName, "Category") == 0)
349         {
350                 status = OnCategoryValue(pCharacters);
351         }
352         else if (strcasecmp(pName, "Metadata") == 0)
353         {
354                 status = OnMetadataValue(pCharacters);
355         }
356
357         if (!status)
358         {
359                 return false;
360         }
361
362         return true;
363 }
364
365 bool
366 ManifestHandler::OnPrivilegesStartElement(void)
367 {
368         __pPrivilegeList = new (std::nothrow) ArrayList;
369         TryReturn(__pPrivilegeList, false, "__pPrivilegeList is null");
370
371         AppLog("<Privileges>");
372
373         return true;
374 }
375
376 bool
377 ManifestHandler::OnUiAppStartElement(void)
378 {
379         __pAppData = new (std::nothrow) AppData;
380         TryReturn(__pAppData, false, "__pAppData is null");
381
382         InstallerError error = __pAppData->Construct();
383         TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed.");
384
385         AppLog("<UiApp>");
386
387         XmlAttribute *pAttr = GetAttribute();
388         TryReturn(pAttr, true, "pAttr is null");
389
390         ParseAppAttribute(pAttr, true);
391
392         return true;
393 }
394
395 bool
396 ManifestHandler::OnServiceAppStartElement(void)
397 {
398         __pAppData = new (std::nothrow) AppData;
399         TryReturn(__pAppData, false, "__pAppData is null");
400
401         InstallerError error = __pAppData->Construct();
402         TryReturn(error == INSTALLER_ERROR_NONE, false, "pAppData->Construct() failed.");
403
404         AppLog("<ServiceApp>");
405
406         XmlAttribute *pAttr = GetAttribute();
407         TryReturn(pAttr, true, "pAttr is null");
408
409         ParseAppAttribute(pAttr, false);
410
411         return true;
412 }
413
414 bool
415 ManifestHandler::OnIconsStartElement(void)
416 {
417         int res = 0;
418         int width = 0;
419         String defaultIconType;
420
421         AppLog("<Icons>");
422
423         res = system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_WIDTH, &width);
424         if (res != SYSTEM_INFO_ERROR_NONE)
425         {
426                 AppLog("system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_WIDTH) failed. res = [%d]", res);
427                 defaultIconType = L"Xhigh";
428         }
429         else
430         {
431                 if (width == 480)
432                 {
433                         defaultIconType = L"High";
434                 }
435                 else
436                 {
437                         defaultIconType = L"Xhigh";
438                 }
439         }
440
441         AppLog("ScreenWidth = [%d]", width);
442
443         __pDefaultIconType = _StringConverter::CopyToCharArrayN(defaultIconType);
444         TryReturn(__pDefaultIconType, false, "__pDefaultIconType is null.");
445
446         AppLog("DefaultIconType = [%s]", __pDefaultIconType);
447
448         return true;
449 }
450
451 bool
452 ManifestHandler::OnUiScalabilityStartElement(void)
453 {
454         XmlAttribute *pAttr = null;
455         char* pCoordinateSystem = null;
456         char* pBaseScreenSize = null;
457         char* pLogicalCoordinate = null;
458
459         AppLog("<UiScalability>");
460
461         pAttr = GetAttribute();
462         TryReturn(pAttr, true, "pAttr is null");
463
464         pCoordinateSystem = pAttr->Find("CoordinateSystem");
465         if (pCoordinateSystem)
466         {
467                 String* pKey = new (std::nothrow) String("CoordinateSystem");
468                 TryReturn(pKey, false, "pKey is null");
469                 String* pValue = new (std::nothrow) String(pCoordinateSystem);
470                 TryReturn(pValue, false, "pValue is null");
471
472                 __pAppData->__pFeatureList->Add(pKey, pValue);
473                 AppLog("<CoordinateSystem=%s>", pCoordinateSystem);
474         }
475
476         pBaseScreenSize = pAttr->Find("BaseScreenSize");
477         if (pBaseScreenSize)
478         {
479                 String* pKey = new (std::nothrow) String("BaseScreenSize");
480                 TryReturn(pKey, false, "pKey is null");
481                 String* pValue = new (std::nothrow) String(pBaseScreenSize);
482                 TryReturn(pValue, false, "pValue is null");
483
484                 __pAppData->__pFeatureList->Add(pKey, pValue);
485                 AppLog("<BaseScreenSize=%s>", pBaseScreenSize);
486         }
487
488         pLogicalCoordinate = pAttr->Find("LogicalCoordinate");
489         if (pLogicalCoordinate)
490         {
491                 String* pKey = new (std::nothrow) String("LogicalCoordinate");
492                 TryReturn(pKey, false, "pKey is null");
493                 String* pValue = new (std::nothrow) String(pLogicalCoordinate);
494                 TryReturn(pValue, false, "pValue is null");
495
496                 __pAppData->__pFeatureList->Add(pKey, pValue);
497                 AppLog("<LogicalCoordinate=%s>", pLogicalCoordinate);
498         }
499
500         return true;
501 }
502
503 bool
504 ManifestHandler::OnUiThemeStartElement(void)
505 {
506         XmlAttribute *pAttr = null;
507         char *pSystemTheme = null;
508         char *pUserDefinedTheme = null;
509
510         AppLog("<UiTheme>");
511
512         pAttr = GetAttribute();
513         TryReturn(pAttr, true, "pAttr is null");
514
515         pSystemTheme = pAttr->Find("SystemTheme");
516         if (pSystemTheme)
517         {
518                 String* pKey = new (std::nothrow) String("SystemTheme");
519                 TryReturn(pKey, false, "pKey is null");
520                 String* pValue = new (std::nothrow) String(pSystemTheme);
521                 TryReturn(pValue, false, "pValue is null");
522
523                 __pAppData->__pFeatureList->Add(pKey, pValue);
524                 AppLog("<SystemTheme=%s>", pSystemTheme);
525         }
526
527         pUserDefinedTheme = pAttr->Find("UserDefinedTheme");
528         if (pUserDefinedTheme)
529         {
530                 String* pKey = new (std::nothrow) String("UserDefinedTheme");
531                 TryReturn(pKey, false, "pKey is null");
532                 String* pValue = new (std::nothrow) String(pUserDefinedTheme);
533                 TryReturn(pValue, false, "pValue is null");
534
535                 __pAppData->__pFeatureList->Add(pKey, pValue);
536                 AppLog("<UserDefinedTheme=%s>", pUserDefinedTheme);
537         }
538
539         return true;
540 }
541
542 bool
543 ManifestHandler::OnDataControlStartElement(void)
544 {
545         XmlAttribute* pAttr = null;
546         char* pProviderId = null;
547
548         pAttr = GetAttribute();
549         TryReturn(pAttr, true, "pAttr is null");
550
551         pProviderId = pAttr->Find("ProviderId");
552         TryReturn(pProviderId, true, "pProviderId is null");
553
554         __pDataControlInfo = new (std::nothrow) DataControlInfo;
555         TryReturn(__pDataControlInfo, false, "__pDataControlInfo is null");
556
557         __pDataControlInfo->__providerId = pProviderId;
558
559         AppLog("<DataControl Provider=\"%s\">", pProviderId);
560
561         return true;
562 }
563
564 bool
565 ManifestHandler::OnContentsStartElement(void)
566 {
567         __pContentDataList = new (std::nothrow) ArrayList;
568         TryReturn(__pContentDataList, false, "__pContentDataList is null");
569
570         AppLog("<Contents>");
571
572         return true;
573 }
574
575 bool
576 ManifestHandler::OnContentStartElement(void)
577 {
578         TryReturn(__pContentData == null, false, "__pContentData is not null");
579
580         XmlAttribute *pAttr = null;
581         char *pDefault = null;
582
583         __pContentData = new (std::nothrow) ContentData;
584         TryReturn(__pContentData, false, "__pContentData is null");
585
586         pAttr = GetAttribute();
587         TryReturn(pAttr, true, "pAttr is null");
588
589         char* pId = pAttr->Find("Id");
590         if (pId)
591         {
592                 __pContentData->SetContentId(pId);
593         }
594
595         char* pEntryName = pAttr->Find("EntryName");
596         if (pEntryName)
597         {
598                 __pContentData->SetContentId(pEntryName);
599         }
600
601         pDefault = pAttr->Find("Default");
602         if (pDefault)
603         {
604                 if (strcasecmp(pDefault, "True") == 0)
605                 {
606                         __isDefaultAppDetected = true;
607                 }
608         }
609
610         AppLog("<Content=\"%s\" EntryName=\"%s\">", pId, pEntryName);
611
612         return true;
613 }
614
615 bool
616 ManifestHandler::OnMetadataStartElement()
617 {
618         AppLog("<Metadata>");
619         __metadataKey.Clear();
620
621         XmlAttribute* pAttr = GetAttribute();
622         TryReturn(pAttr, true, "pAttr is null");
623
624         char* pKey = pAttr->Find("Key");
625         if (pKey)
626         {
627                 __metadataKey = pKey;
628         }
629
630         return true;
631 }
632
633 bool
634 ManifestHandler::OnDirectoryConfigStartElement()
635 {
636         XmlAttribute* pAttr = GetAttribute();
637         TryReturn(pAttr, true, "pAttr is null.");
638
639         char* pVirtualRoot = pAttr->Find("VirtualRoot");
640         TryReturn(pVirtualRoot, false, "pVirtualRoot is null.");
641
642         if (strcasecmp(pVirtualRoot, "true") == 0)
643         {
644                 __pContext->__isVirtualRoot = true;
645         }
646
647         AppLog("<DirectoryConfig VirtualRoot=\"%s\">", pVirtualRoot);
648
649         return true;
650 }
651
652 bool
653 ManifestHandler::OnSymbolicLinkStartElement()
654 {
655         XmlAttribute* pAttr = GetAttribute();
656         TryReturn(pAttr, true, "pAttr is null.");
657
658         char* pSource = pAttr->Find("Source");
659         TryReturn(pSource, false, "pSource is null.");
660
661         char* pDestination = pAttr->Find("Destination");
662         TryReturn(pDestination, false, "pDestination is null.");
663
664         __pContext->__pSymbolicLinkList->Add(new (std::nothrow) String(pSource), new (std::nothrow) String(pDestination));
665
666         AppLog("<SymbolicLink Source=\"%s\", Destination=\"%s\">", pSource, pDestination);
667
668         return true;
669 }
670
671 bool
672 ManifestHandler::OnLiveboxesStartElement(const char *pName)
673 {
674         __pParser = new (std::nothrow) ManifestLiveboxesParser;
675         TryReturn(__pParser, false, "__pParser is null");
676
677         __isParserMode = true;
678         AppLog("------------------------------------------");
679         __pParser->Construct(this);
680
681         return __pParser->OnStartElement(pName);
682 }
683
684 bool
685 ManifestHandler::OnAccountsStartElement(const char *pName)
686 {
687         __pParser = new (std::nothrow) ManifestAccountsParser;
688         TryReturn(__pParser, false, "__pParser is null");
689
690         __isParserMode = true;
691         AppLog("------------------------------------------");
692         __pParser->Construct(this);
693
694         return __pParser->OnStartElement(pName);
695 }
696
697 bool
698 ManifestHandler::OnAppControlsStartElement(const char *pName)
699 {
700         __pParser = new (std::nothrow) ManifestAppControlsParser;
701         TryReturn(__pParser, false, "__pParser is null");
702
703         __isParserMode = true;
704         AppLog("------------------------------------------");
705         __pParser->Construct(this);
706
707         return __pParser->OnStartElement(pName);
708 }
709
710 bool
711 ManifestHandler::OnPermissionStartElement(const char* pName)
712 {
713         XmlAttribute* pAttr = null;
714         char* pType = null;
715
716         pAttr = GetAttribute();
717         TryReturn(pAttr, true, "pAttr is null.");
718
719         pType = pAttr->Find("Type");
720         TryReturn(pType, true, "pType is null.");
721
722         if (__pAppData->__permissionType.IsEmpty() == true)
723         {
724                 __pAppData->__permissionType = pType;
725         }
726         else
727         {
728                 String type = pType;
729                 if (__pAppData->__permissionType.Equals(type, true) == false)
730                 {
731                         AppLog("Invalid Permission Type [%ls][%ls]", __pAppData->__permissionType.GetPointer(), type.GetPointer());
732                         return false;
733                 }
734         }
735
736         AppLog("<Permission Type=\"%s\">", pType);
737
738         return true;
739 }
740
741 bool
742 ManifestHandler::OnPrivilegesEndElement(void)
743 {
744         if (__pContext->__isVerificationMode == false)
745         {
746                 AppLog("no signature file[%ls]", __pContext->GetSignatureXmlPath().GetPointer());
747
748                 result r = E_SUCCESS;
749                 String privileges;
750                 String hmacPrivileges;
751                 ArrayList stringPrivilegeList;
752                 stringPrivilegeList.Construct(125);
753                 PackageId packageId = __pContext->__packageId;
754
755                 if (__pPrivilegeList != null)
756                 {
757                         r = PrivilegeHandler::GenerateCipherPrivilege(packageId, *__pPrivilegeList, privileges, hmacPrivileges, stringPrivilegeList);
758                         TryReturn(!IsFailed(r), false, "privMgr.GeneratePrivilegeString() failed");
759                 }
760
761                 __pContext->__privileges = privileges;
762                 __pContext->__hmacPrivileges = hmacPrivileges;
763                 __pContext->__pStringPrivilegeList = new ArrayList;
764                 __pContext->__pStringPrivilegeList->Construct(stringPrivilegeList);
765         }
766
767         __pContext->SetPrivilegeList(__pPrivilegeList);
768
769         AppLog("</Privileges>");
770
771         return true;
772 }
773
774 bool
775 ManifestHandler::OnUiAppEndElement(void)
776 {
777         if (__pAppData->__isSubMode == true)
778         {
779                 __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
780                 __pAppData->__pAppControlDataList = null;
781                 __pAppData->__subModeAppName = __pAppData->__name;
782         }
783
784         __isDefaultName = false;
785
786         __pContext->__pAppDataList->Add(__pAppData);
787         __pAppData = null;
788
789         AppLog("</UiApp>");
790
791         return true;
792 }
793
794 bool
795 ManifestHandler::OnServiceAppEndElement(void)
796 {
797         if (__pAppData->__isSubMode == true)
798         {
799                 __pAppData->__pSubModeAppControlDataList = __pAppData->__pAppControlDataList;
800                 __pAppData->__pAppControlDataList = null;
801                 __pAppData->__subModeAppName = __pAppData->__name;
802         }
803
804         __isDefaultName = false;
805
806         __pContext->__pAppDataList->Add(__pAppData);
807         __pAppData = null;
808
809         AppLog("</ServiceApp>");
810
811         AppLog("INSTALLATION_STORAGE = [INTERNAL]");
812         __isInternalStorage = true;
813
814         return true;
815 }
816
817 bool
818 ManifestHandler::OnAppsEndElement(void)
819 {
820         AppLog("</Apps>");
821
822         if (__isInternalStorage == true)
823         {
824                 AppLog("INSTALLATION_STORAGE = [INTERNAL]");
825                 __pContext->__storage = INSTALLATION_STORAGE_INTERNAL;
826         }
827         else
828         {
829                 if (InstallerUtil::IsDefaultExternalStorage() == true)
830                 {
831                         AppLog("INSTALLATION_STORAGE = [EXTERNAL]");
832                         __pContext->__storage = INSTALLATION_STORAGE_EXTERNAL;
833                 }
834         }
835
836         return true;
837 }
838
839 bool
840 ManifestHandler::OnIconsEndElement(void)
841 {
842         AppLog("</Icons>");
843
844         return true;
845 }
846
847 bool
848 ManifestHandler::OnDataControlEndElement(void)
849 {
850         __pAppData->__pDataControlList->Add(__pDataControlInfo);
851         __pDataControlInfo = null;
852         AppLog("</DataControl>");
853
854         return true;
855 }
856
857 bool
858 ManifestHandler::OnDataControlTypeEndElement(void)
859 {
860         __pDataControlInfo->__pControlTypeList->Add(__pDataControlType);
861         __pDataControlType = null;
862         AppLog("</DataControlType>");
863
864         return true;
865 }
866
867 bool
868 ManifestHandler::OnContentsEndElement(void)
869 {
870         __pContext->SetContentDataList(__pContentDataList);
871         __pContentDataList = null;
872         AppLog("</Contents>");
873
874         return true;
875 }
876
877 bool
878 ManifestHandler::OnContentEndElement(void)
879 {
880         __pContentDataList->Add(*__pContentData);
881         __pContentData = null;
882         AppLog("</Content>");
883
884         return true;
885 }
886
887 bool
888 ManifestHandler::OnMetadataEndElement(void)
889 {
890         AppLog("</Metadata>");
891
892         if (__metadataKey.IsEmpty() == false)
893         {
894                 __pAppData->__pMetadataMap->Add(*(new (std::nothrow) String(__metadataKey)), *(new (std::nothrow) String(L"")));
895                 __metadataKey.Clear();
896         }
897
898         return true;
899 }
900
901 bool
902 ManifestHandler::OnLiveboxesEndElement(void)
903 {
904         delete __pParser;
905         __isParserMode = false;
906         AppLog("------------------------------------------");
907
908         return true;
909 }
910
911 bool
912 ManifestHandler::OnAccountsEndElement(void)
913 {
914         delete __pParser;
915         __isParserMode = false;
916         AppLog("------------------------------------------");
917
918         return true;
919 }
920
921 bool
922 ManifestHandler::OnAppControlsEndElement(void)
923 {
924         delete __pParser;
925         __isParserMode = false;
926         AppLog("------------------------------------------");
927
928         return true;
929 }
930
931 bool
932 ManifestHandler::OnManifestEndElement(void)
933 {
934         TryReturn(__isDefaultAppDetected, false, "[osp-installer][Error] Main tag is not detected...");
935         AppLog("</Manifest>");
936
937         return true;
938 }
939
940 bool
941 ManifestHandler::OnIdValue(const char* pCharacters)
942 {
943         AppLog("<Package>%s</Package>", pCharacters);
944
945         if (__pContext->__packageId.IsEmpty() == true)
946         {
947                 __pContext->__packageId = pCharacters;
948         }
949         else
950         {
951                 String id(pCharacters);
952                 if (__pContext->__packageId != id)
953                 {
954                         AppLog("input package = [%ls], manifest = [%s] is different.", __pContext->__packageId.GetPointer(), pCharacters);
955                         return false;
956                 }
957                 else
958                 {
959                         AppLog("input package = [%ls], manifest = [%s] is the same.", __pContext->__packageId.GetPointer(), pCharacters);
960                 }
961         }
962
963         return true;
964 }
965
966 bool
967 ManifestHandler::OnVersionValue(const char* pCharacters)
968 {
969         AppLog("<Version>%s</Version>", pCharacters);
970         __pContext->__version = pCharacters;
971
972         return true;
973 }
974
975 bool
976 ManifestHandler::OnTypeValue(const char* pCharacters)
977 {
978         AppLog("<Type>%s</Type>", pCharacters);
979
980         if (strcasecmp(pCharacters, "Contents") == 0)
981         {
982                 __pContext->__apiVersion = L"3.0";
983         }
984
985         return true;
986 }
987
988 bool
989 ManifestHandler::OnAuthorValue(const char* pCharacters)
990 {
991         AppLog("<Author>%s</Author>", pCharacters);
992         __pContext->__author = pCharacters;
993
994         return true;
995 }
996
997 bool
998 ManifestHandler::OnUrlValue(const char* pCharacters)
999 {
1000         __pContext->__url = pCharacters;
1001         AppLog("<Url>%s</Url>", pCharacters);
1002
1003         return true;
1004 }
1005
1006 bool
1007 ManifestHandler::OnApiVersionValue(const char* pCharacters)
1008 {
1009         __pContext->__apiVersion = pCharacters;
1010         AppLog("<ApiVersion>%s</ApiVersion>", pCharacters);
1011
1012         XmlAttribute *pAttr = GetAttribute();
1013         if (pAttr)
1014         {
1015                 char* pOspCompat = pAttr->Find("OspCompat");
1016                 if (pOspCompat)
1017                 {
1018                         AppLog(" - OspCompat=%s", pOspCompat);
1019                         __pContext->__isOspCompat = true;
1020
1021                         AppLog("INSTALLATION_STORAGE = [INTERNAL]");
1022                         __isInternalStorage = true;
1023                 }
1024         }
1025
1026         return true;
1027 }
1028
1029 bool
1030 ManifestHandler::OnPrivilegeValue(const char* pCharacters)
1031 {
1032         __pPrivilegeList->Add(*new (std::nothrow) String(pCharacters));
1033         AppLog("<Privilege>%s</Privilege>", pCharacters);
1034
1035         return true;
1036 }
1037
1038 bool
1039 ManifestHandler::OnIconValue(const char* pCharacters)
1040 {
1041         AppLog("<Icon>%s</Icon>", pCharacters);
1042
1043         XmlAttribute* pAttr = GetAttribute();
1044         TryReturn(pAttr, true, "pAttr is null");
1045
1046         char* pSection = pAttr->Find("Section");
1047         TryReturn(pSection, true, "pSection is null");
1048         AppLog(" - Section=%s", pSection);
1049
1050         TryReturn(__pDefaultIconType, false, "__pDefaultIconType is null");
1051
1052         String iconRelPath;
1053         char* pType = pAttr->Find("Type");
1054         if (pType == null)
1055         {
1056                 AppLog("__pDefaultIconType=%s", __pDefaultIconType);
1057                 if (strcasecmp(__pDefaultIconType, "Xhigh") == 0)
1058                 {
1059                         iconRelPath.Format(1024, L"screen-density-xhigh/%s", pCharacters);
1060                 }
1061                 else if (strcasecmp(__pDefaultIconType, "High") == 0)
1062                 {
1063                         iconRelPath.Format(1024, L"screen-density-high/%s", pCharacters);
1064                 }
1065                 else
1066                 {
1067                         TryReturn(0, false, "Invalid __pDefaultIconType[%s]", __pDefaultIconType);
1068                 }
1069         }
1070         else    // legacy
1071         {
1072                 AppLog(" - Type=%s", pType);
1073                 if (strcasecmp(pType, "Xhigh") == 0)
1074                 {
1075                         iconRelPath.Format(1024, L"screen-density-xhigh/%s", pCharacters);
1076                 }
1077                 else if (strcasecmp(pType, "High") == 0)
1078                 {
1079                         iconRelPath.Format(1024, L"screen-density-high/%s", pCharacters);
1080                 }
1081                 else
1082                 {
1083                         TryReturn(0, false, "Invalid IconType [%s]", __pDefaultIconType);
1084                 }
1085         }
1086
1087         if (FindElement("Content") == true)
1088         {
1089                 TryReturn(__pContentData, false, "__pContentData is null");
1090                 __pContentData->SetIcon(iconRelPath);
1091         }
1092         else
1093         {
1094                 if (pType == null)
1095                 {
1096                         if (strcasecmp(pSection, "MainMenu") == 0)
1097                         {
1098                                 __pAppData->__menuIcon = iconRelPath;
1099                         }
1100                         else if (strcasecmp(pSection, "Setting") == 0)
1101                         {
1102                                 __pAppData->__settingIcon = iconRelPath;
1103                         }
1104                         else if (strcasecmp(pSection, "Notification") == 0)
1105                         {
1106                                 __pAppData->__notificationIcon = iconRelPath;
1107                         }
1108                 }
1109                 else    // legacy
1110                 {
1111                         if (strcasecmp(pSection, "MainMenu") == 0)
1112                         {
1113                                 if (__isDefaultMainmenu == false)
1114                                 {
1115                                         __pAppData->__menuIcon = iconRelPath;
1116                                 }
1117
1118                                 if (strcasecmp(pType, __pDefaultIconType) == 0)
1119                                 {
1120                                         __isDefaultMainmenu = true;
1121                                 }
1122                         }
1123                         else if (strcasecmp(pSection, "Setting") == 0)
1124                         {
1125                                 if (__isDefaultSetting == false)
1126                                 {
1127                                         __pAppData->__settingIcon = iconRelPath;
1128                                 }
1129
1130                                 if (strcasecmp(pType, __pDefaultIconType) == 0)
1131                                 {
1132                                         __isDefaultSetting = true;
1133                                 }
1134                         }
1135                         else if (strcasecmp(pSection, "Notification") == 0)
1136                         {
1137                                 if (__isDefaultQuickpanel == false)
1138                                 {
1139                                         __pAppData->__notificationIcon = iconRelPath;
1140                                 }
1141
1142                                 if (strcasecmp(pType, __pDefaultIconType) == 0)
1143                                 {
1144                                         __isDefaultQuickpanel = true;
1145                                 }
1146                         }
1147                 }
1148         }
1149
1150         return true;
1151 }
1152
1153 bool
1154 ManifestHandler::OnNameValue(const char* pCharacters)
1155 {
1156         XmlAttribute* pAttr = 0;
1157         char* pAttrValue = 0;
1158
1159         pAttr = GetAttribute();
1160         TryReturn(pAttr, true, "pAttr is null");
1161
1162         pAttrValue = pAttr->Find("Locale");
1163         TryReturn(pAttrValue, true, "pAttrValue is null");
1164
1165         if (FindElement("Content") == true)
1166         {
1167                 TryReturn(__pContentData, false, "__pContentData is null");
1168
1169                 String* pValue = new (std::nothrow) String;
1170                 StringUtil::Utf8ToString(pCharacters, *pValue);
1171                 __pContentData->AddName(*(new (std::nothrow) String(pAttrValue)), *pValue);
1172         }
1173         else
1174         {
1175                 if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
1176                 {
1177                         if (__isDefaultName == true)
1178                         {
1179                                 __pContext->__displayName = pCharacters;
1180                         }
1181                 }
1182
1183                 String* pValue = new (std::nothrow) String;
1184                 StringUtil::Utf8ToString(pCharacters, *pValue);
1185
1186                 __pAppData->__pNameList->Add((new (std::nothrow) String(pAttrValue)), pValue);
1187         }
1188
1189         AppLog("<DisplayName Locale=\"%s\">%s</DisplayName>", pAttrValue, pCharacters);
1190
1191         return true;
1192 }
1193
1194 bool
1195 ManifestHandler::OnDescriptionValue(const char* pCharacters)
1196 {
1197         XmlAttribute *pAttr = 0;
1198         char *pAttrValue = 0;
1199
1200         pAttr = GetAttribute();
1201         TryReturn(pAttr, true, "pAttr is null");
1202
1203         pAttrValue = pAttr->Find("Locale");
1204         TryReturn(pAttrValue, true, "pAttrValue is null");
1205
1206         if (strcasecmp(pAttrValue, "eng-GB") == 0 || strcasecmp(pAttrValue, "eng-US") == 0)
1207         {
1208                 __pContext->__description = pCharacters;
1209         }
1210
1211         AppLog("<Description Locale=\"%s\">%s</Description>", pAttrValue, pCharacters);
1212
1213         return true;
1214 }
1215
1216 bool
1217 ManifestHandler::OnDataControlTypeValue(const char* pCharacters)
1218 {
1219         XmlAttribute* pAttr = null;
1220         char* pAccessValue = null;
1221
1222         pAttr = GetAttribute();
1223         TryReturn(pAttr, true, "pAttr is null");
1224
1225         pAccessValue = pAttr->Find("Access");
1226         TryReturn(pAccessValue, true, "pAccessValue is null");
1227
1228         __pDataControlType = new (std::nothrow) DataControlType;
1229         TryReturn(__pDataControlType, false, "__pDataControlType is null");
1230
1231         __pDataControlType->__type = pCharacters;
1232         __pDataControlType->__access = pAccessValue;
1233
1234         AppLog("<DataControlType Access=\"%s\", Type=\"%s\">", pAccessValue, pCharacters);
1235
1236         return true;
1237 }
1238
1239 bool
1240 ManifestHandler::OnConditionValue(const char* pCharacters)
1241 {
1242         XmlAttribute *pAttr = null;
1243         char *pName = null;
1244
1245         pAttr = GetAttribute();
1246         TryReturn(pAttr, true, "pAttr is null");
1247
1248         pName = pAttr->Find("Name");
1249         TryReturn(pName, true, "pName is null");
1250
1251         String* pKey = new (std::nothrow) String(pName);
1252         TryReturn(pKey, false, "pKey is null");
1253         String* pValue = new (std::nothrow) String(pCharacters);
1254         TryReturn(pValue, false, "pValue is null");
1255
1256         __pAppData->__pLaunchConditionList->Add(pKey, pValue);
1257         AppLog("<LaunchCondition Name=\"%s\", Value=\"%s\">", pName, pCharacters);
1258
1259         return true;
1260 }
1261
1262 bool
1263 ManifestHandler::OnNotificationValue(const char* pCharacters)
1264 {
1265         XmlAttribute *pAttr = null;
1266         const char *pName = null;
1267
1268         pAttr = GetAttribute();
1269         TryReturn(pAttr, true, "pAttr is null.");
1270
1271         pName = pAttr->Find("Name");
1272         TryReturn(pName, true, "pName is null.");
1273
1274         if (strcasecmp(pName, "Ticker") == 0)
1275         {
1276                 pName = "Notification";
1277         }
1278         else if (strcasecmp(pName, "Notification") == 0 || strcasecmp(pName, "Sounds") == 0
1279                         || strcasecmp(pName, "Badge") == 0 || strcasecmp(pName, "Contents") == 0)
1280         {
1281                 // known notification attributes
1282         }
1283         else
1284         {
1285                 TryReturn(0, true, "Unknown notification attributes=%s", pCharacters);
1286         }
1287
1288         String* pKey = new (std::nothrow) String(pName);
1289         TryReturn(pKey, false, "pKey is null.");
1290
1291         String* pValue = new (std::nothrow) String(pCharacters);
1292         TryReturn(pValue, false, "pValue is null.");
1293
1294         pKey->ToLowerCase();
1295         pValue->ToLowerCase();
1296
1297         __pAppData->__pNotificationMap->Add(pKey, pValue);
1298         AppLog("<Notification Name=\"%s\", Value=\"%s\">", pName, pCharacters);
1299
1300         return true;
1301 }
1302
1303 bool
1304 ManifestHandler::OnInstallLocationValue(const char* pCharacters)
1305 {
1306         AppLog("<InstallLocation>%s</InstallLocation>", pCharacters);
1307
1308         if (strcasecmp(pCharacters, "Internal") == 0)
1309         {
1310                 AppLog("INSTALLATION_STORAGE = [INTERNAL]");
1311                 __isInternalStorage = true;
1312         }
1313
1314         return true;
1315 }
1316
1317 bool
1318 ManifestHandler::OnCategoryValue(const char* pCharacters)
1319 {
1320         TryReturn(__pAppData, false, "__pAppData is null");
1321
1322         __pAppData->__pCategoryList->Add(new (std::nothrow) String(pCharacters));
1323
1324         if (strcasecmp(pCharacters, TIZEN_CATEGORY_IME) == 0)
1325         {
1326                 __pAppData->__feature = CATEGORY_TYPE_IME;
1327         }
1328         else if (strcasecmp(pCharacters, TIZEN_CATEGORY_ANTIVIRUS) == 0)
1329         {
1330                 AppLog("ANTIVIRUS Package is detected.");
1331                 __pContext->__isAntiVirus = true;
1332         }
1333
1334         return true;
1335 }
1336
1337 bool
1338 ManifestHandler::OnMetadataValue(const char* pCharacters)
1339 {
1340         TryReturn(__pAppData, false, "__pAppData is null");
1341
1342         XmlAttribute* pAttr = null;
1343         char* pKey = null;
1344
1345         pAttr = GetAttribute();
1346         TryReturn(pAttr, true, "pAttr is null.");
1347
1348         pKey = pAttr->Find("Key");
1349         TryReturn(pKey, true, "pKey is null.");
1350
1351         __pAppData->__pMetadataMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pCharacters)));
1352         __metadataKey.Clear();
1353
1354         AppLog("<Metadata Key=\"%s\">%s</Metadata>", pKey, pCharacters);
1355
1356         return true;
1357 }
1358
1359 bool
1360 ManifestHandler::FindElement(const char *pName)
1361 {
1362         bool res = false;
1363         Tizen::Base::Collection::IEnumerator* pEnum = GetElementEnumeratorN();
1364
1365         if (pEnum)
1366         {
1367                 while(pEnum->MoveNext() == E_SUCCESS)
1368                 {
1369                         String* pStr = static_cast<String*>(pEnum->GetCurrent());
1370                         if (pStr)
1371                         {
1372                                 if (pStr->Equals(pName, false) == true)
1373                                 {
1374                                         AppLog("[%s] is matched.", pName);
1375                                         res = true;
1376                                         break;
1377                                 }
1378                         }
1379                 }
1380
1381                 delete pEnum;
1382         }
1383
1384         return res;
1385 }
1386
1387 bool
1388 ManifestHandler::AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value)
1389 {
1390         String* pKey = new (std::nothrow) String(name);
1391         TryReturn(pKey, false, "pKey is null");
1392         String* pValue = new (std::nothrow) String(value);
1393         TryReturn(pValue, false, "pValue is null");
1394
1395         __pAppData->__pFeatureList->Add(pKey, pValue);
1396         return true;
1397 }
1398
1399 bool
1400 ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp)
1401 {
1402         char* pName = pAttr->Find("Name");
1403         if (pName == null)
1404         {
1405                 pName = pAttr->Find("ExecutableName");
1406         }
1407
1408         if (pName)
1409         {
1410                 AppLog(" - Name=%s", pName);
1411                 __pAppData->__name = pName;
1412                 __pAppData->__appId = __pContext->__packageId + L"." + pName;
1413         }
1414
1415         char* pMain = pAttr->Find("Main");
1416         if (pMain == null)
1417         {
1418                 pMain = pAttr->Find("Default");
1419         }
1420
1421         if (pMain)
1422         {
1423                 AppLog(" - Main=%s", pMain);
1424                 __pAppData->__main = pMain;
1425
1426                 if (strcasecmp(pMain, "True") == 0)
1427                 {
1428                         __isDefaultName = true;
1429                         __isDefaultAppDetected = true;
1430                         __pContext->__mainAppName = pName;
1431                 }
1432         }
1433         else
1434         {
1435                 __pAppData->__main = L"False";
1436         }
1437
1438         char* pRecent = pAttr->Find("LaunchingHistoryVisible");
1439         if (pRecent)
1440         {
1441                 AppLog(" - LaunchingHistoryVisible=%s", pRecent);
1442                 __pAppData->__launchingHistoryVisible = pRecent;
1443         }
1444
1445         char* pHwAcceleration = pAttr->Find("HwAcceleration");
1446         if (pHwAcceleration)
1447         {
1448                 AddAppFeature("HwAcceleration", pHwAcceleration);
1449                 AppLog(" - HwAcceleration=%s", pHwAcceleration);
1450         }
1451         else
1452         {
1453                 char* pGlFrame = pAttr->Find("GlFrame");
1454                 if (pGlFrame)
1455                 {
1456                         AddAppFeature("GlFrame", pGlFrame);
1457                         AppLog(" - GlFrame=%s", pGlFrame);
1458                 }
1459         }
1460
1461         char* pCategory = pAttr->Find("Category");
1462         if (pCategory)
1463         {
1464                 AppLog(" - Category=%s", pCategory);
1465
1466                 if (strcasecmp(pCategory, "home-screen") == 0)
1467                 {
1468                         __pAppData->__pCategoryList->Add(new (std::nothrow) String(TIZEN_CATEGORY_HOMESCREEN));
1469                 }
1470                 else if (strcasecmp(pCategory, "lock-screen") == 0)
1471                 {
1472                         __pAppData->__pCategoryList->Add(new (std::nothrow) String(TIZEN_CATEGORY_LOCKSCREEN));
1473                 }
1474                 else if (strcasecmp(pCategory, "Ime") == 0)
1475                 {
1476                         __pAppData->__pCategoryList->Add(new (std::nothrow) String(TIZEN_CATEGORY_IME));
1477                 }
1478
1479                 int categoryType = InstallerUtil::GetCategoryType(pCategory);
1480                 __pAppData->__feature = categoryType;
1481         }
1482
1483         char* pSubMode = pAttr->Find("SubMode");
1484         if (pSubMode)
1485         {
1486                 if (strcasecmp(pSubMode, "True") == 0)
1487                 {
1488                         __pAppData->__isSubMode = true;
1489                         AppLog(" - SubMode=%s", pSubMode);
1490                 }
1491         }
1492
1493         if (isUiApp == true)
1494         {
1495                 __pAppData->__type = L"UiApp";
1496
1497                 char* pMenuIconVisible = pAttr->Find("MenuIconVisible");
1498                 if (pMenuIconVisible == null)
1499                 {
1500                         pMenuIconVisible = pAttr->Find("MainmenuVisible");
1501                 }
1502
1503                 if (pMenuIconVisible)
1504                 {
1505                         if (strcasecmp(pMenuIconVisible, "True") == 0)
1506                         {
1507                                 __pAppData->__menuIconVisible = true;
1508                         }
1509                         else
1510                         {
1511                                 __pAppData->__menuIconVisible = false;
1512                         }
1513
1514                         AddAppFeature("MenuIconVisible", pMenuIconVisible);
1515                         AppLog(" - MenuIconVisible=%s", pMenuIconVisible);
1516                 }
1517         }
1518         else
1519         {
1520                 __pAppData->__type = L"ServiceApp";
1521                 __pAppData->__menuIconVisible = false;
1522
1523                 char *pUseUi = pAttr->Find("UseUi");
1524                 if (pUseUi)
1525                 {
1526                         AddAppFeature("UseUi", pUseUi);
1527                         AppLog(" - UseUi=%s", pUseUi);
1528                 }
1529
1530                 char *pLifeDuration = pAttr->Find("LifeDuration");
1531                 if (pLifeDuration)
1532                 {
1533                         AddAppFeature("LifeDuration", pLifeDuration);
1534                         AppLog(" - LifeDuration=%s", pLifeDuration);
1535                 }
1536
1537                 char *pLaunchOnBoot = pAttr->Find("LaunchOnBoot");
1538                 if (pLaunchOnBoot)
1539                 {
1540                         AddAppFeature("LaunchOnBoot", pLaunchOnBoot);
1541                         AppLog(" - LaunchOnBoot=%s", pLaunchOnBoot);
1542                 }
1543
1544                 char *pAutoRestart = pAttr->Find("AutoRestart");
1545                 if (pAutoRestart)
1546                 {
1547                         AddAppFeature("AutoRestart", pAutoRestart);
1548                         AppLog(" - AutoRestart=%s", pAutoRestart);
1549                 }
1550
1551                 char *pSystemService = pAttr->Find("SystemService");
1552                 if (pSystemService)
1553                 {
1554                         if (strcasecmp(pSystemService, "True") == 0)
1555                         {
1556                                 __pAppData->__isSystemService = true;
1557                                 AppLog(" - SystemService=%s", pSystemService);
1558                         }
1559                 }
1560         }
1561
1562         AppLog(" - app=%ls", __pAppData->__appId.GetPointer());
1563
1564         return true;
1565 }
1566
1567 AppData*
1568 ManifestHandler::GetAppData(void)
1569 {
1570         return __pAppData;
1571 }
1572
1573 char*
1574 ManifestHandler::GetDefaultIconType(void)
1575 {
1576         return __pDefaultIconType;
1577 }
1578