floss: Fix racing in start/stop scan
Consider the following race: 1. The 1st StartScan is called with filter: has_active_unfiltered_scanner = false 2. The 2nd StartScan is called without filter: has_active_unfiltered_scanner = true 3. Async task of the 2nd StartScan is done -> Unfiltered scanning mode 4. Async task of the 1st StartScan is done -> MSFT scanning mode ==> Want unfiltered scan, but got MSFT scan This patch move the decision into the async tasks, so it is protected by the lock and the real executing order doesn't matter. Bug: 279233527 Tag: #floss Test: Manual test Change-Id: Ib41d2bbf965a81edce23d62ae6df9832362fc1af
Loading
Please register or sign in to comment