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

相关推荐
ImTryCatchException3 分钟前
Android 卡顿诊断 SDK:从痛点出发的设计思考
android·gitee
流星白龙10 分钟前
【MySQL高阶】14.MySQL存储结构
android·数据库·mysql
流星白龙12 分钟前
【MySQL高阶】15.MySQL存储结构,页结构
android·mysql·adb
赏金术士35 分钟前
Android Tinker Demo 使用手册
android·热修复·tinker
Meteors.1 小时前
Kotlin协程序使用技巧和应用场景
android·开发语言·kotlin
黄林晴1 小时前
官方实战指南!Compose 项目无缝迁移 KMP
android·kotlin
tryqaaa_2 小时前
学习日志(五)【php反序列化全加例题】【pop链,字符逃逸,session,伪协议】
android·学习·php·web·pop·session
jingling5552 小时前
自建技术博客实战(三):工具专栏——地图定位、声音复刻与 rembg 抠图
android·开发语言·前端·ai·nextjs
Co_Hui2 小时前
Android:Service 启动
android
爱睡觉1112 小时前
Android 底层输入系统改造实录:把 gpio-keys "凭空捏造"成虚拟键盘
android