From 18fd8db63aae791a2062500ba126cd962194abf8 Mon Sep 17 00:00:00 2001 From: Yunhee Seo Date: Wed, 8 Nov 2023 13:58:33 +0900 Subject: [PATCH] [System.Feedback] Change feedback theme api name index to id As policies dealing with feedback themes have changed from index to id-base selection, API naming also changed from index to id. Feedback themes are no longer treated sequentially, also not dependent on index. It is managed through a unique id. Signed-off-by: Yunhee Seo --- src/Tizen.System.Feedback/Feedback/Feedback.cs | 36 +++++++++++----------- .../Interop/Interop.Feedback.cs | 8 ++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Tizen.System.Feedback/Feedback/Feedback.cs b/src/Tizen.System.Feedback/Feedback/Feedback.cs index daaf66b..fc5a8ae 100755 --- a/src/Tizen.System.Feedback/Feedback/Feedback.cs +++ b/src/Tizen.System.Feedback/Feedback/Feedback.cs @@ -595,35 +595,35 @@ namespace Tizen.System } /// - /// Gets the index of theme selected. + /// Gets the id of theme selected. /// /// /// Now this internal API works for FeedbackType.Sound only, FeedbackType.Vibration is not supported. - /// Index of theme range will be 1 ~ N according to conf file. + /// The theme id is positive value as defined in the conf file. /// /// 10 /// The feedback type. - /// The index of theme selected as default theme according to feedback type. + /// The id of theme selected as default theme according to feedback type. /// Thrown when failed because of an invalid arguament. /// Thrown when failed becuase the device (haptic, sound) is not supported. /// Thrown when failed because of a system error. /// /// /// Feedback feedback = new Feedback(); - /// uint indexOfTheme = feedback. GetThemeIndexInternal(FeedbackType.Sound); + /// uint idOfTheme = feedback.GetThemeIdInternal(FeedbackType.Sound); /// /// [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetThemeIndexInternal(FeedbackType type) + public uint GetThemeIdInternal(FeedbackType type) { uint countOfTheme = 0; Interop.Feedback.FeedbackError res; - res = (Interop.Feedback.FeedbackError)Interop.Feedback.GetThemeIndexInternal((Interop.Feedback.FeedbackType)type, out countOfTheme); + res = (Interop.Feedback.FeedbackError)Interop.Feedback.GetThemeIdInternal((Interop.Feedback.FeedbackType)type, out countOfTheme); if (res != Interop.Feedback.FeedbackError.None) { - Log.Warn(LogTag, string.Format("Failed to get index of theme internal. err = {0}", res)); + Log.Warn(LogTag, string.Format("Failed to get id of theme internal. err = {0}", res)); switch (res) { case Interop.Feedback.FeedbackError.InvalidParameter: @@ -632,23 +632,23 @@ namespace Tizen.System throw new NotSupportedException("Device is not supported"); case Interop.Feedback.FeedbackError.OperationFailed: default: - throw new InvalidOperationException("Failed to get index of theme internal"); + throw new InvalidOperationException("Failed to get id of theme internal"); } } return countOfTheme; } /// - /// Sets the index of theme according to feedback type. + /// Sets the id of theme according to feedback type. /// /// /// Now this internal API works for FeedbackType.Sound only, FeedbackType.Vibration is not supported. - /// To set the index of theme for Sound type, the application should have http://tizen.org/privilege/systemsettings.admin privilege. - /// Index of theme range is 1 ~ N according to conf file. If you put the wrong index, operation cannot be guaranteed. + /// To set the id of theme for Sound type, the application should have http://tizen.org/privilege/systemsettings.admin privilege. + /// The theme id is positive value as defined in the conf file. /// /// 10 /// The feedback type. - /// The index of theme will be set. + /// The id of theme will be set. /// Thrown when failed because of an invalid arguament. /// Thrown when failed becuase the device (haptic, sound) is not supported. /// Thrown when failed because the access is not granted(No privilege) @@ -656,20 +656,20 @@ namespace Tizen.System /// /// /// Feedback feedback = new Feedback(); - /// uint indexOfTheme = 1; - /// feedback.SetThemeIndexInternal(FeedbackType.Sound, indexOfTheme); + /// uint idOfTheme = 1; + /// feedback.SetThemeIdInternal(FeedbackType.Sound, idOfTheme); /// /// [EditorBrowsable(EditorBrowsableState.Never)] - public void SetThemeIndexInternal(FeedbackType type, uint indexOfTheme) + public void SetThemeIdInternal(FeedbackType type, uint idOfTheme) { Interop.Feedback.FeedbackError res; - res = (Interop.Feedback.FeedbackError)Interop.Feedback.SetThemeIndexInternal((Interop.Feedback.FeedbackType)type, indexOfTheme); + res = (Interop.Feedback.FeedbackError)Interop.Feedback.SetThemeIdInternal((Interop.Feedback.FeedbackType)type, idOfTheme); if (res != Interop.Feedback.FeedbackError.None) { - Log.Warn(LogTag, string.Format("Failed to set index of theme internal. err = {0}", res)); + Log.Warn(LogTag, string.Format("Failed to set id of theme internal. err = {0}", res)); switch (res) { case Interop.Feedback.FeedbackError.InvalidParameter: @@ -680,7 +680,7 @@ namespace Tizen.System throw new UnauthorizedAccessException("Access is not granted"); case Interop.Feedback.FeedbackError.OperationFailed: default: - throw new InvalidOperationException("Failed to set index of theme internal"); + throw new InvalidOperationException("Failed to set id of theme internal"); } } } diff --git a/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs b/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs index 4cc34fd..0a4b4e8 100644 --- a/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs +++ b/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs @@ -59,11 +59,11 @@ internal static partial class Interop [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_count_of_theme_internal")] internal static extern int GetCountOfThemeInternal(FeedbackType type, out uint countOfTheme); - [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_theme_index_internal")] - internal static extern int GetThemeIndexInternal(FeedbackType type, out uint indexOfTheme); + [DllImport(Libraries.Feedback, EntryPoint = "feedback_get_theme_id_internal")] + internal static extern int GetThemeIdInternal(FeedbackType type, out uint idOfTheme); - [DllImport(Libraries.Feedback, EntryPoint = "feedback_set_theme_index_internal")] - internal static extern int SetThemeIndexInternal(FeedbackType type, uint indexOfTheme); + [DllImport(Libraries.Feedback, EntryPoint = "feedback_set_theme_id_internal")] + internal static extern int SetThemeIdInternal(FeedbackType type, uint idOfTheme); [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop_type_internal")] internal static extern int StopTypeInternal(FeedbackType type); -- 2.7.4