aboutsummaryrefslogtreecommitdiff
path: root/src/killswitch.vala
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-15 16:12:42 +0000
committerTarmac <>2013-10-15 16:12:42 +0000
commit08f4099365f311c4f94ce348902382987adc8f56 (patch)
treefe4e36dd816d0a4a1977132b9ac14cb26b3594fc /src/killswitch.vala
parent5fb78027ee730e151d8307623ed0ffcfbac024f5 (diff)
parent73cc5b06408e95c0401cb3cd3c2249f9376f2606 (diff)
downloadayatana-indicator-bluetooth-08f4099365f311c4f94ce348902382987adc8f56.tar.gz
ayatana-indicator-bluetooth-08f4099365f311c4f94ce348902382987adc8f56.tar.bz2
ayatana-indicator-bluetooth-08f4099365f311c4f94ce348902382987adc8f56.zip
When the user chooses to toggle bluetooth on or off, if /dev/rfkill isn't available, fall back to toggling org.bluez.Adapter's Powered property. Fixes: https://bugs.launchpad.net/bugs/1230275, https://bugs.launchpad.net/bugs/1236249.
Approved by Ted Gould, PS Jenkins bot.
Diffstat (limited to 'src/killswitch.vala')
-rw-r--r--src/killswitch.vala7
1 files changed, 7 insertions, 0 deletions
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 ();