Skip to content

Commit

Permalink
fix: wifi device not enable
Browse files Browse the repository at this point in the history
when rfkill block, after system reboot,wifi device not enable when rfkill unblock again

Log:
  • Loading branch information
dengbo11 committed Nov 21, 2023
1 parent ab7bf07 commit 1c9de93
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions system/airplane_mode1/rfkill.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ func (mgr *Manager) listenRfkill() {
}

mgr.handleBTRfkillEvent(event)
mgr.handleWifIRfkillEvent(event)
}
}

func (mgr *Manager) handleWifIRfkillEvent(event *RfkillEvent) {
if event.Typ != rfkillTypeWifi {
return
}

if mgr.hasNmWirelessDevices {
// 当飞行模式的wifi设备状态为禁用而rfkill 状态为unblock状态时,以rfkill状态为准
if mgr.WifiEnabled && event.Soft == rfkillStateUnblock {
mgr.block(rfkillTypeWifi, false)
}
}
}

Expand Down

0 comments on commit 1c9de93

Please sign in to comment.