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

Skip to content
Commit 7f68eb72 authored by Sal Savage's avatar Sal Savage
Browse files

Check handler before trying to wait for looper

Problem: Tests that tried to put the state machine in a disconnected
state would run into a race condition where the the test logic was
racing to grab the looper object to wait on it before the class under
test cleaned up the handler via the normal state machine quit logic. If
the class under test cleaned up quickly, the test would fail with an NPE
when it made a getHandler() call.

Solution: Null check the handler. If its null, then we've got no waiting
to do. We can assert the state after to make sure we're in the state
we're supposed to be in.

Bug: 386715308
Flag: EXEMPT, test only change
Test: atest com.android.bluetooth.mapclient.MapClientStateMachineTest
Test: atest com.android.bluetooth.pbapclient.PbapClientServiceTest
Change-Id: Iaef6ec1c7eb6f0658c5470e105b9fd18bd4c2009
parent 6e6df06b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment