Skip to content

Commit

Permalink
feat: Add missing wifi state receiver unregistration on cancel (#32)
Browse files Browse the repository at this point in the history
Added Wifi and WifiNaN state receiver unregistration on scan cancel
  • Loading branch information
albertmoravec committed Apr 11, 2024
2 parents 4abb385 + 11bbc04 commit 0e3c7db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class WifiNaNScanner (
override fun cancel() {
if (!wifiAwareSupported) return
isScanning = false;
context.unregisterReceiver(adapterStateReceiver)
stopScan()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class WifiScanner (

override fun cancel() {
isScanning = false;
context.unregisterReceiver(broadcastReceiver)
wifiStateHandler.send(false)
if (countDownTimer != null) {
countDownTimer!!.cancel();
Expand Down

0 comments on commit 0e3c7db

Please sign in to comment.