-
Notifications
You must be signed in to change notification settings - Fork 277
[TCSACR-655] Expose Session API to public #7705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,7 +28,7 @@ namespace Tizen.System | |||||||
| /// <summary> | ||||||||
| /// Provides methods to manage subsession users. Allows to register for events triggered by operations on subsession users. | ||||||||
| /// </summary> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public sealed class Session | ||||||||
|
mbloch1 marked this conversation as resolved.
|
||||||||
| { | ||||||||
| /// <summary> | ||||||||
|
|
@@ -40,13 +40,13 @@ public sealed class Session | |||||||
| /// <summary> | ||||||||
| /// Maximum length of any given user ID. | ||||||||
| /// </summary> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public const int MaxUserLength = 20; | ||||||||
|
|
||||||||
| /// <summary> | ||||||||
| /// Special subsession ID, which is always present and does not represent any user. | ||||||||
| /// </summary> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public const string EmptyUser = ""; | ||||||||
|
|
||||||||
| private static ConcurrentDictionary<int, Session> s_sessionInstances = new ConcurrentDictionary<int, Session>(); | ||||||||
|
|
@@ -77,7 +77,7 @@ private Session(int sessionUID) | |||||||
| /// <remarks> | ||||||||
| /// To ensure thread safety, explicit creation of Session object is not allowed. | ||||||||
| /// </remarks> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public static Session GetInstance(int sessionUID) | ||||||||
| { | ||||||||
| if (!s_sessionInstances.ContainsKey(sessionUID)) | ||||||||
|
|
@@ -88,7 +88,7 @@ public static Session GetInstance(int sessionUID) | |||||||
| /// <summary> | ||||||||
| /// Gets session UID of this session object. | ||||||||
| /// </summary> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public int SessionUID { get; private set; } | ||||||||
|
|
||||||||
| /// <summary> | ||||||||
|
|
@@ -107,7 +107,7 @@ public static Session GetInstance(int sessionUID) | |||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [AI Review]
Suggested change
|
||||||||
| public IReadOnlyList<string> GetUsers() | ||||||||
| { | ||||||||
|
|
||||||||
|
|
@@ -137,7 +137,7 @@ public IReadOnlyList<string> GetUsers() | |||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [AI Review]
Suggested change
|
||||||||
| public string GetCurrentUser() | ||||||||
| { | ||||||||
| StringBuilder user = new StringBuilder(MaxUserLength); | ||||||||
|
|
@@ -286,13 +286,13 @@ public Task SubsessionSwitchUserAsync(string userName) | |||||||
| /// <param name="subsessionEventArgs">Event argument of the event (obtained from said event)</param> | ||||||||
| /// <remarks> | ||||||||
| /// This method is assumed to be called from an event handler. You can only mark an event as completed | ||||||||
| /// if you registered for in in the same process. | ||||||||
| /// if you registered for it in the same process. | ||||||||
| /// </remarks> | ||||||||
| /// <exception cref="ArgumentException">Session UID of this object is invalid</exception> | ||||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public void SubsessionEventMarkAsDone(SubsessionEventArgs subsessionEventArgs) | ||||||||
| { | ||||||||
| SessionError ret = Interop.Session.SubsessionEventWaitDone(subsessionEventArgs.SessionInfo); | ||||||||
|
|
@@ -318,7 +318,7 @@ private void OnAddUserWait(SubsessionEventInfoNative infoNative, IntPtr data) | |||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public event EventHandler<AddUserEventArgs> AddUserWait | ||||||||
|
mbloch1 marked this conversation as resolved.
mbloch1 marked this conversation as resolved.
|
||||||||
| { | ||||||||
| add | ||||||||
|
|
@@ -360,7 +360,7 @@ private void OnRemoveUserWait(SubsessionEventInfoNative infoNative, IntPtr data) | |||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public event EventHandler<RemoveUserEventArgs> RemoveUserWait | ||||||||
|
mbloch1 marked this conversation as resolved.
|
||||||||
| { | ||||||||
| add | ||||||||
|
|
@@ -402,7 +402,7 @@ private void OnSwitchUserWait(SubsessionEventInfoNative infoNative, IntPtr data) | |||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public event EventHandler<SwitchUserWaitEventArgs> SwitchUserWait | ||||||||
|
mbloch1 marked this conversation as resolved.
|
||||||||
| { | ||||||||
| add | ||||||||
|
|
@@ -444,7 +444,7 @@ private void OnSwitchUserCompletion(SubsessionEventInfoNative infoNative, IntPtr | |||||||
| /// <exception cref="IOException">Internal error</exception> | ||||||||
| /// <exception cref="UnauthorizedAccessException">Not permitted</exception> | ||||||||
| /// <exception cref="NotSupportedException">Not supported</exception> | ||||||||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||||||||
| /// <since_tizen>10.1</since_tizen> | ||||||||
| public event EventHandler<SwitchUserCompletionEventArgs> SwitchUserCompleted | ||||||||
|
mbloch1 marked this conversation as resolved.
|
||||||||
| { | ||||||||
| add | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.