From cb594dc8e61189be19c56ab03626df045ed90d1a Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 22 Mar 2017 15:16:19 -0700 Subject: 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 --- .../src/com/android/server/wifi/SupplicantStaIfaceHalTest.java | 4 ++-- tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3