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

相关推荐
zh_xuan3 小时前
android ARouter配置降级服务
android·arouter
常利兵3 小时前
Android开发秘籍:接口加解密全解析
android
xuboyok24 小时前
MySQL中ON DUPLICATE KEY UPDATE的介绍与使用、批量更新、存在即更新不存在则插入
android·数据库·mysql
羑悻的小杀马特4 小时前
LangChain实战:工具调用+结构化输出,让AI从“聊天“变“干活“
android·人工智能·langchain
秋饼5 小时前
[EXPLAIN:SQL 执行计划分析与性能优化实战]
android·sql·性能优化
robotx6 小时前
如何从framework层面跳过app开屏广告(简单模拟)
android
毕设源码-朱学姐6 小时前
【开题答辩全过程】以 基于Android的大学生兼职APP设计为例,包含答辩的问题和答案
android
tongxh4236 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
阿拉斯攀登6 小时前
第 3 篇 保姆级手把手!RK 安卓驱动开发环境搭建(Ubuntu20.04 + 官方 SDK),踩坑全规避
android·驱动开发·瑞芯微·rk安卓驱动
新缸中之脑7 小时前
使用 AI 进行科学调试
android·人工智能·kotlin