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

相关推荐
一起搞IT吧27 分钟前
高通Camx功能feature分析之十五:insensor zoom介绍及实现
android·智能手机·相机
aqi002 小时前
一文读懂 HarmonyOS 6.1 带来的十大重要升级
android·华为·harmonyos·鸿蒙·harmony
秋94 小时前
MySQL 9.7.0 使用详解:新特性、实战与避坑指南
android·数据库·mysql
狼与自由4 小时前
clickhouse ReplacingMergeTree
android·clickhouse
吉吉614 小时前
php反序列化基础知识前奏
android·php·反序列化
努力努力再努力wz4 小时前
【MySQL进阶系列】拒绝冗余SQL:带你透彻理解视图的底层逻辑
android·c语言·数据结构·数据库·c++·sql·mysql
常利兵4 小时前
安卓黑科技:实现多平台商品详情页一键跳转APP
android·科技
_李小白5 小时前
【android opencv学习笔记】Day 5: 高效的图像扫描
android·opencv·学习
liang_jy13 小时前
Android 窗口容器树(一)—— 窗口和窗口容器树
android·源码
HUGu RGIN13 小时前
MySQL--》如何在MySQL中打造高效优化索引
android·mysql·adb