7275c974c1d7b9451d1e67ae8d56a9d57742303c |
|
18-Nov-2016 |
Sohani Rao <sohanirao@google.com> |
Subclass Handler to log incoming messages A new class WifiHandler that overrides handleMessage() method to log incoming messages and associated unit tests. In order to instantiate WifiLog, an instance of WifiInjector is required. WifiHandler is expected to be used by any service in wifi, including WifiP2pService. Since this service is started before WifiService is started, WifiInjector which is created in WifiServiceImpl would not be available to instantiate WifiHandler if is required in the constructor. For now, we use lazy initialization and invoke WifiInjector.getInstance() once to get the WifiInjector and then make a WifiLog object the first time a message is logged. In order to enable testing of this class, a hidden API is exposed only for testing to set the logging field in the class. Bug: 33085782 Test: Unit test suite, Sanity tests (power on, Wifi connection) Change-Id: I9110eacb28a5faea331a818998ef25295aa589a8
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/WifiHandlerTest.java
|