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信息并上报

相关推荐
Coffeeee16 小时前
如何使用Glide和Coil加载WebP动图
android·kotlin·glide
Kapaseker17 小时前
5 分钟搞懂 Kotlin DSL
android·kotlin
恋猫de小郭17 小时前
AI Agent 开发究竟是啥?如何用 AI 开发 Agent ?深入浅出给你一套概念
android·前端·ai编程
黄林晴18 小时前
Android 17 正式发布!target 37 一大批旧代码直接不能用了
android
Carson带你学Android18 小时前
Android 17 正式发布:AI 终于成了系统能力
android·前端·ai编程
三少爷的鞋18 小时前
当 UseCase 开始长期监听,它可能已经不是 UseCase 了
android
恋猫de小郭1 天前
Android 限制侧载新进展,谷歌联合国内厂商推验证计划
android·前端·flutter
恋猫de小郭1 天前
解读 Android 17 全新内存限制,有没有“豁免”后门?
android·前端·flutter
贾艺驰1 天前
实战Android Framework: 新增一个系统权限
android
alexhilton2 天前
使用Android Archive进行打包
android·kotlin·android jetpack