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

相关推荐
墨天梦23 分钟前
B16_Material主题与可访问交互
android·kotlin·交互
弯_弯32 分钟前
企业知识库 RAG 落地:从 Demo 到生产,四条工程链路与参数级自查
android·java·javascript
晚风叙码2 小时前
MySQL 表的约束详解:从空属性到外键
android·数据库·mysql·adb
alexhilton12 小时前
模块化Jetpack Compose架构
android·kotlin·android jetpack
厮年断弦14 小时前
AI 辅助开发实录:一周做完一个 Android 本地音乐播放器,这些坑替你踩了
android
hai_android15 小时前
InputStage 责任链核心执行流程
android·android studio·android jetpack
mmsx18 小时前
Android 测绘计算工程化:七四参数、高程拟合与单位系统
android·kotlin
我是场19 小时前
我的NPI项目之-Touch的EE特性
android·arm开发
天空之城--20 小时前
Android一周动态:AI编程、Compose与车载生态新信号
android·flutter
恋猫de小郭21 小时前
Dart 4.0 要彻底移除 dart:mirrors,Augmentations 应该要来了
android·前端·flutter