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

相关推荐
恋猫de小郭25 分钟前
KotlinLLM 开源 ,一个可以在运行时自己生成永久 Kotlin 代码的 Agent 库
android·前端·人工智能
游戏开发爱好者833 分钟前
iOS应用加固方案全解析:源码加固与IPA在线加固对比
android·macos·ios·小程序·uni-app·cocoa·iphone
大鹏说大话1 小时前
PHP 异步处理方案:队列使用场景与 RabbitMQ 实操
android
molihuan1 小时前
最新 Paddle-Lite Android平台编译
android·ocr·paddle·推理·端侧·paddle lite
小肝一下2 小时前
多态(上)
android·开发语言·c++·vscode·多态·面向对象·伊蕾娜
三少爷的鞋2 小时前
Android 面试系列:Retrofit 的 suspend 是如何实现的?
android
solo_9914 小时前
用 LSPosed 模拟录屏音频编码器卡顿:从思路到落地
android
zzq779714 小时前
别把大模型 API Key 写进 APK:移动 AI 应用接口防盗刷实践
android·人工智能·安全·app加固·御盾安全·安卓加固
xiaopang16 小时前
RK3568 AOSP 编译与快速部署实战
android