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

相关推荐
shih9457 小时前
16G 内存不够用之后,我把旧安卓手机接进了 k3s 集群
android·k3s
阿杰m7 小时前
Android源码第三十章:Android Automotive、TV 与桌面模式
android
意念回复16 小时前
Transformer 系列(五):从 Block 到模型——三大架构、因果掩码与自回归生成
android·回归·transformer
松仔log18 小时前
Kotlin中级——KMP
android·开发语言·kotlin
GY-9318 小时前
【Android】SQL数据库
android
GY-9319 小时前
【Android】适配不同的屏幕尺寸
android
Chenpip120 小时前
安卓 14/15 上装不上:四层原因与三行检查
android·app分发·应用分发·海哈游分发·内测
TT哇20 小时前
【Android 之旅】Android 通俗易懂记
android·gitee
雨白20 小时前
工厂设计模式实战:从简单工厂到抽象工厂的演进之路
android
Digitally21 小时前
7 种主流安卓设备备份与恢复方法
android