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

相关推荐
小妖6665 分钟前
怎么用 tauri 创建编译 android 应用程序
android·tauri
鸟儿不吃草1 小时前
安卓实现左右布局聊天界面
android·开发语言·python
xxjj998a3 小时前
Laravel 1.x:PHP框架的原始魅力
android·php·laravel
formula100003 小时前
在iOS/安卓上远程连接任何 Agent!Claude、Codex、Copilot、Gemini、OpenCode 等
android·copilot
该用户可能存在3 小时前
Blbl-android 更新至 v0.1.24,体验更流畅、更稳定
android·哔哩哔哩·电视app·androidtv·bbll·blbl·bilibilitv
lKWO OMET3 小时前
mysql之字符串函数
android·数据库·mysql
liang_jy14 小时前
Android SparseArray
android·源码
liang_jy14 小时前
Activity 启动流程扩展篇(一)—— startActivityInner 任务决策全解析
android·源码
NPE~15 小时前
[App逆向]脱壳实战
android·教程·逆向·android逆向·逆向分析
木易 士心16 小时前
别再只会用 drawCircle 了!一文搞懂 Android Canvas 底层机制
android