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

相关推荐
pengyu24 分钟前
【Kotlin 协程修仙录 · 大乘境 · 后阶】 | 死锁天劫:协程同步原语与 ThreadLocal 迁移之道
android·kotlin
事圆则缓24 分钟前
Android 常用设计模式速查
android·设计模式
sickworm陈浩26 分钟前
日常修改,3秒生效:腾讯音乐 Android 秒编方案 Jugg 开源
android·编译原理·编译器
Android-Flutter33 分钟前
android PhoneWindow, DecorView 详解
android
宝杰X71 小时前
Android Umeng 16kb对齐
android
2601_966563521 小时前
NativeWasmTv超精简2m安装包 长效免费电视直播软件-支持老电视盒子安卓4.0
android·电视盒子
Knight_AL1 小时前
MySQL 递归 CTE:WITH RECURSIVE 用法详解
android·数据库·mysql
恋猫de小郭1 小时前
聊个比较有意思的 Flutter Web 问题
android·前端·flutter
stevenzqzq1 小时前
Compose 生命周期与副作用的核心奥秘
android·compose
2501_915918411 小时前
Flutter项目配置iOS混淆的详细步骤与工具推荐
android·flutter·ios·小程序·uni-app·cocoa·iphone