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

相关推荐
飘逸飘逸38 分钟前
Autojs进阶前言
android·javascript
spencer_tseng38 分钟前
Branding Printing System (Android Pad)
android·pad
FrameNotWork1 小时前
多设备 Android Logcat 自动采集方案:基于 Docker + Shell 实现日志按天切割与自动清理
android·docker·容器
bqliang3 小时前
Compose 实验性 Styles API
android·android jetpack
大尚来也3 小时前
PHP 入门指南:从零基础到掌握核心语法
android
summerkissyou19873 小时前
android -wifi/蓝牙-常见面试题
android·wifi·bluetooth
XiaoLeisj3 小时前
Android Activity 页面导航基础:Manifest 声明、Intent 显式/隐式跳转与数据传递
android·java
littlegnal4 小时前
Flutter Android如何延迟加载代码
android·flutter
秋氘渔4 小时前
MySQL EXPLAIN实战:6种索引失效场景验证与优化
android·数据库·mysql·索引