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

相关推荐
冬奇Lab7 小时前
相机拍照流程:从快门按下到JPEG存储的完整旅程
android·音视频开发·源码阅读
alexhilton7 小时前
在Compose中用Shader实现透明的粘稠元球效果
android·kotlin·android jetpack
jwn9999 小时前
Laravel5.x核心特性全解析
android·php·laravel
studyForMokey10 小时前
【Android面试】RecylerView专题
android·spring·面试
android_cai_niao12 小时前
Android中有什么技术过时了可以直接用新技术的
android·过时技术
lingggggaaaa13 小时前
PHP原生开发篇&文件安全&上传监控&功能定位&关键搜索&1day挖掘
android·学习·安全·web安全·php
我是场13 小时前
我的NPI项目 - OTA upgrade是什么?
android·人工智能
zh_xuan13 小时前
Android 实现fragment导航
android·fragment导航
java资料站13 小时前
MySQL 增量同步脚本
android·数据库·mysql
穷人小水滴13 小时前
手机安装 Cross Profile Test App (Android)
android·手机·一加