Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/Tizen.System.Session/Session/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
mbloch1 marked this conversation as resolved.
Comment thread
mbloch1 marked this conversation as resolved.
{
/// <summary>
Expand All @@ -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>();
Expand Down Expand Up @@ -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))
Expand All @@ -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>
Expand All @@ -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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [AI Review]
🔴 Critical: GetUsers() is now part of the public API surface (the [EditorBrowsable(...Never)] attribute was removed), but its XML doc is missing a <returns> tag for its non-void return value.

Suggested change
/// <since_tizen>10.1</since_tizen>
/// <returns>A read-only list of all subsession user IDs for this session.</returns>
/// <since_tizen>10.1</since_tizen>

public IReadOnlyList<string> GetUsers()
{

Expand Down Expand Up @@ -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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [AI Review]
🔴 Critical: GetCurrentUser() is now part of the public API surface (the [EditorBrowsable(...Never)] attribute was removed), but its XML doc is missing a <returns> tag for its non-void return value.

Suggested change
/// <since_tizen>10.1</since_tizen>
/// <returns>The currently active subsession user ID, or "" (EmptyUser) when no subsession is enabled.</returns>
/// <since_tizen>10.1</since_tizen>

public string GetCurrentUser()
{
StringBuilder user = new StringBuilder(MaxUserLength);
Expand Down Expand Up @@ -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);
Expand All @@ -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
Comment thread
mbloch1 marked this conversation as resolved.
Comment thread
mbloch1 marked this conversation as resolved.
{
add
Expand Down Expand Up @@ -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
Comment thread
mbloch1 marked this conversation as resolved.
{
add
Expand Down Expand Up @@ -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
Comment thread
mbloch1 marked this conversation as resolved.
{
add
Expand Down Expand Up @@ -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
Comment thread
mbloch1 marked this conversation as resolved.
{
add
Expand Down
34 changes: 17 additions & 17 deletions src/Tizen.System.Session/Session/SessionEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ namespace Tizen.System
/// You can check the event type that was invoked by checking a type of event arguments
/// during runtime - they all derive from this base class.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public abstract class SubsessionEventArgs : EventArgs
Comment thread
mbloch1 marked this conversation as resolved.
{
/// <summary>
/// Session UID of the session invoking the event
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public int SessionUID { get; internal set; }

internal SubsessionEventInfoNative SessionInfo { get; set; }
Expand All @@ -50,13 +50,13 @@ internal SubsessionEventArgs(SubsessionEventInfoNative eventInfo)
/// <summary>
/// An event argument type for AddUserWait event type
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public class AddUserEventArgs : SubsessionEventArgs
Comment thread
mbloch1 marked this conversation as resolved.
{
/// <summary>
/// Added subsession user ID
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// </summary>
/// <since_tizen>10.1</since_tizen>
public string UserName { get; internal set; }

internal AddUserEventArgs(SubsessionEventInfoNative eventInfo)
Expand All @@ -75,13 +75,13 @@ internal AddUserEventArgs(SubsessionEventInfoNative eventInfo)
/// <summary>
/// An event argument type for RemoveUserWait event type
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public class RemoveUserEventArgs : SubsessionEventArgs
Comment thread
mbloch1 marked this conversation as resolved.
{
/// <summary>
/// Removed subsession user ID
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// </summary>
/// <since_tizen>10.1</since_tizen>
public string UserName { get; internal set; }

internal RemoveUserEventArgs(SubsessionEventInfoNative eventInfo)
Expand All @@ -99,25 +99,25 @@ internal RemoveUserEventArgs(SubsessionEventInfoNative eventInfo)
/// <summary>
/// A generic base class for Switch event types
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public abstract class SwitchUserEventArgs : SubsessionEventArgs
Comment thread
mbloch1 marked this conversation as resolved.
{
/// <summary>
/// ID of this switch operation
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// </summary>
/// <since_tizen>10.1</since_tizen>
public long SwitchID { get; internal set; }

/// <summary>
/// Active subsession user ID before this switch operation
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// </summary>
/// <since_tizen>10.1</since_tizen>
public string UserNamePrev { get; internal set; }

/// <summary>
/// Active subsession ID after this switch operation
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// </summary>
/// <since_tizen>10.1</since_tizen>
public string UserNameNext { get; internal set; }

internal SwitchUserEventArgs(SubsessionEventInfoNative eventInfo)
Expand All @@ -141,7 +141,7 @@ internal SwitchUserEventArgs(SubsessionEventInfoNative eventInfo)
/// <summary>
/// An event argument type for SwitchUserWait event type
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public class SwitchUserWaitEventArgs : SwitchUserEventArgs
Comment thread
mbloch1 marked this conversation as resolved.
{
internal SwitchUserWaitEventArgs(SubsessionEventInfoNative eventInfo) : base(eventInfo) { }
Expand All @@ -150,7 +150,7 @@ internal SwitchUserWaitEventArgs(SubsessionEventInfoNative eventInfo) : base(eve
/// <summary>
/// An event argument type for SwitchUserCompleted event type
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <since_tizen>10.1</since_tizen>
public class SwitchUserCompletionEventArgs : SwitchUserEventArgs
Comment thread
mbloch1 marked this conversation as resolved.
{
internal SwitchUserCompletionEventArgs(SubsessionEventInfoNative eventInfo) : base(eventInfo) { }
Expand Down
Loading