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

相关推荐
梁同学与Android7 分钟前
Android ---【经验篇】ArrayList vs CopyOnWriteArrayList 核心区别,怎么选择?
android·java·开发语言
沐怡旸1 小时前
【翻译】adb screenrecord 帮助文档
android
lienyin2 小时前
Android 简单的SFTP服务端+客户端通信传文件
android
fatiaozhang95277 小时前
中兴B860AV5.2-U_原机安卓4.4.2系统专用_晶晨S905L3SB处理器_线刷固件包
android·电视盒子·刷机固件·机顶盒刷机·中兴b860av5.2-u
儿歌八万首7 小时前
Android 自定义 View 实战:打造一个跟随滑动的丝滑指示器
android·kotlin
我有与与症7 小时前
Kuikly 实战:手把手撸一个跨平台 AI 聊天助手 (ChatDemo)
android
恋猫de小郭8 小时前
Flutter UI 设计库解耦重构进度,官方解答未来如何适配
android·前端·flutter
apihz8 小时前
全球IP归属地查询免费API详细指南
android·服务器·网络·网络协议·tcp/ip
hgz07109 小时前
Linux环境下MySQL 5.7安装与配置完全指南
android·adb