summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authors89.jang <s89.jang@samsung.com>2017-03-30 17:10:27 +0900
committers89.jang <s89.jang@samsung.com>2017-03-30 17:12:44 +0900
commit614f5cb176b9ff4638dbd7ff05b40b970c0efd37 (patch)
tree4b910bbd092de72a3bb59aab82745e08c05db280
parent885732fccfec80bee779573aefdaa3ca9a48881d (diff)
downloadapplication-614f5cb176b9ff4638dbd7ff05b40b970c0efd37.tar.gz
application-614f5cb176b9ff4638dbd7ff05b40b970c0efd37.tar.bz2
application-614f5cb176b9ff4638dbd7ff05b40b970c0efd37.zip
Add Package.InstalledTime property
Change-Id: Ia810e32735bc29babbadb2751c5951ef632b04c2 Signed-off-by: s89.jang <s89.jang@samsung.com>
-rw-r--r--Tizen.Applications.PackageManager/Interop/Interop.Package.cs3
-rw-r--r--Tizen.Applications.PackageManager/Tizen.Applications/Package.cs11
2 files changed, 14 insertions, 0 deletions
diff --git a/Tizen.Applications.PackageManager/Interop/Interop.Package.cs b/Tizen.Applications.PackageManager/Interop/Interop.Package.cs
index 2d86f5d..67de930 100644
--- a/Tizen.Applications.PackageManager/Interop/Interop.Package.cs
+++ b/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/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs b/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs
index 3326c5a..ae60eed 100644
--- a/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs
+++ b/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs
@@ -42,6 +42,7 @@ namespace Tizen.Applications
private bool _isAccessible;
private IReadOnlyDictionary<CertificateType, PackageCertificate> _certificates;
private List<string> _privileges;
+ private int _installedTime;
private Package(string pkgId)
{
@@ -119,6 +120,11 @@ namespace Tizen.Applications
public IEnumerable<string> Privileges { get { return _privileges; } }
/// <summary>
+ /// Installed time of the package.
+ /// </summary>
+ public int InstalledTime { get { return _installedTime; } }
+
+ /// <summary>
/// Retrieves all application IDs of this package.
/// </summary>
/// <returns>Returns a dictionary containing all application info for given application type.</returns>
@@ -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);