/// Gets the display name of the given privilege.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>If there's no matching privilege, then it returns last token of the given privilege.</remarks>
+ /// <remarks>If there's no matching privilege, then it returns last token of the given privilege. Since Tizen 6.0, if there's no matching privilege then it returns ArgumentException. </remarks>
/// <param name="apiVersion">The API version.</param>
/// <param name="privilege">The privilege.</param>
/// <returns>The display name of the given privilege at the given API version.</returns>
/// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
- /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter such as a non-existing privilege.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
public static string GetDisplayName(string apiVersion, string privilege)
/// Gets the display name of the given privilege.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>If there's no matching privilege, then it returns last token of the given privilege.</remarks>
+ /// <remarks>If there's no matching privilege, then it returns last token of the given privilege. Since Tizen 6.0, if there's no matching privilege then it returns ArgumentException.</remarks>
/// <param name="apiVersion">The API version.</param>
/// <param name="privilege">The privilege.</param>
/// <param name="packageType">The type of application package.</param>
/// <returns>The display name of the given privilege at the given API version and the package type.</returns>
/// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
- /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter such as a non-existing privilege.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
public static string GetDisplayName(string apiVersion, string privilege, PackageType packageType)
/// Gets the description of the given privilege.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>If there's no matching privilege, then it returns description string for undefined privilege.</remarks>
+ /// <remarks>If there's no matching privilege, then it returns description string for undefined privilege. Since Tizen 6.0, if there's no matching privilege then it returns ArgumentException. </remarks>
/// <param name="apiVersion">The API version.</param>
/// <param name="privilege">The privilege.</param>
/// <returns>The description of given privilege at the given API version</returns>
/// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
- /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter such as a non-existing privilege.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
public static string GetDescription(string apiVersion, string privilege)
/// Gets the description of the given privilege.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>If there's no matching privilege, then it returns description string for undefined privilege.</remarks>
+ /// <remarks>If there's no matching privilege, then it returns description string for undefined privilege. Since Tizen 6.0, if there's no matching privilege then it returns ArgumentException. </remarks>
/// <param name="apiVersion">The API version.</param>
/// <param name="privilege">The privilege.</param>
/// <param name="packageType">The type of application package.</param>
/// <returns>The description of given privilege at the given API version and the package type.</returns>
/// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
- /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter such as a non-existing privilege.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
public static string GetDescription(string apiVersion, string privilege, PackageType packageType)
/// <remarks>The privilege must be privacy related.</remarks>
/// <returns>The privacy group's display name that the given privilege is included in.</returns>
/// <exception cref="System.ArgumentNullException">Thrown when there is a null parameter.</exception>
- /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter such as a non-existing privilege.</exception>
/// <exception cref="System.OutOfMemoryException">Thrown when out of memory occurs.</exception>
/// <exception cref="System.InvalidOperationException">Thrown when an internal error occurs.</exception>
/// <exception cref="System.NotSupportedException">The required feature is not supported.</exception>
{
if (err == (int)ErrorCode.None)
return;
- Tizen.Log.Error(Interop.Privilege.LogTag, "[" + ErrorFacts.GetErrorMessage(err) + "] " + msg);
+ if (err == (int)Interop.Privilege.ErrorCode.NoMatchingPrivilege)
+ Tizen.Log.Error(Interop.Privilege.LogTag, "[System.ArgumentException] No such a privilege. " + msg);
+ else
+ Tizen.Log.Error(Interop.Privilege.LogTag, "[" + ErrorFacts.GetErrorMessage(err) + "] " + msg);
switch (err)
{
case (int)ErrorCode.NotSupported:
throw new NotSupportedException();
+ case (int)Interop.Privilege.ErrorCode.NoMatchingPrivilege:
case (int)ErrorCode.InvalidParameter:
throw new ArgumentException();
case (int)ErrorCode.OutOfMemory: