From f89441226599c945925284e03f38fbe8db50c1f8 Mon Sep 17 00:00:00 2001 From: jongmyeong ko Date: Thu, 16 Mar 2017 23:29:25 -0700 Subject: [PATCH] Revert "Add new API for getting filtered count" 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 --- .../Interop/Interop.PackageManager.cs | 3 +- .../Tizen.Applications/PackageFilter.cs | 41 ---------------------- .../Tizen.Applications/PackageManager.cs | 6 ---- 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs index a58b128..e8fac2d 100644 --- a/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs +++ b/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs @@ -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 diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs index 2a4c57e..8ebff43 100755 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs @@ -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 _filter; - private int _filteredCount = -1; /// /// 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 } /// - /// Gets the filtered item count from the given filtered result which was retrieved using GetPackages method, previously. - /// - /// filtered list - /// Thrown when failed when input filtered list is invalid - public int GetCount(IEnumerable filteredList) - { - if (filteredList == null) - { - throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "the parameter is null"); - } - return filteredList.Count(); - } - - /// - /// Gets the filtered count from the latest result of GetPackages method call. - /// - /// - /// 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. - /// - /// Thrown when failed when there is no valid fitered result - 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; - } - } - - /// /// This class contains possible keys for filter to be used in the GetPackages method. /// public static class Keys diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs index 950d2d5..738e3c3 100644 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs @@ -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; } -- 2.7.4