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

相关推荐
多彩电脑13 小时前
向AIDE(安卓设备上的Android Studio)导入aar库
android·java·开发语言·androidx
恋猫de小郭13 小时前
解析华为 DevEco Code 和小米 MiMo Code,都基于 OpenCode ,有什么区别?
android·前端·ios
2501_9327502614 小时前
Android 控件与布局全面解析
android
问心无愧051314 小时前
ctfshow web入门114
android·前端·笔记
黄林晴14 小时前
离谱!Android 17藏神仙功能,手机录屏叠加真人出镜
android
朱涛的自习室14 小时前
Harness 还没学会,又来了个 Loop Engineering ?
android·人工智能·github
问心无愧051314 小时前
ctf show web入门115
android·前端·笔记
牢七14 小时前
dedecms审计(废案)
android
执明wa14 小时前
为什么 Android 要把数据、视图和适配器分开?RecyclerView解读
android
三少爷的鞋15 小时前
别再让业务层裸奔 CarPropertyManager 了!谈谈汽车车载核心服务的架构封装
android