}
}
+ /// <summary>
+ /// Indicates whether rotary event is enabled on the device.
+ /// </summary>
+ /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
+ /// <privlevel>platform</privlevel>
+ /// <feature>http://tizen.org/feature/systemsetting</feature>
+ /// <exception cref="NotSupportedException">Not Supported feature</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+ /// <remarks>
+ /// http://tizen.org/privilege/systemsettings.admin is needed only for setting value. When getting the value, it isn't needed.
+ /// </remarks>
+ /// <since_tizen> 6 </since_tizen>
+ public static bool RotaryEventEnabled
+ {
+ get
+ {
+ bool isRotaryEventEnabled;
+ SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.RotaryEventEnabled, out isRotaryEventEnabled);
+ if (res != SystemSettingsError.None)
+ {
+ throw SystemSettingsExceptionFactory.CreateException(res, "unable to get isRotaryEventEnabled system setting.");
+ }
+ return isRotaryEventEnabled;
+ }
+ set
+ {
+ SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.RotaryEventEnabled, value);
+ if (res != SystemSettingsError.None)
+ {
+ throw SystemSettingsExceptionFactory.CreateException(res, "unable to set isRotaryEventEnabled system setting.");
+ }
+ }
+ }
+
private static readonly Interop.Settings.SystemSettingsChangedCallback s_incomingCallRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
{
string path = SystemSettings.IncomingCallRingtone;
}
}
}
+
+ private static readonly Interop.Settings.SystemSettingsChangedCallback s_rotaryEventEnabledChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
+ {
+ bool rotaryEventEnabled = SystemSettings.RotaryEventEnabled;
+ RotaryEventEnabledChangedEventArgs eventArgs = new RotaryEventEnabledChangedEventArgs(rotaryEventEnabled);
+ s_rotaryEventEnabledChanged?.Invoke(null, eventArgs);
+ };
+ private static event EventHandler<RotaryEventEnabledChangedEventArgs> s_rotaryEventEnabledChanged;
+ /// <summary>
+ /// The RotaryEventEnabledChanged event is triggered when the RotaryEventEnabled value is changed.
+ /// </summary>
+ /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
+ /// <privlevel>platform</privlevel>
+ /// <feature>http://tizen.org/feature/systemsetting</feature>
+ /// <exception cref="NotSupportedException">Not Supported feature</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+ /// <remarks>
+ /// http://tizen.org/privilege/systemsettings.admin is needed only for setting value. When getting the value, it isn't needed.
+ /// </remarks>
+ /// <since_tizen> 6 </since_tizen>
+ public static event EventHandler<RotaryEventEnabledChangedEventArgs> RotaryEventEnabledChanged
+ {
+ add
+ {
+ if (s_rotaryEventEnabledChanged == null)
+ {
+ SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.RotaryEventEnabled, s_rotaryEventEnabledChangedCallback, IntPtr.Zero);
+ if (ret != SystemSettingsError.None)
+ {
+ throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
+ }
+ }
+ s_rotaryEventEnabledChanged += value;
+ }
+
+ remove
+ {
+ s_rotaryEventEnabledChanged -= value;
+ if (s_rotaryEventEnabledChanged == null)
+ {
+ SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.RotaryEventEnabled, s_rotaryEventEnabledChangedCallback);
+ if (ret != SystemSettingsError.None)
+ {
+ throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
+ }
+ }
+ }
+ }
}
}
/// GET (bool) Indicates whether accessibility negative color is enabled on the device.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- AccessibilityNegativeColor
+ AccessibilityNegativeColor,
+ /// <summary>
+ /// GET (bool) Indicates whether rotary event is enabled on the device.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ RotaryEventEnabled
}
/// <summary>
/// Enumeration for the Idle Lock State.
}
/// <summary>
- /// Indicates whether developer option state is enabled on the device or not.
+ /// Indicates whether accessibility grayscale is enabled on the device or not.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public bool Value
}
/// <summary>
- /// Indicates whether developer option state is enabled on the device or not.
+ /// Indicates whether accessibility negative color is enabled on the device or not.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public bool Value
}
}
}
+
+ /// <summary>
+ /// EventArgs type for the RotaryEventEnabledChanged event.
+ /// </summary>
+ /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
+ /// <privlevel>platform</privlevel>
+ /// <feature>http://tizen.org/feature/systemsetting</feature>
+ /// <exception cref="NotSupportedException">Not Supported feature</exception>
+ /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
+ /// <remarks>
+ /// http://tizen.org/privilege/systemsettings.admin is needed only for setting value. When getting the value, it isn't needed.
+ /// </remarks>
+ /// <since_tizen> 6 </since_tizen>
+ public class RotaryEventEnabledChangedEventArgs : EventArgs
+ {
+ internal RotaryEventEnabledChangedEventArgs(bool val)
+ {
+ Value = val;
+ }
+
+ /// <summary>
+ /// Indicates whether rotary event enable is enabled on the device or not.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ public bool Value { get; }
+ }
}
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
+ <StartupObject></StartupObject>
+ <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Tizen.NET" Version="6.0.0.14697">
- <ExcludeAssets>Runtime</ExcludeAssets>
- </PackageReference>
- <PackageReference Include="Tizen.NET.Sdk" Version="1.0.1" />
+ <PackageReference Include="Tizen.NET" Version="6.2.0" />
+ <PackageReference Include="Tizen.NET.API6" Version="6.2.0" />
+ <PackageReference Include="Tizen.NET.Internals" Version="6.2.0" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.3" />
</ItemGroup>
</Project>
using System.Threading.Tasks;
using System;
using Tizen.System;
-
+using Tizen;
// /opt/usr/data/settings/Ringtones/ringtone_sdk.mp3
namespace SystemSettingsUnitTest
{
Assert.IsTrue(e.Value == s_developerOptionStateValue, "OnDeveloperOptionStateChanged: The callback should receive the latest value for the property.");
}
-#if true
// AccessibilityGrayscale
////[Test]
//[Category("P1")]
Assert.IsInstanceOf<bool>(e.Value, "OnAccessibilityNegativeColorChanged: AccessibilityNegativeColor not an instance of string");
Assert.IsTrue(s_accessibilityNegativeColorValue == e.Value, "OnAccessibilityNegativeColorChanged: The callback should receive the latest value for the property.");
}
-#endif
+ // RotaryEventEnabled
+ ////[Test]
+ //[Category("P1")]
+ //[Description("Test if set/get for SystemSettings:RotaryEventEnabled is working properly")]
+ //[Property("SPEC", "Tizen.System.SystemSettings.RotaryEventEnabled A")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "PRW")]
+ //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
+ public static void RotaryEventEnabled_READ_WRITE()
+ {
+ LogUtils.StartTest();
+ /* TEST CODE */
+ Assert.IsInstanceOf<bool>(Tizen.System.SystemSettings.RotaryEventEnabled, "RotaryEventEnabled_READ_WRITE: RotaryEventEnabled not an instance of string");
+ bool preValue = Tizen.System.SystemSettings.RotaryEventEnabled;
+ var setValue = !preValue;
+
+ Tizen.System.SystemSettings.RotaryEventEnabled = setValue;
+ var getValue = Tizen.System.SystemSettings.RotaryEventEnabled;
+ Assert.IsTrue(getValue == setValue, "RotaryEventEnabled_READ_WRITE: Set value and get value of the property should be same.");
+ Tizen.System.SystemSettings.RotaryEventEnabled = preValue;
+ LogUtils.WriteOK();
+ }
+
+ private static bool s_rotaryEventEnabledCallbackCalled = false;
+ private static bool s_rotaryEventEnabledValue = false;
+ ////[Test]
+ //[Category("P1")]
+ //[Description("Check if callback to SystemSettings:RotaryEventEnabledChanged event is called")]
+ //[Property("SPEC", "Tizen.System.SystemSettings.RotaryEventEnabledChanged E")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "EVL")]
+ //[Property("AUTHOR", "Aditya Aswani, a.aswani@samsung.com")]
+ public static async Task RotaryEventEnabledChanged_CHECK_EVENT()
+ {
+ LogUtils.StartTest();
+ /* TEST CODE */
+ Tizen.System.SystemSettings.RotaryEventEnabledChanged += OnRotaryEventEnabledChanged;
+ bool preValue = Tizen.System.SystemSettings.RotaryEventEnabled;
+ s_rotaryEventEnabledValue = !preValue;
+ Tizen.System.SystemSettings.RotaryEventEnabled = s_rotaryEventEnabledValue;
+ await Task.Delay(2000);
+ Assert.IsTrue(s_rotaryEventEnabledCallbackCalled, "RotaryEventEnabledChanged_CHECK_EVENT: EventHandler added. Not getting called");
+ s_rotaryEventEnabledCallbackCalled = false;
+ Tizen.System.SystemSettings.RotaryEventEnabledChanged -= OnRotaryEventEnabledChanged;
+ Tizen.System.SystemSettings.RotaryEventEnabled = !s_rotaryEventEnabledValue;
+ await Task.Delay(2000);
+ Assert.IsFalse(s_rotaryEventEnabledCallbackCalled, "RotaryEventEnabledChanged_CHECK_EVENT: EventHandler removed. Still getting called");
+ Tizen.System.SystemSettings.RotaryEventEnabled = preValue;
+ LogUtils.WriteOK();
+ }
+ private static void OnRotaryEventEnabledChanged(object sender, Tizen.System.RotaryEventEnabledChangedEventArgs e)
+ {
+ s_rotaryEventEnabledCallbackCalled = true;
+ Assert.IsInstanceOf<bool>(e.Value, "OnRotaryEventEnabledChanged: RotaryEventEnabled not an instance of string");
+ Assert.IsTrue(s_rotaryEventEnabledValue == e.Value, "OnRotaryEventEnabledChanged: The callback should receive the latest value for the property.");
+ }
public static async void TestAllAsync()