Revert "Add new API for getting filtered count"
authorjongmyeong ko <jongmyeong.ko@samsung.com>
Fri, 17 Mar 2017 06:29:25 +0000 (23:29 -0700)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Fri, 17 Mar 2017 11:16:04 +0000 (04:16 -0700)
there is other way to get count from the result using C# lib.

using System.Ling;
pkglist = PackageManger.GetPackages(filter);
pkglist.Count(); //

This reverts commit 7b56cf8bf7696418ac3ac4975cde6845c75f732c.

Change-Id: Ic52160b9d8e2ad0d5f0cbccbf8ff5c306103a2e0

src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs
src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs

index a58b128..e8fac2d 100644 (file)
@@ -46,8 +46,7 @@ internal static partial class Interop
             IoError = Tizen.Internals.Errors.ErrorCode.IoError,
             NoSuchPackage = -0x01150000 | 0x71,
             SystemError = -0x01150000 | 0x72,
-            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied,
-            InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation
+            PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied
         }
 
         // Any change here might require changes in Tizen.Applications.PackageEventState enum
index 2a4c57e..8ebff43 100755 (executable)
@@ -15,7 +15,6 @@
  */
 
 using System.Collections.Generic;
-using System.Linq;
 
 namespace Tizen.Applications
 {
@@ -25,7 +24,6 @@ namespace Tizen.Applications
     public class PackageFilter
     {
         private IDictionary<string, bool> _filter;
-        private int _filteredCount = -1;
 
         /// <summary>
         /// Default constructor with empty filter list. All installed applications will satisfy this filter unless updated with more specific filters.
@@ -55,45 +53,6 @@ namespace Tizen.Applications
         }
 
         /// <summary>
-        /// Gets the filtered item count from the given filtered result which was retrieved using GetPackages method, previously.
-        /// </summary>
-        /// <param name="filteredList">filtered list</param>
-        /// <exception cref="ArgumentException">Thrown when failed when input filtered list is invalid</exception>
-        public int GetCount(IEnumerable<Package> filteredList)
-        {
-            if (filteredList == null)
-            {
-                throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "the parameter is null");
-            }
-            return filteredList.Count();
-        }
-
-        /// <summary>
-        /// Gets the filtered count from the latest result of GetPackages method call.
-        /// </summary>
-        /// <remarks>
-        /// For the valid result, the method, Getpackages(PackageFilter filter), should be called once before.
-        /// The return value of this API can be same with GetCount(filteredList) if the filteredList is the result of the latest GetPackages method call.
-        /// </remarks>
-        /// <exception cref="InvalidOperationException">Thrown when failed when there is no valid fitered result</exception>
-        public int GetCount()
-        {
-            if (_filteredCount < 0)
-            {
-                throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidOperation, "there is no valid filtered result");
-            }
-            return _filteredCount;
-        }
-
-        internal int FilteredCount
-        {
-            set
-            {
-                _filteredCount = value;
-            }
-        }
-
-        /// <summary>
         /// This class contains possible keys for filter to be used in the GetPackages method.
         /// </summary>
         public static class Keys
index 950d2d5..738e3c3 100644 (file)
@@ -329,12 +329,6 @@ namespace Tizen.Applications
             {
                 Log.Warn(LogTag, string.Format("Failed to destroy package filter handle. err = {0}", err));
             }
-
-            if (filter != null)
-            {
-                filter.FilteredCount = packageList.Count;
-            }
-
             return packageList;
         }