android wifi 热点获取client的名称

TetheringManager.java

registerTetheringEventCallback(Executor executor, TetheringEventCallback callback){

final ITetheringEventCallback remoteCallback = new ITetheringEventCallback.Stub() {

public void onTetherClientsChanged(final List<TetheredClient> clients) {

executor.execute(() -> callback.onClientsChanged(clients));

}

}

}

TetheredClient里的AddressInfo.getHostname 可以获取wifi客户端的名称

追代码(未验证)猜测:

Tethering.updateConnectedClients--->ConnectedClientsTracker.updateConnectedClients

public boolean updateConnectedClients(

Iterable<IpServer> ipServers, @Nullable List<WifiClient> wifiClients) {

for (IpServer server : ipServers) {

for (TetheredClient client : server.getAllLeases()) {

final TetheredClient prunedClient = pruneExpired(client, now);

if (prunedClient == null) continue; // All addresses expired

addLease(clientsMap, prunedClient);

}

}

}

最后是用ipserver获取所有的 dhcp信息并上报

相关推荐
ooseabiscuit23 分钟前
Laravel6.x核心优化与特性全解析
android·开发语言·javascript
阿巴斯甜2 小时前
Kotlin 协程 Coroutine
android
Jomurphys2 小时前
Compose 适配 - 通过 UiMediaScope 获取设备信息
android·compose
阿巴斯甜2 小时前
必看12
android
阿巴斯甜3 小时前
必看11
android
solo_993 小时前
Perftto 使用命令添加标签
android
阿巴斯甜3 小时前
必看10
android
阿巴斯甜3 小时前
必看9
android
阿巴斯甜3 小时前
必看6
android
angerdream3 小时前
Android手把手编写儿童手机远程监控App之SQLite详解
android