[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);
}
private bool _isAccessible;
private IReadOnlyDictionary<CertificateType, PackageCertificate> _certificates;
private List<string> _privileges;
+ private int _installedTime;
private Package(string pkgId)
{
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>
{
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);