From 98ec33f3a7aaf24feb7ebd9aa524717bb08c68f5 Mon Sep 17 00:00:00 2001 From: "s89.jang" Date: Thu, 30 Mar 2017 17:10:27 +0900 Subject: [PATCH] Add Package.InstalledTime property Change-Id: Ia810e32735bc29babbadb2751c5951ef632b04c2 Signed-off-by: s89.jang --- .../Interop/Interop.Package.cs | 3 +++ .../Tizen.Applications/Package.cs | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs index 2d86f5d..67de930 100644 --- a/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs +++ b/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs @@ -106,6 +106,9 @@ internal static partial class Interop [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_accessible")] internal static extern ErrorCode PackageInfoIsAccessible(IntPtr handle, out bool accessible); + [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_installed_time")] + internal static extern ErrorCode PackageInfoGetInstalledTime(IntPtr handle, out int installedTime); + [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_package_cert_info")] internal static extern ErrorCode PackageCompareCertInfo(string lhsPackageId, string rhsPackageId, out CertCompareResultType result); } diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs index 3326c5a..ae60eed 100644 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs +++ b/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs @@ -42,6 +42,7 @@ namespace Tizen.Applications private bool _isAccessible; private IReadOnlyDictionary _certificates; private List _privileges; + private int _installedTime; private Package(string pkgId) { @@ -119,6 +120,11 @@ namespace Tizen.Applications public IEnumerable Privileges { get { return _privileges; } } /// + /// Installed time of the package. + /// + public int InstalledTime { get { return _installedTime; } } + + /// /// Retrieves all application IDs of this package. /// /// Returns a dictionary containing all application info for given application type. @@ -271,6 +277,11 @@ namespace Tizen.Applications { Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is accessible or not"); } + Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime); + if (err != Interop.PackageManager.ErrorCode.None) + { + Log.Warn(LogTag, "Failed to get installed time of " + pkgId); + } package._certificates = PackageCertificate.GetPackageCertificates(handle); package._privileges = GetPackagePrivilegeInformation(handle); -- 2.7.4