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

相关推荐
Android-Flutter11 小时前
android compose 知识点
android·compose
其实防守也摸鱼12 小时前
Codex 下载与本地部署实战:从安装到运行全指南
android·大数据·运维·安全·自动化
ttyyttemo12 小时前
协程并发执行与共享状态
android
miaowmiaow13 小时前
我让 AI 给老项目做了一次分层架构升级:对标 Now in Android,从「穿层」到「端口与适配器」
android·ai编程·deepseek
mmsx13 小时前
Android 栅格数据缓冲区的类型包装:用匿名子类破解泛型擦除
android·地图·栅格
叶羽西13 小时前
Android Camera HAL调整图像处理线程优先级
android
HouWan14 小时前
Flutter: MediaQuery.of(context) 为什么可能拖慢页面?
android·flutter·ios
事圆则缓14 小时前
Android 图片内存到底怎么算
android
Godikov14 小时前
弱网环境离线优先:Android 终端数据可靠同步架构实战
android