diff options
author | Rebecca Silberstein <silberst@google.com> | 2016-06-15 15:42:00 -0700 |
---|---|---|
committer | Rebecca Silberstein <silberst@google.com> | 2016-06-27 15:59:16 -0700 |
commit | fca64fc16ec43befde2e7ac7c3bfd84ced1f7778 (patch) | |
tree | e7a59bc5e0ddec269d7d3f8742181ca2465bd60f /tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java | |
parent | eee8cb8bcecfa3b33ae03f7753359499a274e7a9 (diff) | |
download | android_frameworks_opt_net_wifi-fca64fc16ec43befde2e7ac7c3bfd84ced1f7778.tar.gz android_frameworks_opt_net_wifi-fca64fc16ec43befde2e7ac7c3bfd84ced1f7778.tar.bz2 android_frameworks_opt_net_wifi-fca64fc16ec43befde2e7ac7c3bfd84ced1f7778.zip |
WifiInjector: add WifiServiceImpl objects
Move objects created in WifiServiceImpl into WifiInjector to facilitate
unittests. The first call should be to create an instance of
WifiInjector. This call takes the Context as a parameter and is used to
initialize the instance. This instance is also stored in the class and
subsequent calls should use the WifiInjector.getInstance() call.
Exceptions are thrown if the constructor is called multiple times or
will a null Context parameter. An exception is also thrown if
getInstance is called before the WifiInjector constructor has been
called.
This change also allows the setWifiController method of
WifiLastResortWatchdog to be removed.
This change also removes the local variable for the
WifiLastResortWatchdog instance in WifiStateMachine. Instead of holding
the LastResortWatchdog, calls from WifiStateMachine will get the
instance from WifiInjector when they are needed. This is due to the
dependence triangle between WifiStateMachine, WifiController and
WifiLastResortWatchdog.
BUG: 28845563
Change-Id: Iad99cd9c03672b07d2d2eb67eb1f9821e402055f
TEST: runtest frameworks-wifi
TEST: manually checked connection to wifi, tethering and wifi reconnect
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java b/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java index 237fc666d..a8b161499 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiLastResortWatchdogTest.java @@ -55,8 +55,7 @@ public class WifiLastResortWatchdogTest { @Before public void setUp() throws Exception { initMocks(this); - mLastResortWatchdog = new WifiLastResortWatchdog(mWifiMetrics); - mLastResortWatchdog.setWifiController(mWifiController); + mLastResortWatchdog = new WifiLastResortWatchdog(mWifiController, mWifiMetrics); } private List<Pair<ScanDetail, WifiConfiguration>> createFilteredQnsCandidates(String[] ssids, |