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 小时前
安卓逆向之LSposed开发(一)
android·xposed·lsposed
YIN_尹2 小时前
【MySQL】数据类型(上)
android·mysql·adb
robotx3 小时前
AOSP设备节点权限添加相关
android
顾林海3 小时前
Android文件系统安全与权限控制:给应用数据上把“安全锁”
android·面试·操作系统
青莲8433 小时前
Android 动画机制完整详解
android·前端·面试
城东米粉儿3 小时前
android 离屏预渲染 笔记
android
未知名Android用户3 小时前
Android自定义 View + Canvas—声纹小球动画
android
_李小白4 小时前
【Android FrameWork】延伸阅读:AMS 的 handleApplicationCrash
android·开发语言·python
_李小白5 小时前
【Android FrameWork】第四十九天:SystemUI
android