summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2020-02-13 22:34:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-13 22:34:08 +0000
commit23b3957e5ef946e472955edb873b0d10e9d9455c (patch)
treef2d300e25fdb2597b56f4c6694fa1082ac0526b3
parent127922d1ce95fa446295e3d2badb2e4e217b3b4e (diff)
parent4e38cb44d43abd564ca8109e4217f15706031bbf (diff)
Merge "[WIFICON] Rename to nl80211"
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java8
-rw-r--r--service/java/com/android/server/wifi/LinkProbeManager.java4
-rw-r--r--service/java/com/android/server/wifi/WifiInjector.java9
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java13
-rw-r--r--service/java/com/android/server/wifi/WifiNative.java43
-rw-r--r--service/java/com/android/server/wifi/WifiShellCommand.java6
-rw-r--r--service/java/com/android/server/wifi/p2p/WifiP2pNative.java4
-rw-r--r--service/java/com/android/server/wifi/util/InformationElementUtil.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java36
-rw-r--r--tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/LinkProbeManagerTest.java14
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java8
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java34
-rw-r--r--tests/wifitests/src/com/android/server/wifi/p2p/WifiP2pNativeTest.java4
15 files changed, 111 insertions, 86 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index 895b59beb..a13748975 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -77,7 +77,7 @@ import android.net.wifi.hotspot2.IProvisioningCallback;
import android.net.wifi.hotspot2.OsuProvider;
import android.net.wifi.p2p.WifiP2pManager;
import android.net.wifi.wificond.DeviceWiphyCapabilities;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.BatteryStatsManager;
import android.os.Bundle;
import android.os.ConditionVariable;
@@ -2313,7 +2313,7 @@ public class ClientModeImpl extends StateMachine {
* Fetch RSSI, linkspeed, and frequency on current connection
*/
private void fetchRssiLinkSpeedAndFrequencyNative() {
- WifiCondManager.SignalPollResult pollResult = mWifiNative.signalPoll(mInterfaceName);
+ WifiNl80211Manager.SignalPollResult pollResult = mWifiNative.signalPoll(mInterfaceName);
if (pollResult == null) {
return;
}
@@ -4648,7 +4648,7 @@ public class ClientModeImpl extends StateMachine {
break;
case CMD_PKT_CNT_FETCH:
callbackIdentifier = message.arg2;
- WifiCondManager.TxPacketCounters counters =
+ WifiNl80211Manager.TxPacketCounters counters =
mWifiNative.getTxPacketCounters(mInterfaceName);
if (counters != null) {
sendTxPacketCountListenerSuccess(callbackIdentifier,
@@ -5798,7 +5798,7 @@ public class ClientModeImpl extends StateMachine {
* Sends a link probe.
*/
@VisibleForTesting
- public void probeLink(WifiCondManager.SendMgmtFrameCallback callback, int mcs) {
+ public void probeLink(WifiNl80211Manager.SendMgmtFrameCallback callback, int mcs) {
mWifiNative.probeLink(mInterfaceName, MacAddress.fromString(mWifiInfo.getBSSID()),
callback, mcs);
}
diff --git a/service/java/com/android/server/wifi/LinkProbeManager.java b/service/java/com/android/server/wifi/LinkProbeManager.java
index c9bc042e5..c6fab2f75 100644
--- a/service/java/com/android/server/wifi/LinkProbeManager.java
+++ b/service/java/com/android/server/wifi/LinkProbeManager.java
@@ -19,7 +19,7 @@ package com.android.server.wifi;
import android.content.Context;
import android.net.MacAddress;
import android.net.wifi.WifiInfo;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.util.Log;
@@ -231,7 +231,7 @@ public class LinkProbeManager {
mWifiNative.probeLink(
interfaceName,
MacAddress.fromString(wifiInfo.getBSSID()),
- new WifiCondManager.SendMgmtFrameCallback() {
+ new WifiNl80211Manager.SendMgmtFrameCallback() {
@Override
public void onAck(int elapsedTimeMs) {
if (mVerboseLoggingEnabled) {
diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java
index a63484f81..ccc906eed 100644
--- a/service/java/com/android/server/wifi/WifiInjector.java
+++ b/service/java/com/android/server/wifi/WifiInjector.java
@@ -28,7 +28,7 @@ import android.net.NetworkKey;
import android.net.NetworkScoreManager;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiScanner;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.BatteryStatsManager;
import android.os.Handler;
import android.os.HandlerExecutor;
@@ -104,7 +104,7 @@ public class WifiInjector {
private final WifiSettingsStore mSettingsStore;
private OpenNetworkNotifier mOpenNetworkNotifier;
private final WifiLockManager mLockManager;
- private final WifiCondManager mWifiCondManager;
+ private final WifiNl80211Manager mWifiCondManager;
private final Clock mClock = new Clock();
private final WifiMetrics mWifiMetrics;
private final WifiP2pMetrics mWifiP2pMetrics;
@@ -220,7 +220,8 @@ public class WifiInjector {
mSupplicantStaIfaceHal = new SupplicantStaIfaceHal(
mContext, mWifiMonitor, mFrameworkFacade, wifiHandler, mClock);
mHostapdHal = new HostapdHal(mContext, wifiHandler);
- mWifiCondManager = (WifiCondManager) mContext.getSystemService(Context.WIFI_COND_SERVICE);
+ mWifiCondManager = (WifiNl80211Manager) mContext.getSystemService(
+ Context.WIFI_NL80211_SERVICE);
mWifiNative = new WifiNative(
mWifiVendorHal, mSupplicantStaIfaceHal, mHostapdHal, mWifiCondManager,
mWifiMonitor, mPropertyService, mWifiMetrics,
@@ -800,7 +801,7 @@ public class WifiInjector {
return mNetdWrapper;
}
- public WifiCondManager getWifiCondManager() {
+ public WifiNl80211Manager getWifiCondManager() {
return mWifiCondManager;
}
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index bc16fbb79..59becf48c 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -31,7 +31,7 @@ import android.net.wifi.WifiManager.DeviceMobilityState;
import android.net.wifi.WifiUsabilityStatsEntry.ProbeStatus;
import android.net.wifi.hotspot2.PasspointConfiguration;
import android.net.wifi.hotspot2.ProvisioningCallback;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -3442,13 +3442,13 @@ public class WifiMetrics {
private static int linkProbeFailureReasonToProto(int reason) {
switch (reason) {
- case WifiCondManager.SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED:
+ case WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED:
return LinkProbeStats.LINK_PROBE_FAILURE_REASON_MCS_UNSUPPORTED;
- case WifiCondManager.SEND_MGMT_FRAME_ERROR_NO_ACK:
+ case WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_NO_ACK:
return LinkProbeStats.LINK_PROBE_FAILURE_REASON_NO_ACK;
- case WifiCondManager.SEND_MGMT_FRAME_ERROR_TIMEOUT:
+ case WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_TIMEOUT:
return LinkProbeStats.LINK_PROBE_FAILURE_REASON_TIMEOUT;
- case WifiCondManager.SEND_MGMT_FRAME_ERROR_ALREADY_STARTED:
+ case WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_ALREADY_STARTED:
return LinkProbeStats.LINK_PROBE_FAILURE_REASON_ALREADY_STARTED;
default:
return LinkProbeStats.LINK_PROBE_FAILURE_REASON_UNKNOWN;
@@ -4761,7 +4761,8 @@ public class WifiMetrics {
* {@link WifiInfo#txSuccess}).
* @param rssi The Rx RSSI at {@code startTimestampMs}.
* @param linkSpeed The Tx link speed in Mbps at {@code startTimestampMs}.
- * @param reason The error code for the failure. See {@link WifiCondManager.SendMgmtFrameError}.
+ * @param reason The error code for the failure. See
+ * {@link WifiNl80211Manager.SendMgmtFrameError}.
*/
public void logLinkProbeFailure(long timeSinceLastTxSuccessMs,
int rssi, int linkSpeed, int reason) {
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index 1e978483d..fb3459131 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -32,7 +32,7 @@ import android.net.wifi.WifiSsid;
import android.net.wifi.wificond.DeviceWiphyCapabilities;
import android.net.wifi.wificond.NativeScanResult;
import android.net.wifi.wificond.RadioChainInfo;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.os.SystemClock;
import android.text.TextUtils;
@@ -80,7 +80,7 @@ public class WifiNative {
private final SupplicantStaIfaceHal mSupplicantStaIfaceHal;
private final HostapdHal mHostapdHal;
private final WifiVendorHal mWifiVendorHal;
- private final WifiCondManager mWifiCondManager;
+ private final WifiNl80211Manager mWifiCondManager;
private final WifiMonitor mWifiMonitor;
private final PropertyService mPropertyService;
private final WifiMetrics mWifiMetrics;
@@ -92,7 +92,7 @@ public class WifiNative {
public WifiNative(WifiVendorHal vendorHal,
SupplicantStaIfaceHal staIfaceHal, HostapdHal hostapdHal,
- WifiCondManager condManager, WifiMonitor wifiMonitor,
+ WifiNl80211Manager condManager, WifiMonitor wifiMonitor,
PropertyService propertyService, WifiMetrics wifiMetrics,
Handler handler, Random random,
WifiInjector wifiInjector) {
@@ -122,8 +122,9 @@ public class WifiNative {
/**
* Callbacks for SoftAp interface.
*/
- public interface SoftApListener extends WifiCondManager.SoftApCallback {
- // dummy for now - provide a shell so that clients don't use a WifiCondManager-specific API.
+ public interface SoftApListener extends WifiNl80211Manager.SoftApCallback {
+ // dummy for now - provide a shell so that clients don't use a
+ // WifiNl80211Manager-specific API.
}
/********************************************************
@@ -326,7 +327,7 @@ public class WifiNative {
}
}
- private class NormalScanEventCallback implements WifiCondManager.ScanEventCallback {
+ private class NormalScanEventCallback implements WifiNl80211Manager.ScanEventCallback {
private String mIfaceName;
NormalScanEventCallback(String ifaceName) {
@@ -346,7 +347,7 @@ public class WifiNative {
}
}
- private class PnoScanEventCallback implements WifiCondManager.ScanEventCallback {
+ private class PnoScanEventCallback implements WifiNl80211Manager.ScanEventCallback {
private String mIfaceName;
PnoScanEventCallback(String ifaceName) {
@@ -1403,7 +1404,7 @@ public class WifiNative {
* Returns an SignalPollResult object.
* Returns null on failure.
*/
- public WifiCondManager.SignalPollResult signalPoll(@NonNull String ifaceName) {
+ public WifiNl80211Manager.SignalPollResult signalPoll(@NonNull String ifaceName) {
return mWifiCondManager.signalPoll(ifaceName);
}
@@ -1413,7 +1414,7 @@ public class WifiNative {
* Returns an TxPacketCounters object.
* Returns null on failure.
*/
- public WifiCondManager.TxPacketCounters getTxPacketCounters(@NonNull String ifaceName) {
+ public WifiNl80211Manager.TxPacketCounters getTxPacketCounters(@NonNull String ifaceName) {
return mWifiCondManager.getTxPacketCounters(ifaceName);
}
@@ -1468,7 +1469,7 @@ public class WifiNative {
*/
public ArrayList<ScanDetail> getScanResults(@NonNull String ifaceName) {
return convertNativeScanResults(mWifiCondManager.getScanResults(
- ifaceName, WifiCondManager.SCAN_TYPE_SINGLE_SCAN));
+ ifaceName, WifiNl80211Manager.SCAN_TYPE_SINGLE_SCAN));
}
/**
@@ -1478,8 +1479,8 @@ public class WifiNative {
* Returns an empty ArrayList on failure.
*/
public ArrayList<ScanDetail> getPnoScanResults(@NonNull String ifaceName) {
- return convertNativeScanResults(
- mWifiCondManager.getScanResults(ifaceName, WifiCondManager.SCAN_TYPE_PNO_SCAN));
+ return convertNativeScanResults(mWifiCondManager.getScanResults(ifaceName,
+ WifiNl80211Manager.SCAN_TYPE_PNO_SCAN));
}
private ArrayList<ScanDetail> convertNativeScanResults(List<NativeScanResult> nativeResults) {
@@ -1564,7 +1565,7 @@ public class WifiNative {
public boolean startPnoScan(@NonNull String ifaceName, PnoSettings pnoSettings) {
return mWifiCondManager.startPnoScan(ifaceName, pnoSettings.toNativePnoSettings(),
Runnable::run,
- new WifiCondManager.PnoScanRequestCallback() {
+ new WifiNl80211Manager.PnoScanRequestCallback() {
@Override
public void onPnoRequestSucceeded() {
mWifiMetrics.incrementPnoScanStartAttemptCount();
@@ -1598,11 +1599,11 @@ public class WifiNative {
* @param mcs The MCS index that the frame will be sent at. If mcs < 0, the driver will select
* the rate automatically. If the device does not support sending the frame at a
* specified MCS rate, the transmission will be aborted and
- * {@link WifiCondManager.SendMgmtFrameCallback#onFailure(int)} will be called
- * with reason {@link WifiCondManager#SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED}.
+ * {@link WifiNl80211Manager.SendMgmtFrameCallback#onFailure(int)} will be called
+ * with reason {@link WifiNl80211Manager#SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED}.
*/
public void sendMgmtFrame(@NonNull String ifaceName, @NonNull byte[] frame,
- @NonNull WifiCondManager.SendMgmtFrameCallback callback, int mcs) {
+ @NonNull WifiNl80211Manager.SendMgmtFrameCallback callback, int mcs) {
mWifiCondManager.sendMgmtFrame(ifaceName, frame, mcs, Runnable::run, callback);
}
@@ -1617,11 +1618,11 @@ public class WifiNative {
* @param mcs The MCS index that this probe will be sent at. If mcs < 0, the driver will select
* the rate automatically. If the device does not support sending the frame at a
* specified MCS rate, the transmission will be aborted and
- * {@link WifiCondManager.SendMgmtFrameCallback#onFailure(int)} will be called
- * with reason {@link WifiCondManager#SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED}.
+ * {@link WifiNl80211Manager.SendMgmtFrameCallback#onFailure(int)} will be called
+ * with reason {@link WifiNl80211Manager#SEND_MGMT_FRAME_ERROR_MCS_UNSUPPORTED}.
*/
public void probeLink(@NonNull String ifaceName, @NonNull MacAddress receiverMac,
- @NonNull WifiCondManager.SendMgmtFrameCallback callback, int mcs) {
+ @NonNull WifiNl80211Manager.SendMgmtFrameCallback callback, int mcs) {
if (callback == null) {
Log.e(TAG, "callback cannot be null!");
return;
@@ -1629,14 +1630,14 @@ public class WifiNative {
if (receiverMac == null) {
Log.e(TAG, "Receiver MAC address cannot be null!");
- callback.onFailure(WifiCondManager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
+ callback.onFailure(WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
return;
}
String senderMacStr = getMacAddress(ifaceName);
if (senderMacStr == null) {
Log.e(TAG, "Failed to get this device's MAC Address");
- callback.onFailure(WifiCondManager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
+ callback.onFailure(WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
return;
}
diff --git a/service/java/com/android/server/wifi/WifiShellCommand.java b/service/java/com/android/server/wifi/WifiShellCommand.java
index 44081ba36..171cb7bb6 100644
--- a/service/java/com/android/server/wifi/WifiShellCommand.java
+++ b/service/java/com/android/server/wifi/WifiShellCommand.java
@@ -19,7 +19,7 @@ package com.android.server.wifi;
import android.content.Context;
import android.net.wifi.SoftApConfiguration;
import android.net.wifi.WifiScanner;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.BasicShellCommandHandler;
import android.os.Binder;
@@ -384,11 +384,11 @@ public class WifiShellCommand extends BasicShellCommandHandler {
}
private int sendLinkProbe(PrintWriter pw) throws InterruptedException {
- // Note: should match WifiCondManager#SEND_MGMT_FRAME_TIMEOUT_MS
+ // Note: should match WifiNl80211Manager#SEND_MGMT_FRAME_TIMEOUT_MS
final int sendMgmtFrameTimeoutMs = 1000;
ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(1);
- mClientModeImpl.probeLink(new WifiCondManager.SendMgmtFrameCallback() {
+ mClientModeImpl.probeLink(new WifiNl80211Manager.SendMgmtFrameCallback() {
@Override
public void onAck(int elapsedTimeMs) {
queue.offer("Link probe succeeded after " + elapsedTimeMs + " ms");
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pNative.java b/service/java/com/android/server/wifi/p2p/WifiP2pNative.java
index 9c105581a..53426588d 100644
--- a/service/java/com/android/server/wifi/p2p/WifiP2pNative.java
+++ b/service/java/com/android/server/wifi/p2p/WifiP2pNative.java
@@ -24,7 +24,7 @@ import android.net.wifi.p2p.WifiP2pConfig;
import android.net.wifi.p2p.WifiP2pGroup;
import android.net.wifi.p2p.WifiP2pGroupList;
import android.net.wifi.p2p.nsd.WifiP2pServiceInfo;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
@@ -615,7 +615,7 @@ public class WifiP2pNative {
private void abortWifiRunningScanIfNeeded(boolean isJoin) {
if (!isJoin) return;
- WifiCondManager wifiCondManager = mWifiInjector.getWifiCondManager();
+ WifiNl80211Manager wifiCondManager = mWifiInjector.getWifiCondManager();
WifiNative wifiNative = mWifiInjector.getWifiNative();
Set<String> wifiClientInterfaces = wifiNative.getClientInterfaceNames();
diff --git a/service/java/com/android/server/wifi/util/InformationElementUtil.java b/service/java/com/android/server/wifi/util/InformationElementUtil.java
index a88fa201c..917f1f7a0 100644
--- a/service/java/com/android/server/wifi/util/InformationElementUtil.java
+++ b/service/java/com/android/server/wifi/util/InformationElementUtil.java
@@ -21,7 +21,7 @@ import android.net.wifi.WifiAnnotations.Cipher;
import android.net.wifi.WifiAnnotations.KeyMgmt;
import android.net.wifi.WifiAnnotations.Protocol;
import android.net.wifi.wificond.NativeScanResult;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.util.Log;
import com.android.server.wifi.ByteBufferReader;
@@ -1183,8 +1183,8 @@ public class InformationElementUtil {
isIBSS = (beaconCap & NativeScanResult.BSS_CAPABILITY_IBSS) != 0;
isPrivacy = (beaconCap & NativeScanResult.BSS_CAPABILITY_PRIVACY) != 0;
for (InformationElement ie : ies) {
- WifiCondManager.OemSecurityType oemSecurityType =
- WifiCondManager.parseOemSecurityTypeElement(
+ WifiNl80211Manager.OemSecurityType oemSecurityType =
+ WifiNl80211Manager.parseOemSecurityTypeElement(
ie.id, ie.idExt, ie.bytes);
if (oemSecurityType != null
&& oemSecurityType.protocol != ScanResult.PROTOCOL_NONE) {
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index 7d4f03e29..de393e9fb 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -27,7 +27,27 @@ import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyBoolean;
+import static org.mockito.Mockito.anyByte;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyLong;
+import static org.mockito.Mockito.anyObject;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.argThat;
+import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.withSettings;
import android.app.ActivityManager;
import android.app.test.MockAnswerUtil.AnswerWithArguments;
@@ -65,7 +85,7 @@ import android.net.wifi.WifiSsid;
import android.net.wifi.hotspot2.IProvisioningCallback;
import android.net.wifi.hotspot2.OsuProvider;
import android.net.wifi.p2p.WifiP2pManager;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.BatteryStatsManager;
import android.os.Binder;
import android.os.Bundle;
@@ -2522,8 +2542,8 @@ public class ClientModeImplTest extends WifiBaseTest {
WifiLinkLayerStats llStats = new WifiLinkLayerStats();
llStats.txmpdu_be = 1000;
llStats.rxmpdu_bk = 2000;
- WifiCondManager.SignalPollResult signalPollResult = new WifiCondManager.SignalPollResult(
- -42, 65, 54, sFreq);
+ WifiNl80211Manager.SignalPollResult signalPollResult =
+ new WifiNl80211Manager.SignalPollResult(-42, 65, 54, sFreq);
when(mWifiNative.getWifiLinkLayerStats(any())).thenReturn(llStats);
when(mWifiNative.signalPoll(any())).thenReturn(signalPollResult);
when(mClock.getWallClockMillis()).thenReturn(startMillis + 0);
@@ -2926,8 +2946,8 @@ public class ClientModeImplTest extends WifiBaseTest {
WifiLinkLayerStats llStats = new WifiLinkLayerStats();
llStats.txmpdu_be = 1000;
llStats.rxmpdu_bk = 2000;
- WifiCondManager.SignalPollResult signalPollResult = new WifiCondManager.SignalPollResult(
- TEST_RSSI, 65, 54, sFreq);
+ WifiNl80211Manager.SignalPollResult signalPollResult =
+ new WifiNl80211Manager.SignalPollResult(TEST_RSSI, 65, 54, sFreq);
when(mWifiNative.getWifiLinkLayerStats(any())).thenReturn(llStats);
when(mWifiNative.signalPoll(any())).thenReturn(signalPollResult);
@@ -3328,8 +3348,8 @@ public class ClientModeImplTest extends WifiBaseTest {
WifiLinkLayerStats llStats = new WifiLinkLayerStats();
llStats.txmpdu_be = 1000;
llStats.rxmpdu_bk = 2000;
- WifiCondManager.SignalPollResult signalPollResult = new WifiCondManager.SignalPollResult(
- RSSI_THRESHOLD_BREACH_MIN, 65, 54, sFreq);
+ WifiNl80211Manager.SignalPollResult signalPollResult =
+ new WifiNl80211Manager.SignalPollResult(RSSI_THRESHOLD_BREACH_MIN, 65, 54, sFreq);
when(mWifiNative.getWifiLinkLayerStats(any())).thenReturn(llStats);
when(mWifiNative.signalPoll(any())).thenReturn(signalPollResult);
diff --git a/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java b/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java
index ad7b14831..98ad24831 100644
--- a/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/HostapdHalTest.java
@@ -34,7 +34,7 @@ import android.hidl.manager.V1_0.IServiceNotification;
import android.net.MacAddress;
import android.net.wifi.SoftApConfiguration;
import android.net.wifi.SoftApConfiguration.Builder;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.os.IHwBinder;
import android.os.RemoteException;
@@ -67,7 +67,7 @@ public class HostapdHalTest extends WifiBaseTest {
private @Mock IServiceManager mServiceManagerMock;
private @Mock IHostapd mIHostapdMock;
private @Mock WifiNative.HostapdDeathEventHandler mHostapdHalDeathHandler;
- private @Mock WifiCondManager.SoftApCallback mSoftApListener;
+ private @Mock WifiNl80211Manager.SoftApCallback mSoftApListener;
private android.hardware.wifi.hostapd.V1_1.IHostapd mIHostapdMockV11;
private android.hardware.wifi.hostapd.V1_2.IHostapd mIHostapdMockV12;
private IHostapdCallback mIHostapdCallback;
diff --git a/tests/wifitests/src/com/android/server/wifi/LinkProbeManagerTest.java b/tests/wifitests/src/com/android/server/wifi/LinkProbeManagerTest.java
index 421581671..4ca17e8b4 100644
--- a/tests/wifitests/src/com/android/server/wifi/LinkProbeManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/LinkProbeManagerTest.java
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.when;
import android.content.Context;
import android.net.wifi.WifiInfo;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.os.test.TestLooper;
@@ -122,8 +122,8 @@ public class LinkProbeManagerTest extends WifiBaseTest {
mTimeMs += timeDelta;
when(mClock.getElapsedSinceBootMillis()).thenReturn(mTimeMs);
mLinkProbeManager.updateConnectionStats(mWifiInfo, TEST_IFACE_NAME);
- ArgumentCaptor<WifiCondManager.SendMgmtFrameCallback> callbackCaptor =
- ArgumentCaptor.forClass(WifiCondManager.SendMgmtFrameCallback.class);
+ ArgumentCaptor<WifiNl80211Manager.SendMgmtFrameCallback> callbackCaptor =
+ ArgumentCaptor.forClass(WifiNl80211Manager.SendMgmtFrameCallback.class);
verify(mWifiNative).probeLink(eq(TEST_IFACE_NAME), any(), callbackCaptor.capture(),
anyInt());
ArgumentCaptor<String> experimentIdCaptor = ArgumentCaptor.forClass(String.class);
@@ -165,14 +165,14 @@ public class LinkProbeManagerTest extends WifiBaseTest {
mTimeMs += timeDelta;
when(mClock.getElapsedSinceBootMillis()).thenReturn(mTimeMs);
mLinkProbeManager.updateConnectionStats(mWifiInfo, TEST_IFACE_NAME);
- ArgumentCaptor<WifiCondManager.SendMgmtFrameCallback> callbackCaptor =
- ArgumentCaptor.forClass(WifiCondManager.SendMgmtFrameCallback.class);
+ ArgumentCaptor<WifiNl80211Manager.SendMgmtFrameCallback> callbackCaptor =
+ ArgumentCaptor.forClass(WifiNl80211Manager.SendMgmtFrameCallback.class);
verify(mWifiNative).probeLink(eq(TEST_IFACE_NAME), any(), callbackCaptor.capture(),
anyInt());
- callbackCaptor.getValue().onFailure(WifiCondManager.SEND_MGMT_FRAME_ERROR_NO_ACK);
+ callbackCaptor.getValue().onFailure(WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_NO_ACK);
verify(mWifiMetrics).logLinkProbeFailure(timeDelta, rssi, linkSpeed,
- WifiCondManager.SEND_MGMT_FRAME_ERROR_NO_ACK);
+ WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_NO_ACK);
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index e3567776a..8e8d177a8 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -63,7 +63,7 @@ import android.net.wifi.WifiSsid;
import android.net.wifi.hotspot2.PasspointConfiguration;
import android.net.wifi.hotspot2.ProvisioningCallback;
import android.net.wifi.hotspot2.pps.Credential;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
@@ -3507,13 +3507,13 @@ public class WifiMetricsTest extends WifiBaseTest {
public void testLogLinkProbeMetrics() throws Exception {
mWifiMetrics.logLinkProbeSuccess(10000, -75, 50, 5);
mWifiMetrics.logLinkProbeFailure(30000, -80, 10,
- WifiCondManager.SEND_MGMT_FRAME_ERROR_NO_ACK);
+ WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_NO_ACK);
mWifiMetrics.logLinkProbeSuccess(3000, -71, 160, 12);
mWifiMetrics.logLinkProbeFailure(40000, -80, 6,
- WifiCondManager.SEND_MGMT_FRAME_ERROR_NO_ACK);
+ WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_NO_ACK);
mWifiMetrics.logLinkProbeSuccess(5000, -73, 160, 10);
mWifiMetrics.logLinkProbeFailure(2000, -78, 6,
- WifiCondManager.SEND_MGMT_FRAME_ERROR_TIMEOUT);
+ WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_TIMEOUT);
dumpProtoAndDeserialize();
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java
index dcb4ae447..d4017a4bb 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.when;
import android.app.test.MockAnswerUtil;
import android.net.wifi.SoftApConfiguration;
import android.net.wifi.WifiScanner;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import android.os.test.TestLooper;
@@ -70,7 +70,7 @@ public class WifiNativeInterfaceManagementTest extends WifiBaseTest {
private static final String IFACE_NAME_1 = "mockWlan1";
@Mock private WifiVendorHal mWifiVendorHal;
- @Mock private WifiCondManager mWificondControl;
+ @Mock private WifiNl80211Manager mWificondControl;
@Mock private SupplicantStaIfaceHal mSupplicantStaIfaceHal;
@Mock private HostapdHal mHostapdHal;
@Mock private WifiMonitor mWifiMonitor;
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
index 84ae877a9..79df8fe6f 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
@@ -37,8 +37,8 @@ import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiScanner;
import android.net.wifi.wificond.NativeScanResult;
import android.net.wifi.wificond.RadioChainInfo;
-import android.net.wifi.wificond.WifiCondManager;
-import android.net.wifi.wificond.WifiCondManager.SendMgmtFrameCallback;
+import android.net.wifi.wificond.WifiNl80211Manager;
+import android.net.wifi.wificond.WifiNl80211Manager.SendMgmtFrameCallback;
import android.os.Handler;
import androidx.test.filters.SmallTest;
@@ -128,10 +128,10 @@ public class WifiNativeTest extends WifiBaseTest {
new FateMapping(WifiLoggerHal.RX_PKT_FATE_DRV_DROP_OTHER, "driver dropped (other)"),
new FateMapping((byte) 42, "42")
};
- private static final WifiCondManager.SignalPollResult SIGNAL_POLL_RESULT =
- new WifiCondManager.SignalPollResult(-60, 12, 6, 5240);
- private static final WifiCondManager.TxPacketCounters PACKET_COUNTERS_RESULT =
- new WifiCondManager.TxPacketCounters(2000, 120);
+ private static final WifiNl80211Manager.SignalPollResult SIGNAL_POLL_RESULT =
+ new WifiNl80211Manager.SignalPollResult(-60, 12, 6, 5240);
+ private static final WifiNl80211Manager.TxPacketCounters PACKET_COUNTERS_RESULT =
+ new WifiNl80211Manager.TxPacketCounters(2000, 120);
private static final Set<Integer> SCAN_FREQ_SET =
new HashSet<Integer>() {{
@@ -224,7 +224,7 @@ public class WifiNativeTest extends WifiBaseTest {
private static final RadioChainInfo MOCK_NATIVE_RADIO_CHAIN_INFO_2 = new RadioChainInfo(0, -78);
@Mock private WifiVendorHal mWifiVendorHal;
- @Mock private WifiCondManager mWificondControl;
+ @Mock private WifiNl80211Manager mWificondControl;
@Mock private SupplicantStaIfaceHal mStaIfaceHal;
@Mock private HostapdHal mHostapdHal;
@Mock private WifiMonitor mWifiMonitor;
@@ -236,8 +236,8 @@ public class WifiNativeTest extends WifiBaseTest {
@Mock private WifiInjector mWifiInjector;
@Mock private NetdWrapper mNetdWrapper;
- ArgumentCaptor<WifiCondManager.ScanEventCallback> mScanCallbackCaptor =
- ArgumentCaptor.forClass(WifiCondManager.ScanEventCallback.class);
+ ArgumentCaptor<WifiNl80211Manager.ScanEventCallback> mScanCallbackCaptor =
+ ArgumentCaptor.forClass(WifiNl80211Manager.ScanEventCallback.class);
private WifiNative mWifiNative;
@@ -708,7 +708,7 @@ public class WifiNativeTest extends WifiBaseTest {
when(mWificondControl.signalPoll(WIFI_IFACE_NAME))
.thenReturn(SIGNAL_POLL_RESULT);
- WifiCondManager.SignalPollResult pollResult = mWifiNative.signalPoll(WIFI_IFACE_NAME);
+ WifiNl80211Manager.SignalPollResult pollResult = mWifiNative.signalPoll(WIFI_IFACE_NAME);
assertEquals(SIGNAL_POLL_RESULT.currentRssiDbm, pollResult.currentRssiDbm);
assertEquals(SIGNAL_POLL_RESULT.txBitrateMbps, pollResult.txBitrateMbps);
assertEquals(SIGNAL_POLL_RESULT.associationFrequencyMHz,
@@ -752,8 +752,8 @@ public class WifiNativeTest extends WifiBaseTest {
public void testStartPnoScanOnRequestProcessed() throws Exception {
mWifiNative.startPnoScan(WIFI_IFACE_NAME, TEST_PNO_SETTINGS);
- ArgumentCaptor<WifiCondManager.PnoScanRequestCallback> captor = ArgumentCaptor.forClass(
- WifiCondManager.PnoScanRequestCallback.class);
+ ArgumentCaptor<WifiNl80211Manager.PnoScanRequestCallback> captor =
+ ArgumentCaptor.forClass(WifiNl80211Manager.PnoScanRequestCallback.class);
verify(mWificondControl).startPnoScan(eq(WIFI_IFACE_NAME),
eq(TEST_PNO_SETTINGS.toNativePnoSettings()), any(), captor.capture());
captor.getValue().onPnoRequestSucceeded();
@@ -767,8 +767,8 @@ public class WifiNativeTest extends WifiBaseTest {
public void testStartPnoScanOnRequestFailed() throws Exception {
mWifiNative.startPnoScan(WIFI_IFACE_NAME, TEST_PNO_SETTINGS);
- ArgumentCaptor<WifiCondManager.PnoScanRequestCallback> captor = ArgumentCaptor.forClass(
- WifiCondManager.PnoScanRequestCallback.class);
+ ArgumentCaptor<WifiNl80211Manager.PnoScanRequestCallback> captor =
+ ArgumentCaptor.forClass(WifiNl80211Manager.PnoScanRequestCallback.class);
verify(mWificondControl).startPnoScan(eq(WIFI_IFACE_NAME),
eq(TEST_PNO_SETTINGS.toNativePnoSettings()), any(), captor.capture());
captor.getValue().onPnoRequestFailed();
@@ -1015,7 +1015,8 @@ public class WifiNativeTest extends WifiBaseTest {
mWifiNative.probeLink(WIFI_IFACE_NAME, MacAddress.fromString(TEST_BSSID_STR),
mSendMgmtFrameCallback, TEST_MCS_RATE);
- verify(mSendMgmtFrameCallback).onFailure(WifiCondManager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
+ verify(mSendMgmtFrameCallback).onFailure(
+ WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
verify(mWificondControl, never()).sendMgmtFrame(any(), any(), anyInt(), any(), any());
}
@@ -1028,7 +1029,8 @@ public class WifiNativeTest extends WifiBaseTest {
mWifiNative.probeLink(WIFI_IFACE_NAME, null, mSendMgmtFrameCallback, TEST_MCS_RATE);
- verify(mSendMgmtFrameCallback).onFailure(WifiCondManager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
+ verify(mSendMgmtFrameCallback).onFailure(
+ WifiNl80211Manager.SEND_MGMT_FRAME_ERROR_UNKNOWN);
verify(mWificondControl, never()).sendMgmtFrame(any(), any(), anyInt(), any(), any());
}
}
diff --git a/tests/wifitests/src/com/android/server/wifi/p2p/WifiP2pNativeTest.java b/tests/wifitests/src/com/android/server/wifi/p2p/WifiP2pNativeTest.java
index 41952d71b..1bde4673b 100644
--- a/tests/wifitests/src/com/android/server/wifi/p2p/WifiP2pNativeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/p2p/WifiP2pNativeTest.java
@@ -37,7 +37,7 @@ import android.net.wifi.p2p.WifiP2pGroupList;
import android.net.wifi.p2p.WifiP2pManager;
import android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceInfo;
import android.net.wifi.p2p.nsd.WifiP2pServiceInfo;
-import android.net.wifi.wificond.WifiCondManager;
+import android.net.wifi.wificond.WifiNl80211Manager;
import android.os.Handler;
import androidx.test.filters.SmallTest;
@@ -84,7 +84,7 @@ public class WifiP2pNativeTest extends WifiBaseTest {
private static final String TEST_CLIENT_LIST = "aa:bb:cc:dd:ee:ff 11:22:33:44:55:66";
@Mock private WifiInjector mWifiInjector;
- @Mock private WifiCondManager mWifiCondManager;
+ @Mock private WifiNl80211Manager mWifiCondManager;
@Mock private WifiNative mWifiNative;
@Mock private WifiVendorHal mWifiVendorHalMock;
@Mock private SupplicantP2pIfaceHal mSupplicantP2pIfaceHalMock;