[SP18.2] Create TestableNetworkStatsProviderCbBinder
Currently, in OffloadController unit test, mock object is used to verify callback sent from provider. However, verify a mock method running in different thread, is not supported if there is no additional thread synchronization mechanism applied. This is fine now since all the callbacks fired from OffloadControllerTest are on the same thread with caller. But it is not necessary true in subsequent patches that fire callbacks from handler thread. Hence, introduce a testable provider callback that based on a thread-safe ArrayTrackRecord to provide the functionality to verify mock callback fired in a different thread. Test: m -j Bug: 149467454 Change-Id: I2edf887ccee5f205368a294f5f9990edb818332d Merged-In: I2edf887ccee5f205368a294f5f9990edb818332d (cherry picked from commit bdd1690c)
Loading