[Privilege] Add privacy feature and deprecate redundant API (#231)
authoryl33 <31228316+yl33@users.noreply.github.com>
Tue, 8 May 2018 03:42:52 +0000 (12:42 +0900)
committerterry2000s <ds73.lee@samsung.com>
Tue, 8 May 2018 03:42:52 +0000 (12:42 +0900)
* [Privilege] Add privacy feature and deprecate redundant API

* Update Privilege.cs

src/Tizen.Security/Tizen.Security/Privilege.cs

index 77129dd..1f3f047 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *  Copyright (c) 2016-2018 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -143,6 +143,7 @@ namespace Tizen.Security
         /// <summary>
         /// Gets the display name of the privacy group in which the given privilege is included.
         /// </summary>
+        /// <feature>http://tizen.org/feature/security.privacy_privilege</feature>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="privilege">The privilege.</param>
         /// <remarks>The privilege must be privacy related.</remarks>
@@ -151,6 +152,7 @@ namespace Tizen.Security
         /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</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>
         public static string GetPrivacyDisplayName(string privilege)
         {
             string displayName;
@@ -165,6 +167,7 @@ namespace Tizen.Security
         /// <summary>
         /// Gets the status of the given privacy related privilege.
         /// </summary>
+        /// <feature>http://tizen.org/feature/security.privacy_privilege</feature>
         /// <since_tizen> 3 </since_tizen>
         /// <param name="privilege">The privilege.</param>
         /// <remarks>The privilege must be privacy related.</remarks>
@@ -173,6 +176,8 @@ namespace Tizen.Security
         /// <exception cref="System.ArgumentException">Thrown when there is an invalid parameter.</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>
+        [Obsolete("Deprecated since API level 5. Please use PrivacyPrivilegeManager.CheckPermission instead.")]
         public static bool GetPrivacyPrivilegeStatus(string privilege)
         {
             bool status;
@@ -199,6 +204,8 @@ namespace Tizen.Security
             Tizen.Log.Error(Interop.Privilege.LogTag, "[" + ErrorFacts.GetErrorMessage(err) + "] " + msg);
             switch (err)
             {
+                case (int)ErrorCode.NotSupported:
+                    throw new NotSupportedException();
                 case (int)ErrorCode.InvalidParameter:
                     throw new ArgumentException();
                 case (int)ErrorCode.OutOfMemory: