Skip to content

Commit

Permalink
[PackageManager] add Isupdated
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkwan committed Feb 17, 2025
1 parent 7ec7f42 commit ba2a9b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ internal enum CertificateType
[DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_preload_package")]
internal static extern ErrorCode PackageInfoIsPreloadPackage(IntPtr handle, out bool preload);

[DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_update_package")]
internal static extern ErrorCode PackageInfoIsUpdatePackage(IntPtr handle, out bool update);

[DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_accessible")]
internal static extern ErrorCode PackageInfoIsAccessible(IntPtr handle, out bool accessible);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class Package
private bool _isSystemPackage;
private bool _isRemovable;
private bool _isPreloaded;
private bool _isUpdated;
private bool _isAccessible;
private Lazy<IReadOnlyDictionary<CertificateType, PackageCertificate>> _certificates;
private List<string> _privileges;
Expand Down Expand Up @@ -125,6 +126,13 @@ private Package(string pkgId)
/// <since_tizen> 3 </since_tizen>
public bool IsPreloaded { get { return _isPreloaded; } }

/// <summary>
/// Checks whether the package is updated.
/// </summary>
/// <since_tizen> 9 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsUpdated { get { return _isUpdated; } }

/// <summary>
/// Checks whether the current package is accessible.
/// </summary>
Expand Down Expand Up @@ -364,6 +372,11 @@ internal static Package CreatePackage(IntPtr handle, string pkgId)
{
Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is preloaded or not");
}
Interop.Package.PackageInfoIsUpdatePackage(handle, out package._isUpdated);
if (err != Interop.PackageManager.ErrorCode.None)
{
Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is updated or not");
}
Interop.Package.PackageInfoIsAccessible(handle, out package._isAccessible);
if (err != Interop.PackageManager.ErrorCode.None)
{
Expand Down

0 comments on commit ba2a9b1

Please sign in to comment.