Floss: suspend and resume LE scanning
This patch handles the system suspend and resume for LE scanning. - It pauses the scanning when the system is suspending. - It resumes the scanning when the system is resuming. - It takes care of both LE scanning and LE offload. - It prevent APIs from re-enabling by returning the busy status. - It calls the suspend mode change callbacks if any. Note: We can't simply disable the LE scanning. When a filter is offloaded with the MSFT extension and it is monitoring a device, it sends a `Monitor Device Event` to indicate that monitoring is stopped and this can cause an early wake-up. Until we fix the disable + mask solution, we must remove all monitors before suspend and re-monitor them on resume. Bug: 269578912 Tag: #floss BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines Test: Manual - Tested with btclient bluetooth> floss enable bluetooth> le-scan register-scanner bluetooth> le-scan start-scan 1 (... many ScanResult data showing up ...) The following suspend command should not be interrupted prematurely. $ powerd_dbus_suspend --wakeup_timeout=20; The /var/log/power_manager/powerd.LATEST displays something like INFO powerd: [dark_resume.cc(44)] Wake not triggered by user The btclient console should also display scan suspend mode change callback information such as Suspending, Suspended, Resuming, and Normal correctly. Change-Id: I60ed8fc0afee49f2ef95f59cb388ca1ddfc7bf1f
Loading
Please register or sign in to comment