@@ -3,12 +3,6 @@ use evdev::{
3
3
AttributeSet , Key , RelativeAxisType , SwitchType ,
4
4
} ;
5
5
6
- use nix:: ioctl_none;
7
- use std:: fs:: File ;
8
- use std:: os:: unix:: io:: AsRawFd ;
9
-
10
- ioctl_none ! ( rfkill_noinput, b'R' , 1 ) ;
11
-
12
6
pub fn create_uinput_device ( ) -> Result < VirtualDevice , Box < dyn std:: error:: Error > > {
13
7
let keys: AttributeSet < Key > = get_all_keys ( ) . iter ( ) . copied ( ) . collect ( ) ;
14
8
@@ -26,20 +20,6 @@ pub fn create_uinput_device() -> Result<VirtualDevice, Box<dyn std::error::Error
26
20
pub fn create_uinput_switches_device ( ) -> Result < VirtualDevice , Box < dyn std:: error:: Error > > {
27
21
let switches: AttributeSet < SwitchType > = get_all_switches ( ) . iter ( ) . copied ( ) . collect ( ) ;
28
22
29
- // We have to disable rfkill-input to avoid blocking all radio devices. When
30
- // a new device (virtual or physical) with the SW_RFKILL_ALL capability bit
31
- // set appears, rfkill reacts immediately depending on the value bit. This
32
- // value bit defaults to unset, which causes rfkill to use its default mode
33
- // (which is eop - emergency power off). The uinput API does not give any
34
- // way to set the corresponding value bit before creating the device, and we
35
- // have no way to avoid rfkill acting upon the device creation or to change
36
- // its default mode. Thus, we disable rfkill-input temporarily, hopefully
37
- // fast enough that it won't impact anyone. rfkill-input will be enabled
38
- // again when the file gets closed.
39
- let rfkill_file = File :: open ( "/dev/rfkill" ) ?;
40
- unsafe {
41
- rfkill_noinput ( rfkill_file. as_raw_fd ( ) ) ?;
42
- }
43
23
let device = VirtualDeviceBuilder :: new ( ) ?
44
24
. name ( "swhkd switches virtual output" )
45
25
. with_switches ( & switches) ?
@@ -622,7 +602,6 @@ pub fn get_all_switches() -> &'static [SwitchType] {
622
602
SwitchType :: SW_LID ,
623
603
SwitchType :: SW_TABLET_MODE ,
624
604
SwitchType :: SW_HEADPHONE_INSERT ,
625
- SwitchType :: SW_RFKILL_ALL ,
626
605
SwitchType :: SW_MICROPHONE_INSERT ,
627
606
SwitchType :: SW_DOCK ,
628
607
SwitchType :: SW_LINEOUT_INSERT ,
0 commit comments