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

相关推荐
zfoo-framework1 小时前
理解kotlin limitedParallelism(1)与Actor模型
android·开发语言·kotlin
2401_865721332 小时前
御网杯初赛2026
android
葱段3 小时前
【Compose】输入框(TextField)点击空白处失焦并关闭软键盘
android
刮风那天5 小时前
Android Framework 核心架构图
android
__Witheart__5 小时前
3588 安卓编译空间不足报错
android
aaajj5 小时前
【Android】手机屏幕劫持防护
android·智能手机
写做四月一日的四月一日6 小时前
在安卓手机上安装小龙虾openclaw并配置QQ机器人接入
android·人工智能
流星白龙6 小时前
【MySQL高阶】6.MySQL数据目录,日志
android·mysql·adb
福大大架构师每日一题6 小时前
rust 1.96.0 更新:语言、编译器、Cargo、Rustdoc、兼容性全面升级,必看完整解读
android·开发语言·rust
城管不管6 小时前
Agent——001
android·java·数据库·llm·prompt