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

相关推荐
墨天梦14 分钟前
D03_Compose列表与稳定身份
android·gitee·kotlin
萌新杰少1 小时前
Kuikly股票查看软件开发体验——SaiRen
android·kotlin·客户端
vilya1 小时前
把 Python 塞进 APK:Chaquopy 打包实践
android·python
用户92817267390161 小时前
Android Compose版本的AI组件库来了。
android·kotlin
知昂七昂1 小时前
00-02:AOSP 源码阅读环境与检索方法论源码剖析(Android 16 / aosp-main)
android
知昂七昂1 小时前
00-01:AOSP 源码仓库结构与 repo 工作流源码剖析(Android 16 / aosp-main)
android·google
跨境数据猎手1 小时前
Android Native 层黑盒调用实战:unidbg 模拟执行 so 的原理
android
镜象科技2 小时前
中小学AI心理健康解决方案服务商怎么选?2026年选型参考
android·java·人工智能
脚踏实地,坚持不懈!3 小时前
从 AOSP 源码角度分析 Android 定位性能问题
android
悟道子HD3 小时前
网络安全基本功——MySQL基础
android·mysql·web安全