Release 4.0.0-preview1-00324 accepted/tizen/4.0/unified/20171023.120359 submit/tizen_4.0/20171020.150016
authorDotnetBuild <dotnetbuild.tizen@gmail.com>
Fri, 20 Oct 2017 15:00:14 +0000 (00:00 +0900)
committerDotnetBuild <dotnetbuild.tizen@gmail.com>
Fri, 20 Oct 2017 15:00:14 +0000 (00:00 +0900)
17 files changed:
packaging/csapi-tizenfx.spec
pkg/PlatformFileList.txt
pkg/PublicModuleList.txt
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseHandle.cs
src/Tizen.NUI/src/public/Layer.cs
src/Tizen.Security.PrivacyPrivilegeManager/Interop/Interop.Libraries.cs [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Interop/Interop.PrivacyPrivilegeManager.cs [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security.PrivacyPrivilegeManager.csproj [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security.PrivacyPrivilegeManager.sln [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/CallCause.cs [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/CheckResult.cs [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/PrivacyPrivilegeManager.cs [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/RequestResponseEventArgs.cs [new file with mode: 0644]
src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/RequestResult.cs [new file with mode: 0644]
src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs
src/Tizen.System.Information/SystemInfo/SystemInfo.cs

index 226e8d6..b6eeed5 100644 (file)
@@ -9,7 +9,7 @@
 
 Name:       csapi-tizenfx
 Summary:    Assemblies of Tizen .NET
-Version:    4.0.0.321
+Version:    4.0.0.324
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -144,7 +144,7 @@ rm -fr %{_tizenfx_bin_path}
 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
 ./build.sh --full
 ./build.sh --dummy
-./build.sh --pack 4.0.0-preview1-00321
+./build.sh --pack 4.0.0-preview1-00324
 
 %install
 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
index 8aaa14f..2b1fe3b 100644 (file)
@@ -63,6 +63,7 @@ Tizen.PhonenumberUtils.dll                         #mobile #mobile-emul #wearabl
 Tizen.Pims.Calendar.dll                            #common #mobile #mobile-emul #tv #wearable
 Tizen.Pims.Contacts.dll                            #mobile #mobile-emul #wearable
 Tizen.Security.dll                                 #common #mobile #mobile-emul #tv #ivi #wearable
+Tizen.Security.PrivacyPrivilegeManager.dll         #common #mobile #mobile-emul #tv #ivi #wearable
 Tizen.Security.SecureRepository.dll                #common #mobile #mobile-emul #tv #ivi #wearable
 Tizen.Security.TEEC.dll                            #mobile #mobile-emul #tv #ivi #wearable
 Tizen.Sensor.dll                                   #common #mobile #mobile-emul #tv #ivi #wearable
index 2e9e56b..e0d5ed4 100755 (executable)
@@ -58,6 +58,7 @@ Tizen.PhonenumberUtils
 Tizen.Pims.Calendar
 Tizen.Pims.Contacts
 Tizen.Security
+Tizen.Security.PrivacyPrivilegeManager
 Tizen.Security.SecureRepository
 Tizen.Security.TEEC
 Tizen.Sensor
index f312226..36f88a7 100755 (executable)
@@ -158,12 +158,6 @@ namespace Tizen.NUI.BaseComponents
 
             base.Dispose(type);
 
-            // Dispose all Children of this View.
-            foreach (View childView in Children)
-            {
-                childView?.Dispose();
-            }
-            Children.Clear();
         }
 
         private void DisConnectFromSignals()
index 7aacc31..d7a1b7e 100755 (executable)
@@ -296,53 +296,6 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Equals
-        /// </summary>
-        /// <param name="o">The object should be compared.</param>
-        /// <returns>True if equal.</returns>
-        /// <since_tizen> 4 </since_tizen>
-        public override bool Equals(object o)
-        {
-            if(o == null)
-            {
-                return false;
-            }
-            if(!(o is BaseHandle))
-            {
-                return false;
-            }
-            BaseHandle b = (BaseHandle)o;
-            if (!BaseHandle.ReferenceEquals(this, null) && !BaseHandle.ReferenceEquals(b, null))
-            {
-                // drop into native code to see if both handles point to the same body
-                return this.IsEqual(b);
-            }
-
-            if (BaseHandle.ReferenceEquals(this, null) && !BaseHandle.ReferenceEquals(b, null))
-            {
-                if (b.HasBody()) return false;
-                else return true;
-            }
-            if (!BaseHandle.ReferenceEquals(this, null) && BaseHandle.ReferenceEquals(b, null))
-            {
-                if (this.HasBody()) return false;
-                else return true;
-            }
-
-            return false;
-        }
-
-        /// <summary>
-        /// Gets the the hash code of this baseHandle.
-        /// </summary>
-        /// <returns>The Hash Code.</returns>
-        /// <since_tizen> 4 </since_tizen>
-        public override int GetHashCode()
-        {
-            return base.GetHashCode();
-        }
-
-        /// <summary>
         /// Create an instance of BaseHandle.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
index e7f3391..659aac0 100755 (executable)
@@ -143,12 +143,6 @@ namespace Tizen.NUI
 
             base.Dispose(type);
 
-            // Dispose all Children of this Layer.
-            foreach (View childView in Children)
-            {
-                childView?.Dispose();
-            }
-            Children.Clear();
         }
 
 
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Interop/Interop.Libraries.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Interop/Interop.Libraries.cs
new file mode 100644 (file)
index 0000000..edde8d3
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        internal const string PrivacyPrivilegeManager = "libcapi-privacy-privilege-manager.so.0";
+    }
+}
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Interop/Interop.PrivacyPrivilegeManager.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Interop/Interop.PrivacyPrivilegeManager.cs
new file mode 100644 (file)
index 0000000..da6d21a
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class PrivacyPrivilegeManager
+    {
+        internal enum ErrorCode
+        {
+            None = Tizen.Internals.Errors.ErrorCode.None,
+            IoError = Tizen.Internals.Errors.ErrorCode.IoError,
+            InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter,
+            OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
+            Unknown = Tizen.Internals.Errors.ErrorCode.Unknown
+        }
+
+        internal enum CallCause
+        {
+            Answer = 0,
+            Error = 1,
+        }
+
+        internal enum CheckResult
+        {
+            Allow = 0,
+            Deny = 1,
+            Ask = 2,
+        }
+
+        internal enum RequestResult
+        {
+            AllowForever = 0,
+            DenyForever = 1,
+            DenyOnce = 2,
+        }
+
+        //[UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
+        internal delegate void RequestResponseCallback(CallCause cause, RequestResult result, string privilege, IntPtr userData);
+
+        [DllImport(Libraries.PrivacyPrivilegeManager, EntryPoint = "ppm_check_permission")]
+        internal static extern ErrorCode CheckPermission(string privilege, out CheckResult result);
+
+        [DllImport(Libraries.PrivacyPrivilegeManager, EntryPoint = "ppm_request_permission")]
+        internal static extern ErrorCode RequestPermission(string privilege, RequestResponseCallback callback, IntPtr userData);
+    }
+}
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security.PrivacyPrivilegeManager.csproj b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security.PrivacyPrivilegeManager.csproj
new file mode 100644 (file)
index 0000000..a3f7577
--- /dev/null
@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+   <TargetFramework>netstandard2.0</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+   <ProjectReference Include="..\Tizen\Tizen.csproj" />
+   <ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
+ </ItemGroup>
+</Project>
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security.PrivacyPrivilegeManager.sln b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security.PrivacyPrivilegeManager.sln
new file mode 100644 (file)
index 0000000..f740e19
--- /dev/null
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26124.0
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen.Security.PrivacyPrivilegeManager", "Tizen.Security.PrivacyPrivilegeManager.csproj", "{588EBECE-A11C-4837-80F3-5EDECFC17E5E}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Debug|x64 = Debug|x64
+               Debug|x86 = Debug|x86
+               Release|Any CPU = Release|Any CPU
+               Release|x64 = Release|x64
+               Release|x86 = Release|x86
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Debug|x64.ActiveCfg = Debug|x64
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Debug|x64.Build.0 = Debug|x64
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Debug|x86.ActiveCfg = Debug|x86
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Debug|x86.Build.0 = Debug|x86
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Release|Any CPU.Build.0 = Release|Any CPU
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Release|x64.ActiveCfg = Release|x64
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Release|x64.Build.0 = Release|x64
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Release|x86.ActiveCfg = Release|x86
+               {588EBECE-A11C-4837-80F3-5EDECFC17E5E}.Release|x86.Build.0 = Release|x86
+       EndGlobalSection
+EndGlobal
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/CallCause.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/CallCause.cs
new file mode 100644 (file)
index 0000000..e0e329a
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.Security
+{
+    /// <summary>
+    /// Enumeration for the call cause of a permission request callback.
+    /// </summary>
+    /// <since_tizen> 4 </since_tizen>
+    public enum CallCause
+    {
+        /// <summary>
+        /// The call cause is a permission request answer.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        Answer = Interop.PrivacyPrivilegeManager.CallCause.Answer,
+        /// <summary>
+        /// The call cause is an error.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        Error = Interop.PrivacyPrivilegeManager.CallCause.Error,
+    }
+}
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/CheckResult.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/CheckResult.cs
new file mode 100644 (file)
index 0000000..8abded1
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.Security
+{
+    /// <summary>
+    /// Enumeration for the result of a permission check.
+    /// </summary>
+    /// <since_tizen> 4 </since_tizen>
+    public enum CheckResult
+    {
+        /// <summary>
+        /// The access to privilege is allowed permanently.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        Allow = Interop.PrivacyPrivilegeManager.CheckResult.Allow,
+        /// <summary>
+        /// The access to privilege is denied permanently.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        Deny = Interop.PrivacyPrivilegeManager.CheckResult.Deny,
+        /// <summary>
+        /// The access to privilege must be resolved by the user.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        Ask = Interop.PrivacyPrivilegeManager.CheckResult.Ask,
+    }
+}
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/PrivacyPrivilegeManager.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/PrivacyPrivilegeManager.cs
new file mode 100644 (file)
index 0000000..6f56551
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Security
+{
+    /// <summary>
+    /// The PrivacyPrivilegeManager provides the properties or methods to check and request a permission for privacy privilege.
+    /// </summary>
+    public static class PrivacyPrivilegeManager
+    {
+        private const string LogTag = "Tizen.Privilege";
+        private static Interop.PrivacyPrivilegeManager.RequestResponseCallback s_requestResponseCb;
+        private static IDictionary<string, ResponseContext> s_responseMap = new Dictionary<string, ResponseContext>();
+
+        static PrivacyPrivilegeManager()
+        {
+            s_requestResponseCb = (Interop.PrivacyPrivilegeManager.CallCause cause, Interop.PrivacyPrivilegeManager.RequestResult result, string privilege, IntPtr userData) =>
+            {
+                try
+                {
+                    s_responseMap[privilege].FireEvent((CallCause)cause, (RequestResult) result);
+                }
+                catch (Exception e)
+                {
+                    Log.Error(LogTag, "Exception in callback : " + e.Message);
+                }
+            };
+        }
+
+        /// <summary>
+        /// Gets the status of a privacy privilege permission.
+        /// </summary>
+        /// <param name="privilege">The privacy privilege to be checked.</param>
+        /// <returns>The permission setting for a respective privilege.</returns>
+        /// <exception cref="ArgumentException">Thrown when an invalid parameter is passed.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when a memory error occurred.</exception>
+        /// <exception cref="System.IO.IOException">Thrown when the method failed due to an internal I/O error.</exception>
+        /// <example>
+        /// <code>
+        ///     CheckResult result = PrivacyPrivilegeManager.CheckPermission("http://tizen.org/privilege/account.read");
+        ///     switch (result)
+        ///     {
+        ///         case Allow:
+        ///             // Privilege can be used
+        ///             break;
+        ///         case Deny:
+        ///             // Privilege can't be used
+        ///             break;
+        ///         case Ask:
+        ///             // User permission request required
+        ///             PrivacyPrivilegeManager.RequestPermission("http://tizen.org/privilege/account.read");
+        ///             break;
+        ///     }
+        /// </code>
+        /// </example>
+        public static CheckResult CheckPermission(string privilege)
+        {
+            Interop.PrivacyPrivilegeManager.CheckResult result;
+            int ret = (int)Interop.PrivacyPrivilegeManager.CheckPermission(privilege, out result);
+            if (ret != (int)Interop.PrivacyPrivilegeManager.ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to check permission");
+                throw PrivacyPrivilegeManagerErrorFactory.GetException(ret);
+            }
+            return (CheckResult)result;
+        }
+
+        /// <summary>
+        /// Triggers the permission request for a user.
+        /// </summary>
+        /// <param name="privilege">The privacy privilege to be requested.</param>
+        /// <exception cref="ArgumentException">Thrown when an invalid parameter is passed.</exception>
+        /// <exception cref="OutOfMemoryException">Thrown when a memory error occurred.</exception>
+        /// <exception cref="System.IO.IOException">Thrown when the method failed due to an internal I/O error.</exception>
+        /// <example>
+        /// <code>
+        ///     CheckResult result = PrivacyPrivilegeManager.CheckPermission("http://tizen.org/privilege/account.read");
+        ///     switch (result)
+        ///     {
+        ///         case Allow:
+        ///             // Privilege can be used
+        ///             break;
+        ///         case Deny:
+        ///             // Privilege can't be used
+        ///             break;
+        ///         case Ask:
+        ///             // User permission request required
+        ///             PrivacyPrivilegeManager.RequestPermission("http://tizen.org/privilege/account.read");
+        ///             break;
+        ///     }
+        /// </code>
+        /// </example>
+        public static void RequestPermission(string privilege)
+        {
+            int ret = (int)Interop.PrivacyPrivilegeManager.RequestPermission(privilege, s_requestResponseCb, IntPtr.Zero);
+            if (ret != (int)Interop.PrivacyPrivilegeManager.ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to request permission");
+                throw PrivacyPrivilegeManagerErrorFactory.GetException(ret);
+            }
+        }
+
+        /// <summary>
+        /// Gets the response context for a given privilege.
+        /// </summary>
+        /// <seealso cref="ResponseContext"/>
+        /// <param name="privilege">The privilege.</param>
+        /// <returns>The response context of a respective privilege.</returns>
+        /// <exception cref="ArgumentException">Thrown if the key is an invalid parameter.</exception>
+        /// <example>
+        /// <code>
+        /// private static void PPM_RequestResponse(object sender, RequestResponseEventArgs e)
+        /// {
+        ///     if (e.cause == CallCause.Answer)
+        ///     {
+        ///        switch(e.result)
+        ///
+        ///        {
+        ///
+        ///         case RequestResult.AllowForever:
+        ///             Console.WriteLine("User allowed usage of privilege {0} definitely", e.privilege);
+        ///             break;
+        ///         case RequestResult.DenyForever:
+        ///             Console.WriteLine("User denied usage of privilege {0} definitely", e.privilege);
+        ///             break;
+        ///         case RequestResult.DenyOnce:
+        ///             Console.WriteLine("User denied usage of privilege {0} this time", e.privilege);
+        ///             break;
+        ///         };
+        ///     }
+        ///     else
+        ///     {
+        ///         Console.WriteLine("Error occured during requesting permission for {0}", e.privilege);
+        ///     }
+        ///}
+        ///
+        ///     PrivacyPrivilegeManager.ResponseContext context = null;
+        ///     PrivacyPrivilegeManager.GetResponseContext("http://tizen.org/privilege/account.read").TryGetTarget(out context);
+        ///     if(context != null)
+        ///     {
+        ///         context.ResponseFetched += PPM_RequestResponse;
+        ///     }
+        ///
+        ///     PrivacyPrivilegeManager.RequestPermission("http://tizen.org/privilege/account.read");
+        ///
+        ///     PrivacyPrivilegeManager.GetResponseContext("http://tizen.org/privilege/account.read").TryGetTarget(out context);
+        ///     if(context != null)
+        ///     {
+        ///         context.ResponseFetched -= PPM_RequestResponse;
+        ///     }
+        /// </code>
+        /// </example>
+        public static WeakReference<ResponseContext> GetResponseContext(string privilege)
+        {
+            if (!s_responseMap.ContainsKey(privilege))
+            {
+                s_responseMap[privilege] = new ResponseContext(privilege);
+            }
+            return new WeakReference<ResponseContext>(s_responseMap[privilege]);
+        }
+
+        /// <summary>
+        /// This class manages event handlers of the privilege permission requests.
+        /// This class enables having event handlers for an individual privilege.
+        /// </summary>
+        public class ResponseContext
+        {
+            private string _privilege;
+
+            internal ResponseContext(string privilege)
+            {
+                _privilege = privilege;
+            }
+            /// <summary>
+            /// Occurs when the response for a permission request is fetched.
+            /// </summary>
+            /// <exception cref="System.InvalidOperationException">Thrown when the bundle instance has been disposed.</exception>
+            public event EventHandler<RequestResponseEventArgs> ResponseFetched
+            {
+                add
+                {
+                    _ResponseFetched += value;
+                }
+
+                remove
+                {
+                    _ResponseFetched -= value;
+                    if (_ResponseFetched == null)
+                    {
+                        s_responseMap.Remove(_privilege);
+                    }
+                }
+            }
+
+            private event EventHandler<RequestResponseEventArgs> _ResponseFetched;
+
+            internal void FireEvent(CallCause _cause, RequestResult _result)
+            {
+                _ResponseFetched?.Invoke(null, new RequestResponseEventArgs() { cause = _cause, result = _result, privilege = _privilege });
+            }
+        }
+    }
+
+    internal static class PrivacyPrivilegeManagerErrorFactory
+    {
+        static internal Exception GetException(int error)
+        {
+            Interop.PrivacyPrivilegeManager.ErrorCode errCode = (Interop.PrivacyPrivilegeManager.ErrorCode)error;
+            switch(errCode)
+            {
+                case Interop.PrivacyPrivilegeManager.ErrorCode.InvalidParameter:
+                    return new ArgumentException("Invalid parameter");
+                case Interop.PrivacyPrivilegeManager.ErrorCode.IoError:
+                    return new System.IO.IOException("I/O Error");
+                case Interop.PrivacyPrivilegeManager.ErrorCode.OutOfMemory:
+                    return new OutOfMemoryException("Out of memory");
+                case Interop.PrivacyPrivilegeManager.ErrorCode.Unknown:
+                default:
+                    return new ArgumentException("Unknown error");
+            }
+        }
+    }
+}
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/RequestResponseEventArgs.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/RequestResponseEventArgs.cs
new file mode 100644 (file)
index 0000000..5f50b6c
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.Security
+{
+    /// <summary>
+    /// This class is an event argument of the RequestResponse event.
+    /// </summary>
+
+    public class RequestResponseEventArgs : EventArgs
+    {
+        /// <summary>
+        /// The cause of a triggered response.
+        /// </summary>
+        public CallCause cause { get; internal set; }
+
+        /// <summary>
+        /// The result of a permission request.
+        /// </summary>
+        public RequestResult result { get; internal set; }
+
+        /// <summary>
+        /// The privilege for which a permission was requested for.
+        /// </summary>
+        public string privilege { get; internal set; }
+    }
+}
diff --git a/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/RequestResult.cs b/src/Tizen.Security.PrivacyPrivilegeManager/Tizen.Security/RequestResult.cs
new file mode 100644 (file)
index 0000000..f87f77e
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Tizen.Security
+{
+    /// <summary>
+    /// Enumeration for the result of a permission request.
+    /// </summary>
+    /// <since_tizen> 4 </since_tizen>
+    public enum RequestResult
+    {
+        /// <summary>
+        /// The privilege is allowed permanently.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        AllowForever = Interop.PrivacyPrivilegeManager.RequestResult.AllowForever,
+        /// <summary>
+        /// The privilege is denied permanently.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        DenyForever = Interop.PrivacyPrivilegeManager.RequestResult.DenyForever,
+        /// <summary>
+        /// The privilege is denied temporarily.
+        /// </summary>
+        /// <since_tizen> 4 </since_tizen>
+        DenyOnce = Interop.PrivacyPrivilegeManager.RequestResult.DenyOnce,
+    }
+}
index 52c612b..858097f 100644 (file)
@@ -114,6 +114,8 @@ namespace Tizen.Security.TEEC
         /// This property represents the shared memory size in bytes.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         public UInt32 Size
         {
             get { return shm.size; }
@@ -122,6 +124,8 @@ namespace Tizen.Security.TEEC
         /// This property represents the start address of the shared memory block.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         public IntPtr Address
         {
             get { return shm.buffer; }
@@ -132,6 +136,8 @@ namespace Tizen.Security.TEEC
         /// For large buffers, the direct address should be used.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         /// <param name="data">The source data buffer to copy data from.</param>
         /// <param name="dstOffs">The starting offset in the destination shared memory.</param>
         /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
@@ -145,6 +151,8 @@ namespace Tizen.Security.TEEC
         /// For large buffers, the direct address should be used.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         /// <param name="data">The destination data buffer to copy data into.</param>
         /// <param name="srcOffs">The starting offset in the source shared memory.</param>
         /// <exception cref="InvalidOperationException">The operation is invalid.</exception>
@@ -229,6 +237,8 @@ namespace Tizen.Security.TEEC
         /// Constructs a parameter object which holds information about the registered memory shared with TA.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         /// <param name="parent">The shared memory - registered or allocated.</param>
         /// <param name="size">The size of the buffer part.</param>
         /// <param name="offset">The offset of the buffer in the shared memory.</param>
@@ -244,16 +254,22 @@ namespace Tizen.Security.TEEC
         /// This property represents the shared memory that is referred to.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         public SharedMemory Parent { get; }
         /// <summary>
         /// This property represents the size (in bytes) of the shared memory.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         public uint Size { get; internal set; }
         /// <summary>
         /// This property represents the offset (in bytes) from the start of the shared memory.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        /// <privilege>http://tizen.org/privilege/tee.client</privilege>
+        /// <privlevel>partner</privlevel>
         public uint Offset { get; }
     };
 
index dccc4ba..f47c0a8 100755 (executable)
@@ -19,6 +19,10 @@ using System.ComponentModel;
 
 namespace Tizen.System
 {
+    /// <summary>
+    /// The SystemInfo class provides static system feature.
+    /// Please use Tizen.System.Information class. Information class supports same function.
+    /// </summary>
     [Obsolete("Use class Tizen.System.Information")]
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class SystemInfo