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

相关推荐
zh_xuan1 小时前
kotlin Flow的用法2
android·开发语言·kotlin·协程·flow·被压
zh_xuan2 小时前
kotlin 测试协程嵌套
android·kotlin·协程
Doro再努力2 小时前
【Linux操作系统15】深入理解Linux进程概念:从理论到实践
android·linux·运维
城东米粉儿2 小时前
Android Lifecycle、LifecycleOwner、ViewLifecycleOwner、LifecycleScope、ViewModelScop
android
m0_528749003 小时前
sql基础查询
android·数据库·sql
安卓机器3 小时前
安卓玩机自做小工具------用于ROM修改 解打包boot.img修改小工具
android
独自破碎E3 小时前
BISHI66 子数列求积
android·java·开发语言
城东米粉儿3 小时前
Android Flow 笔记
android
测试工坊4 小时前
Android CPU 使用率不准?一文搞懂 DVFS 降频对性能数据的影响
android
城东米粉儿4 小时前
Android Hilt 笔记
android