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

相关推荐
修炼者3 小时前
【进阶Android】HashMap 的并发“车祸”
android
冬奇Lab5 小时前
Android 15音频子系统(六):音频焦点管理机制深度解析
android·音视频开发·源码阅读
LionelRay7 小时前
Thinking in Compose
android
用户69371750013848 小时前
Google 推 AppFunctions:手机上的 AI 终于能自己干活了
android·前端·人工智能
用户69371750013849 小时前
AI让编码变简单,真正拉开差距的是UI设计和产品思考
android·前端·人工智能
zh_xuan9 小时前
Android Jetpack DataStore存储数据
android·android jetpack·datastore
程序员陆业聪9 小时前
在 Android 上跑大模型,你选错引擎了吗?
android
studyForMokey10 小时前
【Android面试】View绘制流程专题
android·面试·职场和发展
jjinl12 小时前
Android 资源说明
android
恋猫de小郭14 小时前
Swift 6.3 正式发布支持 Android ,它能在跨平台发挥什么优势?
android·前端·flutter