e7ebc3fba71f4f996794bc5fa939674f8b4b2c5a |
|
10-Jan-2017 |
Sohani Rao <sohanirao@google.com> |
Fix WifiScanningServiceImpl stand-alone unit test failure WifiAsyncChannel and WifiHandler objects use lazy intialization for the logging objects. WifiInjector.getInstance() may return a null object if the unit test is run by itself or if earlier tests have not created it. If the unit tests are able to update these instances with a logging objects that are not null, then unit test can pass stand-alone. - Add a method in FrameworkFacade to return new instances of WifiAsyncChannel - Update WifiAsyncChannel to expose setWifiLog() API for testing only - Call this method on instances of WifiAsyncChannel returned by the mock of FrameworkFacade factory to ensure mLog is not null - Add a method in WifiScanningServiceImpl, also meant for testing only to update WifiHandler with logging object - Change unit tests to call this method after starting scanning service Bug: 34127212 Test: WifiScanningServiceTest by itself and all unit tests pass Change-Id: I0bc7a55d6d6862e2360bfb20897828e84358dd39
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/util/WifiAsyncChannel.java
|