Fix ConcurrentModificationException in radio test
In broadcast radio service unit tests testing cancel, tune was also called and invoked callback calling RadioServiceUserController.getCurrentUser in a separate thread. This causes concurrent modification exception when the next unit test modifies the way mocking getCurrentUser if the current test does not wait for that callback is completed. To test cancel in unit test, calling tune in advance is not needed since it is duty of HAL to cancel previous tuning operations. Thus, tune operations in unit test for cancel can be removed. Bug: 302236983 Test: atest com.android.server.broadcastradio Change-Id: Ib42f302386aab2c5fa4d6159c14402b4adcc2de1
Loading
Please register or sign in to comment