From f7ca11b202e442e759cca86a70d9c6d027e82e76 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 11 Oct 2013 08:38:51 -0500 Subject: if /dev/rfkill doesn't exist or isn't writable, then try to handle bluetooth toggles simply by toggling bluez Adapters' Powered property --- src/killswitch.vala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/killswitch.vala') diff --git a/src/killswitch.vala b/src/killswitch.vala index 08ee0cc..167d189 100644 --- a/src/killswitch.vala +++ b/src/killswitch.vala @@ -26,6 +26,8 @@ */ public interface KillSwitch: Object { + public abstract bool is_valid (); + public abstract bool blocked { get; protected set; } /* Try to block/unblock bluetooth. @@ -109,6 +111,11 @@ public class RfKillSwitch: KillSwitch, Object } } + public bool is_valid () + { + return fd != -1; + } + private bool on_channel_event (IOChannel source, IOCondition condition) { read_event (); -- cgit v1.2.3