Skip to content

Commit

Permalink
[Packagemanager] Throw an exception when failed to add event listener (
Browse files Browse the repository at this point in the history
…Samsung#5886)

* [Packagemanager] Throw an exception when failed to add event listener

Signed-off-by: Sangyoon Jang <[email protected]>

* Fix doxygen comment

Signed-off-by: Sangyoon Jang <[email protected]>

---------

Signed-off-by: Sangyoon Jang <[email protected]>
  • Loading branch information
jeremy-jang authored Jan 23, 2024
1 parent 52e8b31 commit 23bc144
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static class PackageManager
/// <summary>
/// InstallProgressChanged event. This event occurs when a package is getting installed and the progress of the request to the package manager is changed.
/// </summary>
/// <exception cref="IOException">Thrown when subscribing to package manager event failed.</exception>
/// <since_tizen> 3 </since_tizen>
public static event EventHandler<PackageManagerEventArgs> InstallProgressChanged
{
Expand All @@ -98,6 +99,7 @@ public static event EventHandler<PackageManagerEventArgs> InstallProgressChanged
/// <summary>
/// UninstallProgressChanged event. This event occurs when a package is getting uninstalled and the progress of the request to the package manager is changed.
/// </summary>
/// <exception cref="IOException">Thrown when subscribing to package manager event failed.</exception>
/// <since_tizen> 3 </since_tizen>
public static event EventHandler<PackageManagerEventArgs> UninstallProgressChanged
{
Expand All @@ -124,6 +126,7 @@ public static event EventHandler<PackageManagerEventArgs> UninstallProgressChang
/// <summary>
/// UpdateProgressChanged event. This event occurs when a package is getting updated and the progress of the request to the package manager is changed.
/// </summary>
/// <exception cref="IOException">Thrown when subscribing to package manager event failed.</exception>
/// <since_tizen> 3 </since_tizen>
public static event EventHandler<PackageManagerEventArgs> UpdateProgressChanged
{
Expand All @@ -150,6 +153,7 @@ public static event EventHandler<PackageManagerEventArgs> UpdateProgressChanged
/// <summary>
/// MoveProgressChanged event. This event occurs when a package is getting moved and the progress of the request to the package manager is changed.
/// </summary>
/// <exception cref="IOException">Thrown when subscribing to package manager event failed.</exception>
/// <since_tizen> 3 </since_tizen>
public static event EventHandler<PackageManagerEventArgs> MoveProgressChanged
{
Expand All @@ -176,6 +180,7 @@ public static event EventHandler<PackageManagerEventArgs> MoveProgressChanged
/// <summary>
/// ClearDataProgressChanged event. This event occurs when data directories are cleared in the given package.
/// </summary>
/// <exception cref="IOException">Thrown when subscribing to package manager event failed.</exception>
/// <since_tizen> 3 </since_tizen>
public static event EventHandler<PackageManagerEventArgs> ClearDataProgressChanged
{
Expand Down Expand Up @@ -1403,6 +1408,7 @@ private static void RegisterPackageManagerEventIfNeeded()
if (err != Interop.PackageManager.ErrorCode.None)
{
Log.Warn(LogTag, string.Format("Failed to register callback for package manager event. err = {0}", err));
throw PackageManagerErrorFactory.GetException(err, "Failed to register package manager event.");
}
}

Expand Down

0 comments on commit 23bc144

Please sign in to comment.