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

相关推荐
脚大江山稳38 分钟前
单独为mysql数据库的某个库创建用户
android·数据库·mysql
吉哥机顶盒刷机1 小时前
XDBL安卓玩机刷机工具V2.8_解压缩版
android·智能手机·电脑
XiaoLeisj3 小时前
Android 广播机制实战:从系统广播监听、自定义登录通知到有序广播分发
android
urkay-3 小时前
Android 图片轮廓提取与重叠轮廓合并处理
android·算法·iphone
2501_916008893 小时前
2026 iOS 证书管理,告别钥匙串依赖,构建可复制的签名环境
android·ios·小程序·https·uni-app·iphone·webview
KevinCyao3 小时前
Go短信营销接口示例代码:Golang高并发调用营销短信接口的实现方案与代码分享
android·前端·网络·golang·前端框架
xiangxiongfly9155 小时前
Android 绘制流程源码分析
android·layout·measure·绘制流程·draw
进击的cc5 小时前
Android Kotlin:高阶函数与Lambda简化回调地狱
android·kotlin
1175 小时前
Android资源类型与常用的四种布局资源
android
常利兵5 小时前
Android 集合探秘:ArrayMap 与 SparseArray 的奇妙之旅
android·算法·哈希算法