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

相关推荐
AIsoft_868913 小时前
手机视频转文字工具清单:哪些APP支持录屏识别
android·音视频
_祝你今天愉快15 小时前
Paint Cavans高级绘制:[一]Paint画笔高级应用
android
@zulnger16 小时前
安卓进行稳定性测试
android·appium·1024程序员节
不吃凉粉17 小时前
android 副屏连接
android
OxYGC18 小时前
手机为什么能“自动跳过“开屏广告?李跳跳、GKD 与 iOS 代理软件原理盘点
android·ios·开屏广告·广告屏蔽
Android-Flutter1 天前
Compose 管理状态 详解
android·compose
缓慢更新1 天前
审批的加签与会签:多人意见怎么合
android·java·数据库·低代码·rxjava
我怀里的猫1 天前
android-activity-launch-sequence
android
YB13751 天前
Jetpack Compose 动画rememberInfiniteTransition
android
baidu_247438611 天前
Android 自定义竖直的虚线
android