Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67a9dfc7 authored by xutianguo's avatar xutianguo Committed by Myles Watson
Browse files

GATT: Fix NoSuchElementException when flush batch scan results



Should check batch clients sets iterator has next element or
not before invoke the next method.

Test: Turn on Bluetooth and search BLE devices

Change-Id: I9f6a21f5b1a3a444f84154686bd62b40efee38d0
Signed-off-by: default avatarxutianguo <xutianguo@xiaomi.com>
parent 527024a3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -527,9 +527,11 @@ public class ScanManager {
                            return;
                        }
                        // Note this actually flushes all pending batch data.
                        if (mBatchClients.iterator().hasNext()) {
                            flushBatchScanResults(mBatchClients.iterator().next());
                        }
                    }
                }
            };
            mService.registerReceiver(mBatchAlarmReceiver, filter);
            mBatchAlarmReceiverRegistered = true;