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

相关推荐
雨白4 小时前
NDK 初探:基于 C++ 实现参数哈希与签名校验
android
程序员正茂4 小时前
Android studio中初步使用OpenCV库
android·opencv
紫_龙5 小时前
window 维护多版本Android studio
android·ide·android studio
杉氧6 小时前
KMP 自动化之路 (4):iOS 自动化构建与签名 —— 攻克最硬的骨头
android·架构·android jetpack
通玄10 小时前
Jetpack Compose 入门系列(十):Paging 3 分页加载
android
vistaup10 小时前
Android studio 历史版本
android·ide·android studio
hunterandroid10 小时前
DataStore 工程化实践:迁移、并发更新与异常恢复
android·前端
程序员-珍13 小时前
报错下载android sdk失败
android·java
齊家治國平天下14 小时前
AAOS 电源管理深度解析:休眠/唤醒/功耗优化
android·车载系统·aaos·aosp·电源管理·休眠唤醒·carpowermanager
qq36219670514 小时前
安卓大版本升级后APK不兼容怎么办?2026跨版本更新指南
android