diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiNative.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java index c19584554..23e7f0cab 100644 --- a/service/java/com/android/server/wifi/WifiNative.java +++ b/service/java/com/android/server/wifi/WifiNative.java @@ -30,6 +30,7 @@ import android.os.INetworkManagementService; import android.os.RemoteException; import android.os.SystemClock; import android.text.TextUtils; +import android.util.ArraySet; import android.util.Log; import com.android.internal.annotations.Immutable; @@ -279,6 +280,17 @@ public class WifiNative { return iface.name; } + private @NonNull Set<String> findAllStaIfaceNames() { + Set<String> ifaceNames = new ArraySet<>(); + for (Iface iface : mIfaces.values()) { + if (iface.type == Iface.IFACE_TYPE_STA_FOR_CONNECTIVITY + || iface.type == Iface.IFACE_TYPE_STA_FOR_SCAN) { + ifaceNames.add(iface.name); + } + } + return ifaceNames; + } + /** Removes the existing iface that does not match the provided id. */ public Iface removeExistingIface(int newIfaceId) { Iface removedIface = null; @@ -1258,6 +1270,17 @@ public class WifiNative { } /** + * Get names of all the client interfaces. + * + * @return List of interface name of all active client interfaces. + */ + public Set<String> getClientInterfaceNames() { + synchronized (mLock) { + return mIfaceMgr.findAllStaIfaceNames(); + } + } + + /** * Get name of the softap interface. * * This is mainly used by external modules that needs to perform some |