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