From a9da8c9f16c1ae69c52f11eba85489407db21268 Mon Sep 17 00:00:00 2001 From: DotnetBuild Date: Thu, 12 Oct 2017 00:00:28 +0900 Subject: [PATCH] Release 4.0.0-preview1-00286 --- packaging/csapi-tizenfx.spec | 4 +- .../Interop/Interop.AttachPanel.cs | 6 ++ .../Interop/Interop.Libraries.cs | 6 ++ .../Tizen.Applications.AttachPanel.csproj | 1 + .../Tizen.Applications.AttachPanel.sln | 14 ++- .../Tizen.Applications.AttachPanel/AttachPanel.cs | 86 ++++++++++++---- .../AttachPanelInternal.cs | 20 ++-- .../ResultEventArgs.cs | 40 ++++---- .../StateEventArgs.cs | 32 ++---- .../Notification.cs | 8 +- .../NotificationManager.cs | 12 +++ .../NotificationSafeHandle.cs | 10 ++ .../NotificationEventArgs.cs | 7 ++ .../NotificationEventArgsStyle.cs | 3 + .../NotificationListenerManager.cs | 9 ++ src/Tizen.Security.TEEC/Interop/Interop.Types.cs | 34 +++++-- .../Tizen.Security.TEEC/Libteec.cs | 110 ++++++++++++++++++--- 17 files changed, 305 insertions(+), 97 deletions(-) diff --git a/packaging/csapi-tizenfx.spec b/packaging/csapi-tizenfx.spec index 63703bc..020ef7e 100644 --- a/packaging/csapi-tizenfx.spec +++ b/packaging/csapi-tizenfx.spec @@ -9,7 +9,7 @@ Name: csapi-tizenfx Summary: Assemblies of Tizen .NET -Version: 4.0.0.285 +Version: 4.0.0.286 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-00285 +./build.sh --pack 4.0.0-preview1-00286 %install mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH} diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs index 3718191..6d0d864 100755 --- a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs +++ b/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs @@ -2,8 +2,14 @@ using System; using System.Runtime.InteropServices; using Tizen.Applications; +/// +/// Interoperability support class for Tizen APIs +/// internal static partial class Interop { + /// + /// Interoperability support class for the attach panel APIs + /// internal static partial class AttachPanel { internal enum ErrorCode : int diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs index 4b4049b..b0f7efa 100755 --- a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs +++ b/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs @@ -1,5 +1,11 @@ +/// +/// Interoperability support class for the attach panel APIs +/// internal static partial class Interop { + /// + /// Interoperability support class for the API library + /// internal static partial class Libraries { public const string AttachPanel = "libattach-panel.so.0.1.0"; diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj index 020b2cb..b16fa50 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj @@ -5,6 +5,7 @@ + diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln index 8eeff18..644bd5d 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln @@ -1,9 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 +VisualStudioVersion = 15.0.26730.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.AttachPanel", "Tizen.Applications.AttachPanel.csproj", "{C8C93D46-CACE-4BF1-8B50-6A6A00967045}" + ProjectSection(ProjectDependencies) = postProject + {AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C} = {AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{D2B5F854-4FE1-473C-A8E3-53ABB0A966AA}" EndProject @@ -11,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,8 +38,15 @@ Global {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Debug|Any CPU.Build.0 = Debug|Any CPU {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Release|Any CPU.Build.0 = Release|Any CPU + {AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF2CEEB1-B3B2-4E2D-8854-A54871CD0D1C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7169FEAE-EE0D-4B29-B710-F504A6B82E8C} + EndGlobalSection EndGlobal diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs index 3c220bd..33c777b 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs @@ -1,3 +1,4 @@ +using ElmSharp; using System; namespace Tizen.Applications.AttachPanel @@ -14,15 +15,49 @@ namespace Tizen.Applications.AttachPanel /// The caller's conformant /// Thrown when an attempt to allocate memory fails. /// Thrown when the AttachPanel is already exist or the is not a conformant object - public AttachPanel(IntPtr conformant) + public AttachPanel(EvasObject conformant) { if (conformant == IntPtr.Zero) { throw new ArgumentNullException("Use the value property, not null value"); } + + IntPtr candidateAttachPanel = new IntPtr(); + Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.CreateAttachPanel(conformant, ref candidateAttachPanel); + CheckException(err); + + Tizen.Log.Debug("AttachPanelSharp", "Success to create an AttachPanel Instance"); + isCreationSucceed = true; + _attachPanel = candidateAttachPanel; + + if (_eventEventHandler == null) + { + StateEventListenStart(); + } + + if (_resultEventHandler == null) + { + ResultEventListenStart(); + } + } + + /// + /// Represents immutable class for attach panel. + /// + /// 3 + /// The caller's conformant + /// Thrown when an attempt to allocate memory fails. + /// Thrown when the AttachPanel is already exist or the is not a conformant object + public AttachPanel(Conformant conformant) + { + if (conformant == IntPtr.Zero) + { + throw new ArgumentNullException("Use the value property, not null value"); + } + IntPtr candidateAttachPanel = new IntPtr(); Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.CreateAttachPanel(conformant, ref candidateAttachPanel); - checkException(err); + CheckException(err); Tizen.Log.Debug("AttachPanelSharp", "Success to create an AttachPanel Instance"); isCreationSucceed = true; @@ -48,7 +83,7 @@ namespace Tizen.Applications.AttachPanel _attachPanel != IntPtr.Zero) { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.DestroyAttachPanel(_attachPanel); - checkException(err); + CheckException(err); _attachPanel = IntPtr.Zero; } } @@ -57,13 +92,14 @@ namespace Tizen.Applications.AttachPanel /// Gets the state of the AttachPanel. /// /// The AttachPanel window state - public int State + public StateType State { get { - int state; - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetState(_attachPanel, out state); - checkException(err); + int interopState; + Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetState(_attachPanel, out interopState); + CheckException(err); + StateType state = (StateType)Enum.ToObject(typeof(StateType), interopState); return state; } } @@ -72,14 +108,14 @@ namespace Tizen.Applications.AttachPanel /// Gets the value that indicates whether the AttachPanel is visible. /// /// visible value of AttachPanel state - public int Visible + public bool Visible { get { int visible; Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetVisibility(_attachPanel, out visible); - checkException(err); - return visible; + CheckException(err); + return (visible == 1); } } @@ -121,8 +157,9 @@ namespace Tizen.Applications.AttachPanel { bundle = extraData.SafeBundleHandle.DangerousGetHandle(); } + Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.AddCategory(_attachPanel, (int)category, bundle); - checkException(err); + CheckException(err); } /// @@ -134,7 +171,7 @@ namespace Tizen.Applications.AttachPanel public void RemoveCategory(ContentCategory category) { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.RemoveCategory(_attachPanel, (int)category); - checkException(err); + CheckException(err); } /// @@ -147,9 +184,9 @@ namespace Tizen.Applications.AttachPanel /// Thrown when an attempt to allocate memory fails. public void SetExtraData(ContentCategory category, Bundle extraData) { - if(extraData == null) + if (extraData == null) { - checkException(Interop.AttachPanel.ErrorCode.InvalidParameter); + CheckException(Interop.AttachPanel.ErrorCode.InvalidParameter); } IntPtr bundle = IntPtr.Zero; @@ -157,8 +194,9 @@ namespace Tizen.Applications.AttachPanel { bundle = extraData.SafeBundleHandle.DangerousGetHandle(); } + Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.SetExtraData(_attachPanel, (int)category, bundle); - checkException(err); + CheckException(err); } /// @@ -168,24 +206,25 @@ namespace Tizen.Applications.AttachPanel public void Show() { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel); - checkException(err); + CheckException(err); } /// /// Shows the attach panel and selects whether or not to animate /// + /// A flag which turn on or turn off the animation while attach panel showing. /// Thrown when the AttachPanel is destroyed public void Show(bool animation) { if (animation) { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel); - checkException(err); + CheckException(err); } else { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.ShowWithoutAnimation(_attachPanel); - checkException(err); + CheckException(err); } } @@ -196,24 +235,25 @@ namespace Tizen.Applications.AttachPanel public void Hide() { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel); - checkException(err); + CheckException(err); } /// /// Hides the attach panel and selects whether or not to animate /// + /// A flag which turn on or turn off the animation while attach panel hiding. /// Thrown when the AttachPanel is destroyed public void Hide(bool animation) { if (animation) { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel); - checkException(err); + CheckException(err); } else { Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.HideWithoutAnimation(_attachPanel); - checkException(err); + CheckException(err); } } @@ -228,8 +268,10 @@ namespace Tizen.Applications.AttachPanel { StateEventListenStart(); } + _eventEventHandler += value; } + remove { _eventEventHandler -= value; @@ -251,8 +293,10 @@ namespace Tizen.Applications.AttachPanel { ResultEventListenStart(); } + _resultEventHandler += value; } + remove { _resultEventHandler -= value; diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs index e40af2d..7eaa1be 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs @@ -3,6 +3,9 @@ using System.Collections.Generic; namespace Tizen.Applications.AttachPanel { + /// + /// Attach panel internal implementation + /// public partial class AttachPanel { private static IntPtr _attachPanel; @@ -20,16 +23,17 @@ namespace Tizen.Applications.AttachPanel SetEventListener = (attachPanel, eventType, eventInfo, userData) => { - _eventEventHandler?.Invoke(null, new StateEventArgs(attachPanel, (EventType)eventType, eventInfo, userData)); + _eventEventHandler?.Invoke(null, new StateEventArgs((EventType)eventType)); }; err = Interop.AttachPanel.SetEventCb(_attachPanel, SetEventListener, IntPtr.Zero); - checkException(err); + CheckException(err); } + private void StateEventListenStop() { Interop.AttachPanel.ErrorCode err = 0; - err = Interop.AttachPanel.UnsetEventCb(_attachPanel); - checkException(err); + err = Interop.AttachPanel.UnsetEventCb(_attachPanel); + CheckException(err); } private void ResultEventListenStart() @@ -39,20 +43,20 @@ namespace Tizen.Applications.AttachPanel { SafeAppControlHandle handle = new SafeAppControlHandle(resulthandler, false); AppControl result = new AppControl(handle); - _resultEventHandler?.Invoke(null, new ResultEventArgs(attachPanel, (ContentCategory)category, result, (AppControlReplyResult)resultCode, userData)); + _resultEventHandler?.Invoke(null, new ResultEventArgs((ContentCategory)category, result, (AppControlReplyResult)resultCode)); }; err = Interop.AttachPanel.SetResultCb(_attachPanel, SetResultListener, IntPtr.Zero); - checkException(err); + CheckException(err); } private void ResultEventListenStop() { Interop.AttachPanel.ErrorCode err = 0; err = Interop.AttachPanel.UnsetResultCb(_attachPanel); - checkException(err); + CheckException(err); } - internal static void checkException(Interop.AttachPanel.ErrorCode err) + internal static void CheckException(Interop.AttachPanel.ErrorCode err) { switch (err) { diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs index 6628b9d..9c933d7 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs @@ -7,45 +7,49 @@ namespace Tizen.Applications.AttachPanel /// public class ResultEventArgs : EventArgs { - private readonly IntPtr _attachPanel; private readonly ContentCategory _category; private readonly AppControl _result; private readonly AppControlReplyResult _resultCode; - private readonly IntPtr _userData; - internal ResultEventArgs(IntPtr attachPanel, ContentCategory category, AppControl result, AppControlReplyResult resultCode, IntPtr userData) + internal ResultEventArgs(ContentCategory category, AppControl result, AppControlReplyResult resultCode) { - _attachPanel = attachPanel; _category = category; _result = result; _resultCode = resultCode; - _userData = userData; } /// - /// Property for attach panel object. - /// - public IntPtr AttachPanel { get { return _attachPanel; } } - - /// /// Results are from the content category. /// - public ContentCategory Category { get { return _category; } } + public ContentCategory Category + { + get + { + return _category; + } + } /// /// Property for result /// The caller app has to use ExtraData property to get received data. /// - public AppControl Result { get { return _result; } } + public AppControl Result + { + get + { + return _result; + } + } /// /// Property for result of AppControl /// - public AppControlReplyResult ResultCode { get { return _resultCode; } } - - /// - /// Property for user data - /// - public IntPtr UserData { get { return _userData; } } + public AppControlReplyResult ResultCode + { + get + { + return _resultCode; + } + } } } diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs index 5354c5f..4373e27 100755 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs +++ b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs @@ -7,38 +7,22 @@ namespace Tizen.Applications.AttachPanel /// public class StateEventArgs : EventArgs { - private readonly IntPtr _attachPanel; private readonly EventType _eventType; - private readonly IntPtr _eventInfo; - private readonly IntPtr _userData; - internal StateEventArgs(IntPtr attachPanel, EventType eventType, IntPtr eventInfo, IntPtr userData) + internal StateEventArgs(EventType eventType) { - _attachPanel = attachPanel; _eventType = eventType; - _eventInfo = eventInfo; - _userData = userData; } /// - /// Property for attach panel object - /// - public IntPtr AttachPanel { get { return _attachPanel; } } - - /// /// Property for event type. /// - public EventType EventType { get { return _eventType; } } - - /// - /// Additional event information. - /// This can be NULL if there are no necessary information. - /// - public IntPtr EventInfo { get { return _eventInfo; } } - - /// - /// Property for user data. - /// - public IntPtr UserData { get { return _userData; } } + public EventType EventType + { + get + { + return _eventType; + } + } } } diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs index 4f0a97a..8c12f40 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs @@ -60,14 +60,14 @@ namespace Tizen.Applications.Notifications /// /// Gets or sets the icon of notification. - /// You should set an absolute path for an image file. + /// You should set an absolute path for an image file. /// public string Icon { get; set; } = string.Empty; /// /// Gets or sets the sub icon of notification. /// This SubIcon is displayed in Icon you set. - /// You should set an absolute path for an image file. + /// You should set an absolute path for an image file. /// public string SubIcon { get; set; } = string.Empty; @@ -128,6 +128,10 @@ namespace Tizen.Applications.Notifications } } + /// + /// Gets or sets a value indicating whether the notification is Onging or not. + /// Default value is false. + /// [EditorBrowsable(EditorBrowsableState.Never)] public bool IsOngoing { get; set; } = false; diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs index 84758f2..59e5711 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs @@ -451,6 +451,12 @@ namespace Tizen.Applications.Notifications return state; } + /// + /// Make a NotificationSafeHandle from Notification. + /// + /// The Notification class. + /// The NotificationSafeHandle class. + /// Thrown when an argument is invalid. [EditorBrowsable(EditorBrowsableState.Never)] public static NotificationSafeHandle MakeNotificationSafeHandle(Notification notification) { @@ -464,6 +470,12 @@ namespace Tizen.Applications.Notifications return notification.Handle; } + /// + /// Make a Notification from NotificationSafeHandle. + /// + /// The NotificationSafeHandle class. + /// The Notification class. + /// Thrown when an argument is invalid. [EditorBrowsable(EditorBrowsableState.Never)] public static Notification MakeNotification(NotificationSafeHandle handle) { diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs index 28ce60a..deb503d 100755 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs +++ b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs @@ -20,9 +20,15 @@ namespace Tizen.Applications.Notifications using System.ComponentModel; using System.Runtime.InteropServices; + /// + /// This class manages the notification handle resources. + /// [EditorBrowsable(EditorBrowsableState.Never)] public sealed class NotificationSafeHandle : SafeHandle { + /// + /// Initializes a new instance of the NotificationSafeHandle class. + /// [EditorBrowsable(EditorBrowsableState.Never)] public NotificationSafeHandle() : base(IntPtr.Zero, true) @@ -43,6 +49,10 @@ namespace Tizen.Applications.Notifications get { return this.DangerousGetHandle() == IntPtr.Zero; } } + /// + /// Executes the code required to free the NotificationSafeHandle. + /// + /// protected override bool ReleaseHandle() { Interop.Notification.Destroy(this.handle); diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs index 140ab96..88221b3 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs @@ -93,6 +93,9 @@ namespace Tizen.Applications.NotificationEventListener /// public string Tag { get; internal set; } + /// + /// Gets a value indicating whether the notification is Onging or not. + /// [EditorBrowsable(EditorBrowsableState.Never)] public bool IsOngoing { get; internal set; } = false; @@ -102,6 +105,10 @@ namespace Tizen.Applications.NotificationEventListener /// public bool IsVisible { get; internal set; } = true; + /// + /// Gets the event flag. + /// If this flag is true, you can do SendEvent. + /// [EditorBrowsable(EditorBrowsableState.Never)] public bool HasEventFlag { get; internal set; } = false; diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs index 69af7d2..9438f81 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs @@ -21,6 +21,9 @@ namespace Tizen.Applications.NotificationEventListener /// public partial class NotificationEventArgs { + /// + /// An object can get a rich notification style to a notification object. + /// public abstract class StyleArgs { internal abstract string Key { get; } diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs index 4d6f582..dd86791 100755 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs +++ b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs @@ -402,6 +402,15 @@ namespace Tizen.Applications.NotificationEventListener return list; } + /// + /// Sends occured event from viewer application to the notification owner. + /// + /// The unique number of the notification. + /// Event type on notification. + /// Thrown in case of an invalid parameter. + /// Thrown in case of a permission is denied. + /// Thrown in case of any internal error. + /// http://tizen.org/privilege/notification [EditorBrowsable(EditorBrowsableState.Never)] public static void SendEvent(int uniqueNumber, UserEventType type) { diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Types.cs b/src/Tizen.Security.TEEC/Interop/Interop.Types.cs index 86432d3..ece1f6d 100644 --- a/src/Tizen.Security.TEEC/Interop/Interop.Types.cs +++ b/src/Tizen.Security.TEEC/Interop/Interop.Types.cs @@ -57,27 +57,45 @@ internal static partial class Interop } [StructLayout(LayoutKind.Sequential)] - internal struct sTEEC_SharedMemoryImp + internal class TEEC_SharedMemory { - public IntPtr context; - public IntPtr context_imp; + public IntPtr buffer; + public UInt32 size; public UInt32 flags; - public UInt32 memid; + public IntPtr imp; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct TEEC_Value + { + public UInt32 a; + public UInt32 b; } [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_SharedMemory + internal struct TEEC_TempMemoryReference { public IntPtr buffer; public UInt32 size; - public UInt32 flags; } [StructLayout(LayoutKind.Sequential)] + internal struct TEEC_RegisteredMemoryReference + { + public TEEC_SharedMemory parent; + public UInt32 size; + public UInt32 offset; + } + + [StructLayout(LayoutKind.Explicit)] internal struct TEEC_Parameter { - public UInt32 a; - public UInt32 b; + [FieldOffset(0)] + public TEEC_TempMemoryReference tmpref; + [FieldOffset(0)] + public TEEC_RegisteredMemoryReference memref; + [FieldOffset(0)] + public TEEC_Value value; } [StructLayout(LayoutKind.Sequential)] diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs index 8b39e79..52c612b 100644 --- a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs +++ b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs @@ -216,7 +216,7 @@ namespace Tizen.Security.TEEC /// This property represents the size of the buffer. /// /// 3 - public uint Size { get; } + public uint Size { get; internal set; } }; /// @@ -249,7 +249,7 @@ namespace Tizen.Security.TEEC /// This property represents the size (in bytes) of the shared memory. /// /// 3 - public uint Size { get; } + public uint Size { get; internal set; } /// /// This property represents the offset (in bytes) from the start of the shared memory. /// @@ -281,12 +281,12 @@ namespace Tizen.Security.TEEC /// This property represents an unsigned integer A. /// /// 3 - public uint A { get; } + public uint A { get; internal set; } /// /// This property represents an unsigned integer B. /// /// 3 - public uint B { get; } + public uint B { get; internal set; } }; @@ -304,20 +304,90 @@ namespace Tizen.Security.TEEC this.session = new Interop.TEEC_Session(); } + /// + /// Destructor of the class. + /// ~Session() { Close(); } + internal UInt32 InitParam(ref Interop.TEEC_Parameter dst, Parameter src) + { + switch (src.NativeType) { + case (int)TEFValueType.Input: + case (int)TEFValueType.Output: + case (int)TEFValueType.InOut: + dst.value.a = ((Value)src).A; + dst.value.b = ((Value)src).B; + break; + + case (int)TEFTempMemoryType.Input: + case (int)TEFTempMemoryType.Output: + case (int)TEFTempMemoryType.InOut: + dst.tmpref.buffer = ((TempMemoryReference)src).Buffer; + dst.tmpref.size = ((TempMemoryReference)src).Size; + break; + + case (int)TEFRegisteredMemoryType.Whole: + case (int)TEFRegisteredMemoryType.PartialInput: + case (int)TEFRegisteredMemoryType.PartialOutput: + case (int)TEFRegisteredMemoryType.PartialInOut: + dst.memref.parent = ((RegisteredMemoryReference)src).Parent.shm; + dst.memref.size = ((RegisteredMemoryReference)src).Size; + dst.memref.offset = ((RegisteredMemoryReference)src).Offset; + break; + + default: return 0; + } + return src.NativeType; + } + + internal void UpdateParam(Interop.TEEC_Parameter src, ref Parameter dst) + { + switch (dst.NativeType) { + case (int)TEFValueType.Input: + case (int)TEFValueType.Output: + case (int)TEFValueType.InOut: + ((Value)dst).A = src.value.a; + ((Value)dst).B = src.value.b; + break; + + case (int)TEFTempMemoryType.Input: + case (int)TEFTempMemoryType.Output: + case (int)TEFTempMemoryType.InOut: + ((TempMemoryReference)dst).Size = src.tmpref.size; + break; + + case (int)TEFRegisteredMemoryType.Whole: + case (int)TEFRegisteredMemoryType.PartialInput: + case (int)TEFRegisteredMemoryType.PartialOutput: + case (int)TEFRegisteredMemoryType.PartialInOut: + ((RegisteredMemoryReference)dst).Size = src.memref.size; + break; + + default: break; + } + } + internal void Open(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist) { Interop.TEEC_UUID uuid = Interop.TEEC_UUID.ToTeecUuid(destination); Interop.TEEC_Operation op = new Interop.TEEC_Operation(); - uint ro; + op.started=0; + op.paramTypes=0; + for (int i=0; i < 4 && i < paramlist.Length; ++i) { + op.paramTypes |= InitParam(ref op.paramlist[i], paramlist[i]) << (4*i); + } + + uint ro; int ret = Interop.Libteec.OpenSession(ref context, ref session, ref uuid, loginMethod, connectionData, ref op, out ro); //MAYBE map origin of return code to specyfic Exception Interop.CheckNThrowException(ret, string.Format("OpenSession('{0}')", destination)); + for (int i=0; i < 4 && i < paramlist.Length; ++i) { + UpdateParam(op.paramlist[i], ref paramlist[i]); + } } /// @@ -358,16 +428,17 @@ namespace Tizen.Security.TEEC Interop.TEEC_Operation op = new Interop.TEEC_Operation(); op.started=0; op.paramTypes=0; - - for (int i=0; i < 4; ++i) { - Parameter p = paramlist[i]; - //TODO fill TEEC_Operation struct + for (int i=0; i < 4 && i < paramlist.Length; ++i) { + op.paramTypes |= InitParam(ref op.paramlist[i], paramlist[i]) << (4*i); } uint ro; int ret = Interop.Libteec.InvokeCommand(ref session, commandID, ref op, out ro); //MAYBE map origin of return code to specific Exception Interop.CheckNThrowException(ret, string.Format("InvokeCommand({0})", commandID)); + for (int i=0; i < 4 && i < paramlist.Length; ++i) { + UpdateParam(op.paramlist[i], ref paramlist[i]); + } } /// @@ -417,10 +488,21 @@ namespace Tizen.Security.TEEC context = new Interop.TEEC_Context(); if (name != null && name.Length == 0) name = null; - int ret = Interop.Libteec.InitializeContext(name, ref context); - Interop.CheckNThrowException(ret, string.Format("InititalizeContext('{0}')", name)); + try { + int ret = Interop.Libteec.InitializeContext(name, ref context); + Interop.CheckNThrowException(ret, string.Format("InititalizeContext('{0}')", name)); + } + catch (global::System.DllNotFoundException e) + { + unchecked { + Interop.CheckNThrowException((int)Interop.LibteecError.NotImplemented, "Not found: " + e.Message); + } + } } + /// + /// Destructor of the class. + /// ~Context() { Dispose(); @@ -434,8 +516,10 @@ namespace Tizen.Security.TEEC /// partner /// http://tizen.org/feature/security.tee public void Dispose() { - Interop.Libteec.FinalizeContext(ref context); - //context.imp = null; + try { + Interop.Libteec.FinalizeContext(ref context); + } + catch (global::System.DllNotFoundException) { } } /// -- 2.7.4