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

相关推荐
用户2181697049302 小时前
Kotlin 语法二
android
妖星3 小时前
android 源码分析surfaceFinger是如何通过设置属性启动bootanim
android
JoyMonitor3 小时前
APK mmap 内存增长定位:pagemap 与 DEX 结构联合定位方法
android
有什么事3 小时前
永久虚拟免费云手机能实现吗,本地安卓容器与云端托管的技术边界
android·智能手机
妖星3 小时前
Android 源码 .rc 语法详解
android
JMchen3 小时前
实战项目一——实现一个高性能图片滤镜App
android·c++·性能优化
白帽攻防录3 小时前
SRC 挖洞:Android 蓝牙预认证 RCE 深度复盘,CVE-2026-55330 怎么在蓝牙范围内零交互攻破手机
android·网络安全·智能手机·src漏洞挖掘
vilya4 小时前
手机端 Agent 是怎么跑起来的:决策循环、四道护栏、两条红线
android·agent
2501_915921434 小时前
详细教程:使用Perfdog工具测量iOS应用的功耗性能与优化方法
android·macos·ios·小程序·uni-app·cocoa·iphone
hunterandroid4 小时前
android方案 : Multiplatform 跨平台开发实战:一套代码,多端运行
android·前端