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

相关推荐
余额瞒着我当琳2 小时前
C++模板初阶与STL初探
android·java·c++
知行合一。。。5 小时前
DeepAgents--01--Agent和OpenClaw的相关概念
android·数据库
汪海游龙6 小时前
告别 Play Console 手动上传:从模拟器截图到自动发版的完整流水线
android·ci/cd·github
weixin_440784116 小时前
【IntentSeivice实现原理】
android·java·开发语言·intentservice
delta_hell6 小时前
【阅读源码--Android】动画之ValueAnimator--2
android·源码·valueanimator
delta_hell6 小时前
【阅读源码--Android】动画之辅助类
android·源码·animator
delta_hell9 小时前
【阅读源码--Android】动画之ValueAnimator--1
android·源码·valueanimator
消失的旧时光-194310 小时前
第 2 篇:Android 控制屏为什么与机器人主控使用 TCP 长连接?
android·tcp/ip·机器人
小Ti客栈10 小时前
MySQL查询原理:从Server到InnoDB
android·mysql·adb
纪念 22912 小时前
MySQL(题目讲解二)
android·数据库·mysql