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

相关推荐
___波子 Pro Max.1 小时前
Android envsetup与Python venv使用指南
android·python
武帝为此1 小时前
【MySQL 删除数据详解】
android·数据库·mysql
顾林海1 小时前
深度解析HashMap工作原理
android·java·面试
V少年2 小时前
深入浅出DiskLruCache原理
android
鱼洗竹2 小时前
协程的挂起与恢复
android
清风~徐~来3 小时前
【Linux】进程创建、进程终止、进程等待
android·linux·运维
百锦再4 小时前
Android游戏辅助工具开发详解
android·游戏·模拟·识别·辅助·外挂
QING6184 小时前
Kotlin 类型转换与超类 Any 详解
android·kotlin·app
QING6185 小时前
一文带你了解 Kotlin infix 函数的基本用法和使用场景
android·kotlin·app
张风捷特烈5 小时前
平面上的三维空间#04 | 万物之母 - 三角形
android·flutter·canvas