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

相关推荐
2401_8332693016 小时前
Android registerForActivityResult详解
android
Carson带你学Android16 小时前
9月 Android Drop:Gemini 终于不只是聊天助手了
android·ai编程
Sagittarius_A*16 小时前
【LitCTF2026】lit_ezsql
android·java·数据库
hai_android17 小时前
Messenger:Android 最轻量的 IPC 方式
android·kotlin
gxgldyh18 小时前
Android Framework源码解析(十):Service启动全流程——从startService到Service执行的源码深度解析
android
换元不配限18 小时前
Android Studio Dolphin 新版Logcat 使用指南:告别混乱日志,高效定位问题
android·android studio·logcat
Android-Flutter19 小时前
android Binder 应用层开发 详解
android·binder
文人sec1 天前
MySQL主库出问题了,从库怎么办?备库为什么会延迟好几个小时?
android·数据库·mysql
hai_android1 天前
不用 AIDL,手把手教你手写 Binder 代理类
android·kotlin
mmsx1 天前
osmdroid 地图实战 03|地图的"分层世界":离线方案、图层模型与 Overlay 体系
android·前端