Actually prevent a repeated unregistration of mBatchAlarmReceiver.
Uses a AtomicReferences that is read and atomically set to null. Also moves it to the ScanNative inner class, and makes the rest of the ScanNative members final. Note that there are other receivers in ScanManager that may be unregistered multiple times. In those cases the IllegalArgumentException is caught. We should consider changing that, because if cleanup is called multiple times there will be a bunch of errors logged which could cause issues to be mistriaged. But that is out of scope of this change. Bug: 354303095 Fix: 354303095 Flag: EXEMPT, what isn't mechanical refactor is trivial Test: atest ScanManagerTest, atest BumbleBluetoothTests Change-Id: Ib3982c3a933459b77aa305f54517b527e55701c9
Loading
Please register or sign in to comment