diff options
author | Roshan Pius <rpius@google.com> | 2017-03-22 15:16:19 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-03-27 10:15:21 -0700 |
commit | cb594dc8e61189be19c56ab03626df045ed90d1a (patch) | |
tree | f57a4a27929c4d48ea566a7c669bb4d18963c2c2 /tests | |
parent | 7adcbd6f7b0baef1e4186376b0b43789303856cf (diff) |
WifiNative: Fixing some nits
Remove unnecesary static types defined in SupplicantStaIfaceHal and be
consistent with all the other API's in WifiNative. The layer below (i.e
WifiVendorHal, SupplicantStaIfaceHal, etc) should convert from
WifiNative type to the corrsponding HIDL type.
Also, WifiVendorHal can direcly accept a looper in it's constructor
instead of passing it a Handler Thread.
Bug: 36524196
Test: Manual test & unit tests
Change-Id: I90c65f97b0025e6d1416170c18038d4e2064d76f
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java | 4 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java index 8a2ceaf08..f2cb90e63 100644 --- a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java @@ -1166,12 +1166,12 @@ public class SupplicantStaIfaceHalTest { .thenReturn(mStatusSuccess); // Fail before initialization is performed. - assertFalse(mDut.setLogLevel(SupplicantStaIfaceHal.LOG_LEVEL_DEBUG)); + assertFalse(mDut.setLogLevel(true)); executeAndValidateInitializationSequence(); // This should work. - assertTrue(mDut.setLogLevel(SupplicantStaIfaceHal.LOG_LEVEL_DEBUG)); + assertTrue(mDut.setLogLevel(true)); verify(mISupplicantMock) .setDebugParams(eq(ISupplicant.DebugLevel.DEBUG), eq(false), eq(false)); } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java index 15fc55f66..4e5594bcc 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java @@ -55,7 +55,7 @@ import android.net.wifi.WifiManager; import android.net.wifi.WifiScanner; import android.net.wifi.WifiSsid; import android.net.wifi.WifiWakeReasonAndCounts; -import android.os.HandlerThread; +import android.os.test.TestLooper; import android.os.RemoteException; import android.util.Pair; @@ -90,7 +90,7 @@ public class WifiVendorHalTest { @Mock private HalDeviceManager mHalDeviceManager; @Mock - private HandlerThread mWifiStateMachineHandlerThread; + private TestLooper mLooper; @Mock private WifiVendorHal.HalDeviceManagerStatusListener mHalDeviceManagerStatusCallbacks; @Mock @@ -120,6 +120,7 @@ public class WifiVendorHalTest { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mWifiLog = new FakeWifiLog(); + mLooper = new TestLooper(); mWifiStatusSuccess = new WifiStatus(); mWifiStatusSuccess.code = WifiStatusCode.SUCCESS; mWifiStatusFailure = new WifiStatus(); @@ -171,7 +172,7 @@ public class WifiVendorHalTest { })); // Create the vendor HAL object under test. - mWifiVendorHal = new WifiVendorHal(mHalDeviceManager, mWifiStateMachineHandlerThread); + mWifiVendorHal = new WifiVendorHal(mHalDeviceManager, mLooper.getLooper()); // Initialize the vendor HAL to capture the registered callback. mWifiVendorHal.initialize(mVendorHalDeathHandler); |