summaryrefslogtreecommitdiff
path: root/service
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 /service
parent127922d1ce95fa446295e3d2badb2e4e217b3b4e (diff)
parent4e38cb44d43abd564ca8109e4217f15706031bbf (diff)
Merge "[WIFICON] Rename to nl80211"
Diffstat (limited to 'service')
-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
8 files changed, 48 insertions, 45 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) {