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

相关推荐
tq108610 分钟前
学习Hilt注解
android
2501_9159214332 分钟前
iOS 应用代上架流程,多工具组合与使用 开心上架 跨平台自动化上传指南
android·ios·小程序·uni-app·自动化·cocoa·iphone
日日行不惧千万里37 分钟前
2025最新仿默往 IM 即时通讯系统源码(PC + Web + iOS + Android)完整版发布!
android·ios
歪歪10038 分钟前
React Native开发Android&IOS流程完整指南
android·开发语言·前端·react native·ios·前端框架
雪芽蓝域zzs43 分钟前
uniapp 修改android包名
android·uni-app
用户2018792831671 小时前
厨房里的协程大冒险:launch与async的烹饪之旅
android
用户2018792831671 小时前
浅析协程与挂起函数实现原理
android
木易士心2 小时前
Android Handler 机制原理详解
android·app
用户2018792831672 小时前
CoroutineDispatcher的"自由精灵" - Dispatchers.Unconfined
android
用户2018792831672 小时前
用 “奶茶连锁店的部门分工” 理解各种 CoroutineScope
android