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

相关推荐
Gary Studio8 小时前
安卓HAL编写
android
_李小白11 小时前
【android opencv学习笔记】Day 2: Mat类(图片数据结构体)
android·opencv·学习
jinanwuhuaguo12 小时前
OpenClaw工程解剖——RAG、向量织构与“记忆宫殿”的索引拓扑学(第十三篇)
android·开发语言·人工智能·kotlin·拓扑学·openclaw
小怪吴吴14 小时前
idea 开发Android
android·java·intellij-idea
xiaoyan201515 小时前
2026爆肝!Flutter3.41纯手撸微信聊天APP原生应用
android·flutter·dart
jinanwuhuaguo16 小时前
OpenClaw协议霸权——从 MCP 标准到意图封建化的政治经济学(第十八篇)
android·人工智能·kotlin·拓扑学·openclaw
撩得Android一次心动16 小时前
Android Room 数据库详解【源码篇】
android·数据库·android jetpack·room
TO_ZRG17 小时前
Android WorkManager 完全入门指南
android
a8a30218 小时前
Laravel 6.x新特性全解析
android
用户游民18 小时前
Android 腾讯X5WebView如何禁止系统自带剪切板和自定义剪切板视图
android·java