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

相关推荐
embrace9923 分钟前
【C语言学习】结构体详解
android·c语言·开发语言·数据结构·学习·算法·青少年编程
用户693717500138443 分钟前
11.Kotlin 类:继承控制的关键 ——final 与 open 修饰符
android·后端·kotlin
用户02738518402644 分钟前
【Android】LiveData的使用以及源码浅析
android·程序员
用户69371750013841 小时前
10.Kotlin 类:延迟初始化:lateinit 与 by lazy 的对决
android·后端·kotlin
正经教主1 小时前
【Git】Git06:Git 管理 Android 项目教程(含GitHub)
android·git
安卓理事人1 小时前
安卓多种通知ui更新的方式(livedata,rxjava,eventbus等)
android·ui·echarts
BS_Li1 小时前
【Linux系统编程】Ext系列文件系统
android·linux·ext系列文件系统
zhangphil2 小时前
Android宽高不均等Bitmap缩放为指定宽高FitCenter到正方形Bitmap,Kotlin
android·kotlin
别或许2 小时前
13.用户管理
android
q***96584 小时前
springboot3整合knife4j详细版,包会!(不带swagger2玩)
android·前端·后端