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

相关推荐
weixin_394758036 小时前
CRMEB Pro 优惠券:下单怎么核销,取消/退款怎么返券
android
alexhilton8 小时前
Android 17 内存预算成为必修课
android·kotlin·android jetpack
AI2中文网10 小时前
App Inventor 对接 OneNet:手机收数据
android·鸿蒙·app inventor
好的佩奇11 小时前
Dart 之文件读写
android·flutter·dart
砚底藏山河13 小时前
量化行情横截面中性化闭式与回归实现
android·java·python·金融·kotlin
明君68913 小时前
APK 签名绕过方案(Android 10~17)
android
芝麻别开门13 小时前
Android libmpv 源码下载与编译
android·mpv·libmpv
FLJwu13 小时前
运动相机代工模具风控③:试模样品、结构公差、装配干涉,提前规避大货装配不良
android·开发语言·数码相机·运动相机·oem 量产
应用市场14 小时前
安卓底层拆解(四)· 属性要成套:abilist 与 zygote 的连锁反应
android·zygote
齊家治國平天下15 小时前
Android Automotive(AAOS)系统入门:从五层架构到车载机制
android·架构·车载系统·aaos·智能座舱