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

相关推荐
爱笑鱼1 小时前
Android 系统启动机制(七):进入 SystemServer.main() 以后,system_server 还是一个空进程吗?
android·linux
好安静2 小时前
SurfaceFlinger 合成一帧的完整流程
android
alexhilton2 小时前
架构测试为何需要双视图
android·kotlin·android jetpack
事圆则缓2 小时前
Jetpack Compose 快速上手
android·kotlin
y小花2 小时前
安卓HAL接口技术之HIDL&AIDL
android
YF02112 小时前
Android 系统自带机制的卸载更新都哪些实现方案
android
事圆则缓2 小时前
MVC、MVP、MVVM、MVI 的区别与实现原理
android·kotlin·mvc
事圆则缓3 小时前
Android组件化指南
android·kotlin
binbin_524 小时前
HarmonyOS 应用功耗优化实战:定位耗电、收口任务与验证回归
android·回归·harmonyos
AFinalStone4 小时前
Android 7系统无障碍服务(七)手势分发与 KeyEvent 处理
android·无障碍服务