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

相关推荐
拾光Ծ13 分钟前
【MySQL】对表数据的操作:增删查改(CRUD)
android·数据库·sql·mysql
一笑的小酒馆10 小时前
Android中的tcp通信
android
默阳123413 小时前
2026年Android中高级面试题专栏(Android进阶篇)
android
古法安卓14 小时前
Android-日志系统源码解析
android·java·android studio
恋猫de小郭15 小时前
Android 17 + OkHttp 5.5.0 ,全新 ECH 下你的 HTTPS 域名可以请求时被安全隐藏
android·前端·flutter
小强闯江湖15 小时前
不只是让 AI 写代码:ViewCompose 把 Android UI 做成了可编译、可渲染的闭环
android·人工智能·kotlin
hunterandroid16 小时前
StateFlow 与 SharedFlow 的边界:状态与事件的正确建模
android·前端
YF021116 小时前
Android遥控器对频详解
android·android things
码农coding18 小时前
android12 WindowManagerService窗口的布局过程
android·源码
杉氧20 小时前
状态管理变迁史:为什么我们放弃了 Redux 选择 Zustand?
android·前端·react native