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

相关推荐
157092511341 小时前
Android进阶之光:HTTP协议原理深度解析
android·网络协议·http
终端安全笔记2 小时前
安卓五品牌通道差在哪:监管通道拆解
android
v_34836087623 小时前
Android native端 堆栈打印
android·算法
一笑的小酒馆3 小时前
AndroidKMP之导航和WebView
android
2501_932750267 小时前
Android BottomNavigationView 入门介绍
android
Godikov8 小时前
硬件异步事件下的业务一致性:智能柜领取/归还流程的竞态设计
android
Godikov8 小时前
不用 Netty:Android 手写 TCP 客户端实战——自定义协议帧、粘包处理与可靠重连
android
事圆则缓8 小时前
Java 面向对象如何落到 Android View 体系
android
iPad协议个微协议9 小时前
# 微信自动营销系统如何基于 WechatApi 做事件驱动设计
android·微信·企业微信·个人开发·wechatapi·微信个人号开发
AirDroid_cn10 小时前
隐私沙盒:第三方应用读取剪切板内容如何拦截?
android·gitee