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 9上修改build.fingerprint
android
帅次2 小时前
Compose 入门:@Composable、组合与重组
android·kotlin·gradle·android jetpack·compose·composable
洞见前行2 小时前
APK Signing Block V2 多渠道分包技术原理
android
DandelionR2 小时前
Android SDK安装
android
雪铃儿3 小时前
Flutter Android 热更新:我为什么没用 Shorebird 而是自己造了一个🚀
android·开源
angerdream3 小时前
Android手把手编写儿童手机远程监控App之通知栏消息
android
OCN_Yang5 小时前
能告诉我:你为什么用 MVI 吗?反正我不理解!
android·架构·前端框架
荣月灵的小梅花5 小时前
Android 给广播接收器增加权限(permission)或signature签名权限
android
沐言人生6 小时前
ReactNative 源码分析4——ReactActivity之加载JSBundle
android·react native
砖厂小工8 小时前
Now In Android 精讲 10 - AGENTS.md:写给 AI Agent 的项目说明书
android