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

相关推荐
石山代码7 小时前
KMP全栈开发:从Android到AI Agent的技术演进与实践
android·人工智能
怣疯knight9 小时前
kotlin安卓应用打包编译卡死的可能原因
android·kotlin
plainGeekDev10 小时前
NullPointerException → Kotlin 空安全
android·java·kotlin
2501_9160088912 小时前
苹果上架工具怎么选 不用 Mac 上架 App Store 的几种方案
android·macos·ios·小程序·uni-app·iphone·webview
jijihusong00613 小时前
KMP全栈开发教程:从Android到AI Agent
android·人工智能
_祝你今天愉快15 小时前
Android Binder 驱动 - 内核驱动层源码初探
android
stevenzqzq15 小时前
【无标题】
android
梦幻通灵16 小时前
Notepad++格式化Json两种方案【持续更新】
android·json·notepad++
1024+17 小时前
YOLO 转 RKNN 识别率降低调优操作手册(新手篇)
android·yolo·kotlin
木易 士心17 小时前
深度解析 Android 音频焦点处理与实战开发
android·音视频