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

相关推荐
wen_zhufeng8 小时前
用 vLLM 加速 TTS 推理:通用改造指南
android·vllm
长友cy10 小时前
windows 搭建Qt编译Android 应用程序,快速搭建
android·windows
智驭未来掌门人11 小时前
Android Kotlin 开发避坑指南:从语言特性到工程化实践
android
码农coding11 小时前
android12 ViewRootImpl分析
android
stevenzqzq11 小时前
compose项目返回到当前页面闪烁原因分析
android
古法安卓12 小时前
Android-显示流程
android·java·android studio
CircleMouse12 小时前
画一个Android智能手机机器人
android·智能手机·机器人
数据知道13 小时前
PHP 代码审计实战——ThinkPHP、Laravel 历史漏洞模式深度剖析
android·网络·web安全·网络安全·php·laravel
拍客圈13 小时前
换服务器 mozcjpeg 5.0.0
android
蜡台14 小时前
Jetpack Compose 稳定性、重组优化(Stable / @NonRestartableComposable)
android·kotlin·compose·jepack