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_943782351 分钟前
【共创季稿事节】摩斯电码转换器:编码表与双向转换的实现
android·华为·鸿蒙·鸿蒙系统
STCNXPARM8 分钟前
Android selinux详解
android·selinux
jzwalliser11 分钟前
安卓手机玩转Manim动画制作
android·manim
zhangphil39 分钟前
Android图片解码器libjpeg-turbo vs Skia最佳实践
android
河铃旅鹿1 小时前
在Ubuntu系统上为Android交叉编译OpenSSL
android·linux·ubuntu
nannan85861 小时前
android 性能+AI 日志库-StatLog
android
xuankuxiaoyao2 小时前
Zygisk-LSPosed 模块完整作用说明
android
YXL1111YXL2 小时前
ViewModel 底层原理
android
阿pin2 小时前
Android随笔-APP首次启动流程
android·application·activity
阿pin2 小时前
Android随笔-SELinux是什么?
android·selinux