Posix.close(screen_lock_fd);
return;
}
+
+ backlight.turn_off_unless_needed();
} else {
Posix.close(screen_lock_fd);
}
public class Backlight: zavai.Service
{
public dynamic DBus.Object usage;
+ public dynamic DBus.Object display;
public Backlight()
{
"org.freesmartphone.ousaged",
"/org/freesmartphone/Usage",
"org.freesmartphone.Usage");
+
+ display = zavai.registry.sbus.get_object(
+ "org.freesmartphone.odeviced",
+ "/org/freesmartphone/Device/Display/0",
+ "org.freesmartphone.Device.Display");
}
// Turn the backlight and then let it fade off
}
}
+ public void turn_off_unless_needed()
+ {
+ if (!started)
+ {
+ try {
+ display.SetBacklightPower(false);
+ } catch (GLib.Error e) {
+ zavai.log.error(e.message);
+ }
+ }
+ }
+
/// Request GPS resource
public override void start()
{