Merge "[SecureRepository] Add support of InvalidFormat error in ckmc api" 5.0.0-preview1-00408
authorYunjin Lee <yunjin-.lee@samsung.com>
Tue, 12 Dec 2017 03:15:07 +0000 (03:15 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 12 Dec 2017 03:15:07 +0000 (03:15 +0000)
src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs [changed mode: 0755->0644]
src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs

old mode 100755 (executable)
new mode 100644 (file)
index d1b9e7f..cae6890
@@ -26,7 +26,7 @@ namespace Tizen.Applications
     public class ApplicationInfoFilter
     {
         /// <summary>
-        ///
+        /// A constructor of ApplicationInfoFilter class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public ApplicationInfoFilter()
@@ -35,40 +35,70 @@ namespace Tizen.Applications
         }
 
         /// <summary>
+        /// This class is a possible value to use in the InstalledApplicationFilter.
+        /// </summary>
+        /// <since_tizen> 5 </since_tizen>
+        public static class Values
+        {
+            /// <summary>
+            /// A pre-defined value string for InstalledStorage key. This value means that the application is installed at internal storage.
+            /// </summary>
+            /// <since_tizen> 5 </since_tizen>
+            public const string InstalledInternal = "installed_internal";
+
+            /// <summary>
+            /// A pre-defined value string for InstalledStorage key. This value means that the application is installed at external storage.
+            /// </summary>
+            /// <since_tizen> 5 </since_tizen>
+            public const string InstalledExternal = "installed_external";
+
+            /// <summary>
+            /// A pre-defined value string for InstalledStorage key. This value means that the application is installed at extended storage.
+            /// </summary>
+            /// <since_tizen> 5 </since_tizen>
+            public const string InstalledExtended = "installed_extended";
+        }
+
+        /// <summary>
         /// This class is a possible key to use in the InstalledApplicationFilter.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public static class Keys
         {
             /// <summary>
-            ///
+            /// A key to filter by application id.
             /// </summary>
             /// <since_tizen> 3 </since_tizen>
             public const string Id = "PACKAGE_INFO_PROP_APP_ID";
             /// <summary>
-            ///
+            /// A key to filter by application type.
             /// </summary>
             /// <since_tizen> 3 </since_tizen>
             public const string Type = "PACKAGE_INFO_PROP_APP_TYPE";
             /// <summary>
-            ///
+            /// A key to filter by application category.
             /// </summary>
             /// <since_tizen> 3 </since_tizen>
             public const string Category = "PACKAGE_INFO_PROP_APP_CATEGORY";
             /// <summary>
-            ///
+            /// A key to filter by installed storage.
+            /// </summary>
+            /// <since_tizen> 5 </since_tizen>
+            public const string InstalledStorage = "PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE";
+            /// <summary>
+            /// A key to filter by nodisplay attribute.
             /// </summary>
             /// <since_tizen> 3 </since_tizen>
             public const string NoDisplay = "PACKAGE_INFO_PROP_APP_NODISPLAY";
             /// <summary>
-            ///
+            /// A key to filter by taskmanage attribute.
             /// </summary>
             /// <since_tizen> 3 </since_tizen>
             public const string TaskManage = "PACKAGE_INFO_PROP_APP_TASKMANAGE";
         }
 
         /// <summary>
-        ///
+        /// A dictionary to store keys and values of filter.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public IDictionary<string, string> Filter
index fc7c130..719a5ed 100755 (executable)
@@ -546,7 +546,8 @@ namespace Tizen.Applications
             {
                 if ((item.Key == ApplicationInfoFilter.Keys.Id) ||
                     (item.Key == ApplicationInfoFilter.Keys.Type) ||
-                    (item.Key == ApplicationInfoFilter.Keys.Category))
+                    (item.Key == ApplicationInfoFilter.Keys.Category) ||
+                    (item.Key == ApplicationInfoFilter.Keys.InstalledStorage))
                 {
                     err = Interop.ApplicationManager.AppInfoFilterAddString(infoHandle, item.Key, item.Value);
                 }
index 2b10511..ed6e043 100644 (file)
@@ -1101,7 +1101,7 @@ namespace Tizen.Applications
 
         private static void RegisterPackageManagerEventIfNeeded()
         {
-            if (s_packageManagerEventCallback != null)
+            if (s_installEventHandler != null && s_uninstallEventHandler != null && s_updateEventHandler != null && s_moveEventHandler != null && s_clearDataEventHandler != null)
                 return;
 
             var err = Interop.PackageManager.ErrorCode.None;
@@ -1157,7 +1157,7 @@ namespace Tizen.Applications
 
         private static void UnregisterPackageManagerEventIfNeeded()
         {
-            if (Handle.IsInvalid || s_packageManagerEventCallback == null || s_installEventHandler != null || s_uninstallEventHandler != null || s_updateEventHandler != null || s_moveEventHandler != null || s_clearDataEventHandler != null)
+            if (s_packageManagerEventCallback == null || s_installEventHandler != null || s_uninstallEventHandler != null || s_updateEventHandler != null || s_moveEventHandler != null || s_clearDataEventHandler != null)
             {
                 return;
             }