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

相关推荐
冬奇Lab41 分钟前
AudioTrack音频播放流程深度解析
android·音视频开发·源码阅读
青莲8433 小时前
查找算法详解
android·前端
青莲8433 小时前
排序算法详解
android·前端
zd2005724 小时前
用摩斯密码「听」时间:一款安卓报时应用的诞生
android
不会写代码的猴子4 小时前
Android17版本更新预览
android·android studio
用户41659673693555 小时前
记一次深坑:RecyclerView + FlexboxLayoutManager 导致 canScrollVertically 误判的剖析与修复
android
Be for thing6 小时前
Android 音频硬件(Codec / 喇叭 / 麦克风)原理 + 功耗与问题定位实战(手机 / 手表通用)
android·学习·智能手机·音视频
吉哥机顶盒刷机6 小时前
S905L3A/L3AB芯片迎来安卓14新纪元:Sicha移植版固件深度评测与刷机指南
android·经验分享·刷机
一个天蝎座 白勺 程序猿6 小时前
KingbaseES数据库MySQL兼容性解析:从TCO账本到“傻瓜式“迁移的密码
android·数据库·mysql·kingbasees