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

相关推荐
GY-932 分钟前
【Android】View和Componse
android
王二蛋与他的张大花2 小时前
后台内存 827MB,我一行业务逻辑都没改就砍到 100MB
android·flutter·性能优化
Paper_Love2 小时前
android安全公告网站
android
StarsGreen6 小时前
Android ADB(Android Debug Bridge)命令详解
android
阿健君6 小时前
现代 Android 屏幕适配完全指南
android·kotlin
软件交付观察室8 小时前
用户关掉手机定位权限后,原生App还能显示哪些位置?
android·ios·移动开发
黄林晴8 小时前
Jetpack Compose 1.13.0 来了:大量 API 弃用,表单代码要重构
android·android jetpack
黄林晴8 小时前
Kotlin Toolchain 太牛了!一个提示词就能构建 KMP 双端应用
android·kotlin
黄林晴8 小时前
KMP 跨端共享资源别踩坑!composeResources 看着香,上线容易翻车
android
黄林晴8 小时前
Gradle 9.9.0发布,构建速度提升65%!
android·gradle