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

相关推荐
alexhilton1 小时前
MVI模式的完整历史、误解和现代Android范式
android·kotlin·android jetpack
心中有国也有家7 小时前
AtomGit Flutter 鸿蒙客户端:Canvas 绘制进阶-路径、渐变与混合模式
android·javascript·flutter·华为·harmonyos
hunterandroid8 小时前
WorkManager 可靠性实战:唯一任务、重试与幂等设计
android·前端
程序员老刘8 小时前
Android 17的10个AI功能,国内用户真正能用的有几个?
android·flutter·ai编程
花开彼岸天~9 小时前
鸿蒙应用开发实战【94】— 实战多卡号场景管理最佳实践
android·华为·harmonyos·鸿蒙系统
用户41659673693559 小时前
视频源文件音频轨异常分析记录
android
我命由我1234510 小时前
集成 mupdf-android 的示例做为模块使用报错,程序包android.support.v4.view不存在
android·java·java-ee·android studio·android jetpack·android-studio·android runtime
雨白12 小时前
嵌套 ScrollView 滑动冲突实战:实现内部优先滚动
android
阿pin12 小时前
Android随笔-IntentService详解(了解)
android·intentservice
海天鹰13 小时前
content://com.android.externalstorage.documents/document/primary%3A
android