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

相关推荐
jike_20261 小时前
安卓平台免费录音转文字工具深度测评:5 款 APP 功能对比与选型指南
android·智能电视
Code Man1 小时前
Windows 下使用 Appium
android·windows·appium
码农coding1 小时前
android 12 中的VSYNC接收
android
GitLqr1 小时前
Flutter 3.44 性能飞跃:深度解析 Android Platform View 的 HCPP 新特性
android·flutter·性能优化
码农coding2 小时前
android 12 SurfaceFlinger中的CompositionEngine
android
Mem0rin3 小时前
[MySQL] 聚合函数、分组查询、连接查询
android·mysql
码龙-DragonCoding3 小时前
一键批量提取音频、提取视频
android·音视频·提取
祉猷并茂,雯华若锦4 小时前
Win下完美解决Allure报错,生成Web自动化测试报告
android·python·selenium·自动化
IT小盘5 小时前
08-FastAPI加MySQL实现AI对话记录持久化
android·mysql·fastapi
alice--小文子5 小时前
安卓(Android)- 怎么在adb中通过真机操作日志相关
android·adb