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

相关推荐
2501_916007471 小时前
苹果手机iOS应用管理全指南与隐藏功能详解
android·ios·智能手机·小程序·uni-app·iphone·webview
LFly_ice1 小时前
Nest-管道
android·java·数据库
ab_dg_dp3 小时前
android bugreport 模块源码分析
android
2501_915106324 小时前
全面理解 iOS 帧率,构建从渲染到系统行为的多工具协同流畅度分析体系
android·ios·小程序·https·uni-app·iphone·webview
繁星星繁4 小时前
【Mysql】数据库基础
android·数据库·mysql
李坤林4 小时前
Android 12 中 App 与 SurfaceFlinger(SF)的 Vsync 通信机制
android·surfaceflinger
高远-临客4 小时前
unity IL2CPP模式下中使用UMP插件打包后无法播放视频监控报错问题解决方案
android·unity·音视频
装不满的克莱因瓶4 小时前
Windows下安装Dart
android·flutter·dart·移动端
Yao_YongChao4 小时前
adb wifi连接Android手机
android·adb·智能手机·无线连接手机·wifi连接手机
安果移不动5 小时前
git Cherry-Pick合并分支上的某些commits-》Android studio
android·git·android studio