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

相关推荐
jijihusong00612 分钟前
KMP全栈开发教程:从Android到AI Agent
android·人工智能
_祝你今天愉快2 小时前
Android Binder 驱动 - 内核驱动层源码初探
android
stevenzqzq2 小时前
【无标题】
android
梦幻通灵3 小时前
Notepad++格式化Json两种方案【持续更新】
android·json·notepad++
1024+4 小时前
YOLO 转 RKNN 识别率降低调优操作手册(新手篇)
android·yolo·kotlin
木易 士心4 小时前
深度解析 Android 音频焦点处理与实战开发
android·音视频
祉猷并茂,雯华若锦5 小时前
Appium 3.x安卓APP企业级安装实战
android·appium
微露清风6 小时前
浅析 MySQL 索引
android·数据库·mysql
91刘仁德6 小时前
MySQL 数据类型详解
android·笔记·mysql·adb
编程圈子8 小时前
操作系统学习14 IDT + PIC + 键盘中断
android·学习·计算机外设