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

相关推荐
tangweiguo030519874 小时前
Android Compose 物联网(IoT)UI 组件库封装指南
android
Ya-Jun7 小时前
性能优化实践:启动优化方案
android·flutter·ios·性能优化
百锦再8 小时前
Android Studio中OpenCV应用详解:图像处理、颜色对比与OCR识别
android·java·图像处理·opencv·kotlin·app·android studio
冬田里的一把火310 小时前
[Android]任务列表中有两个相机图标
android
麓殇⊙12 小时前
MySQL--索引入门
android·数据库·mysql
学习中的农民工13 小时前
Android ndk 编译opencv后部分接口std::__ndk1与项目std::__1不匹配
android·c++·opencv
贫道绝缘子13 小时前
【Android】四大组件之BroadcastReceiver
android
lucky_tom21 小时前
【android Framework 探究】pixel 5 内核编译
android
NO Exception?1 天前
完美解决 mobile-ffmpeg Not overwriting - exiting
android·ffmpeg·pcm
0wioiw01 天前
安卓基础(点击项目)
android·windows