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

相关推荐
plainGeekDev35 分钟前
JUnit 4 → JUnit 5 + Kotlin
android·java·kotlin
plainGeekDev37 分钟前
Mockito → MockK
android·java·kotlin
1 小时前
使用ffmpeg将mp4视频转为m3u8格式
android·ffmpeg·音视频
00后程序员张1 小时前
使用Instruments工具深入分析iOS应用性能与启动时间优化
android·macos·ios·小程序·uni-app·cocoa·iphone
zbmwa2 小时前
jetpack compose 副作用 snapshotFlow
android
爱笑鱼2 小时前
Binder 实战(九):一次调用变慢,到底卡在客户端、驱动、Binder 线程还是 Handler?
android
恋猫de小郭3 小时前
Flutter hit,一个可以灵活控制溢出点击的第三方包
android·前端·flutter
我命由我123453 小时前
Kotlin 面向对象 - 枚举排序
android·java·开发语言·java-ee·kotlin·android studio·android-studio
fengci.20 小时前
Microweber CMS 未授权路径穿越漏洞(CVE-2026-65694)
android·开发语言·前端·学习·php
stevenzqzq21 小时前
Android 矢量图(Vector Drawable)核心坐标与尺寸机制技术文档
android