--- /dev/null
+namespace Fitness.Services
+{
+ public sealed class DisplayTimeoutService
+ {
+ private const string VconfKey = "db/setting/lcd_backlight_normal";
+ private const int AlwaysOnValue = 0;
+
+ private static DisplayTimeoutService instance;
+
+ private bool isTimeoutBlocked;
+ private int systemValue;
+
+ private DisplayTimeoutService()
+ {
+ }
+
+ public static DisplayTimeoutService Instance
+ {
+ get
+ {
+ if (instance is null)
+ {
+ instance = new DisplayTimeoutService();
+ }
+
+ return instance;
+ }
+ }
+
+ public bool IsTimeoutBlocked
+ {
+ get => isTimeoutBlocked;
+ set
+ {
+ if (value == isTimeoutBlocked)
+ {
+ return;
+ }
+
+ if (value)
+ {
+ systemValue = Vconf.GetInt(VconfKey);
+ Vconf.SetInt(VconfKey, AlwaysOnValue);
+ }
+ else
+ {
+ Vconf.SetInt(VconfKey, systemValue);
+ }
+
+ isTimeoutBlocked = value;
+ }
+ }
+ }
+}