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

相关推荐
StarsGreen2 小时前
Android VINTF 中 Device Manifest 与 Framework Manifest 详解
android
Name_NaN_None4 小时前
安卓手机远程控制电脑方法(Android/Windows) —— 「小白教程」
android·windows·智能手机·电脑·笔记本
恋猫de小郭4 小时前
Flutter Perfetto:Dart Heap Sampling 终于要接入 Android 原生内存分析了
android·前端·flutter
敢敢のwings15 小时前
GR00T 2:当机器人学会先想象未来,再决定怎么动
android·机器人
传奇开心果编程15 小时前
【Jetpack Compose娓娓道来】第55课:传感器与设备姿态——把物理世界的数据接进Compose
android·kotlin·移动开发·传感器·jetpack compose·ui框架·声明式ui
传奇开心果编程16 小时前
【Jetpack Compose娓娓道来】第52课:蓝牙与位置权限——把“附近”和“在哪”安全地接进Compose
android·kotlin·移动开发·蓝牙·jetpack compose·声明式ui·位置权限
alexhilton17 小时前
卡顿定位:从 UI 线程到 RenderThread
android·kotlin·android jetpack
FungLeo18 小时前
FengCMS· PHP+MySQL升级实录 · 后台参数统一治理:id[]数组、id=undefined 跳转与312组回调组合
android·mysql·php·工程实践·fengcms
北斗星_And18 小时前
七年后再看 Android 底层:机制没变,路变短了
android·ai编程
王二蛋与他的张大花19 小时前
反编译后只剩 2 个类:一次自研 DEX 壳加固的完整复盘
android·安全·逆向