Fix Mockito usage.

Using doReturn().when() is safer than when().thenReturn() for tests that
use multithreaded objects.

Bug: 236261941
Test: atest FrameworksMockingServicesTests:FlexibilityControllerTest
Change-Id: I1481e55082278ca2dc19033236fe4dfe84f3e46e
1 file changed