WifiConfigStore初始化读取-Android13

WifiConfigStore初始化读取

  • 1、StoreData创建并注册
  • 2、WifiConfigStore读取
    • 2.1 文件读取流程
    • 2.2 时序图
    • 2.3 日志


1、StoreData创建并注册

packages/modules/Wifi/service/java/com/android/server/wifi/WifiConfigManager.java

mWifiConfigStore.registerStoreData(mNetworkListSharedStoreData)
mWifiConfigStore.registerStoreData(mNetworkListUserStoreData)
mWifiConfigStore.registerStoreData(mRandomizedMacStoreData)
mWifiConfigStore.registerStoreData(mConnectedFreqStoreData)

packages/modules/Wifi/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java

wifiConfigStore.registerStoreData( wifiInjector.makeNetworkSuggestionStoreData(new NetworkSuggestionDataSource()))

2、WifiConfigStore读取

2.1 文件读取流程

1》当 SystemService.PHASE_SYSTEM_SERVICES_READY 系统服务准备,mImpl.checkAndStartWifi()通过WifiConfigManager.java#loadFromStore读取mWifiConfigStore.read()

/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
/data/misc/apexdata/com.android.wifi/WifiConfigStoreSoftAp.xml

2》当onUserUnlocking用户锁定,mImpl.handleUserUnlock通过WifiConfigManager.java#handleUserUnlockOrSwitch读取mWifiConfigStore.switchUserStoresAndRead(userStoreFiles)

/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStore.xml
/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStoreNetworkSuggestions.xml

packages/modules/Wifi/service/java/com/android/server/wifi/WifiService.java
packages/modules/Wifi/service/java/com/android/server/wifi/WifiServiceImpl.java

   @Overridepublic void onBootPhase(int phase) {if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {mImpl.checkAndStartWifi();} else if (phase == SystemService.PHASE_BOOT_COMPLETED) {mImpl.handleBootCompleted();}}@Overridepublic void onUserSwitching(TargetUser from, TargetUser to) {mImpl.handleUserSwitch(to.getUserHandle().getIdentifier());}@Overridepublic void onUserUnlocking(TargetUser user) {mImpl.handleUserUnlock(user.getUserHandle().getIdentifier());}

packages/modules/Wifi/service/java/com/android/server/wifi/WifiConfigManager.java

    public boolean loadFromStore() {// If the user unlock comes in before we load from store, which means the user store have// not been setup yet for the current user. Setup the user store before the read so that// configurations for the current user will also being loaded.if (mDeferredUserUnlockRead) {Log.i(TAG, "Handling user unlock before loading from store.");List<WifiConfigStore.StoreFile> userStoreFiles =WifiConfigStore.createUserFiles(mCurrentUserId, mFrameworkFacade.isNiapModeOn(mContext));if (userStoreFiles == null) {Log.wtf(TAG, "Failed to create user store files");return false;}mWifiConfigStore.setUserStores(userStoreFiles);mDeferredUserUnlockRead = false;}try {mWifiConfigStore.read();} catch (IOException | IllegalStateException e) {Log.wtf(TAG, "Reading from new store failed. All saved networks are lost!", e);return handleConfigStoreFailure(false);} catch (XmlPullParserException e) {Log.wtf(TAG, "XML deserialization of store failed. All saved networks are lost!", e);return handleConfigStoreFailure(false);}loadInternalData(mNetworkListSharedStoreData.getConfigurations(),mNetworkListUserStoreData.getConfigurations(),mRandomizedMacStoreData.getMacMapping(),mConnectedFreqStoreData.getFreqList());return true;}private void handleUserUnlockOrSwitch(int userId) {if (mVerboseLoggingEnabled) {Log.v(TAG, "Loading from store after user switch/unlock for " + userId);}// Switch out the user store file.if (loadFromUserStoreAfterUnlockOrSwitch(userId)) {saveToStore(true);mPendingUnlockStoreRead = false;}}private boolean loadFromUserStoreAfterUnlockOrSwitch(int userId) {try {List<WifiConfigStore.StoreFile> userStoreFiles =WifiConfigStore.createUserFiles(userId, mFrameworkFacade.isNiapModeOn(mContext));if (userStoreFiles == null) {Log.e(TAG, "Failed to create user store files");return false;}mWifiConfigStore.switchUserStoresAndRead(userStoreFiles);} catch (IOException | IllegalStateException e) {Log.wtf(TAG, "Reading from new store failed. All saved private networks are lost!", e);return handleConfigStoreFailure(true);} catch (XmlPullParserException e) {Log.wtf(TAG, "XML deserialization of store failed. All saved private networks are "+ "lost!", e);return handleConfigStoreFailure(true);}loadInternalDataFromUserStore(mNetworkListUserStoreData.getConfigurations());return true;}

2.2 时序图

在这里插入图片描述

2.3 日志

02-06 17:21:42.574  7067  7238 E WifiConfigManager: xhbruce loadFromStore
02-06 17:21:42.581  7067  7238 E WifiConfigStore: xhbruce readFromSharedStoreFiles : sharedStoreFile=/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:42.593  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.WifiCarrierInfoStoreManagerData@3b32c54:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@7c3a7fd
02-06 17:21:42.613  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.NetworkListSharedStoreData@28b6069:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@7c3a7fd
02-06 17:21:42.615  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.RandomizedMacStoreData@6ee3aee:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@7c3a7fd
02-06 17:21:42.615  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.ConnectedFreqManager$ConnectedFreqStoreData@b77cb8f:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@7c3a7fd
02-06 17:21:42.616  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.WifiSettingsConfigStore$StoreData@4655008:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@7c3a7fd
02-06 17:21:42.616  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.hotspot2.PasspointConfigSharedStoreData@89eb9c6:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@7c3a7fd
02-06 17:21:42.616  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeDatasInvoked=[com.android.server.wifi.RandomizedMacStoreData@6ee3aee, com.android.server.wifi.NetworkListSharedStoreData@28b6069, com.android.server.wifi.WifiCarrierInfoStoreManagerData@3b32c54, com.android.server.wifi.ConnectedFreqManager$ConnectedFreqStoreData@b77cb8f, com.android.server.wifi.hotspot2.PasspointConfigSharedStoreData@89eb9c6, com.android.server.wifi.WifiSettingsConfigStore$StoreData@4655008]
02-06 17:21:42.617  7067  7238 E WifiConfigStore: xhbruce readFromSharedStoreFiles : sharedStoreFile=/data/misc/apexdata/com.android.wifi/WifiConfigStoreSoftAp.xml
02-06 17:21:42.626  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.SoftApStoreData@91a0f05:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@38a1b5a
02-06 17:21:42.626  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeDatasInvoked=[com.android.server.wifi.SoftApStoreData@91a0f05]
02-06 17:21:42.627  7067  7238 D WifiConfigStore: Reading from all stores completed in 50 ms.
02-06 17:21:42.627  7067  7238 E WifiConfigManager: xhbruce loadFromStore : mNetworkListSharedStoreData=[- DSBLE ID: -1 SSID: "guest_5G" PROVIDER-NAME: null BSSID: null FQDN: null HOME-PROVIDER-NETWORK: false PRIO: 0 HIDDEN: false PMF: false CarrierId: -1 SubscriptionId: -1 SubscriptionGroup: null
02-06 17:21:42.635  7067  7238 E WifiConfigStore: xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:45.963  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:45.986  7067  7238 D WifiConfigStore: Writing to stores completed in 18 ms.
02-06 17:21:48.971  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:48.989  7067  7238 D WifiConfigStore: Writing to stores completed in 17 ms.
02-06 17:21:48.996  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:49.000  7067  7238 D WifiConfigStore: Writing to stores completed in 4 ms.
02-06 17:21:51.863  7067  7238 V WifiConfigManager: Handling user unlock for 0
02-06 17:21:51.868  7067  7238 V WifiConfigManager: Loading from store after user switch/unlock for 0
02-06 17:21:51.905  7067  7238 E WifiConfigStore: xhbruce readFromUserStoreFiles : userStoreFile=/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:51.915  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.ImsiPrivacyProtectionExemptionStoreData@eeb7cd8:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@15e2831
02-06 17:21:51.936  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.NetworkListUserStoreData@2bc166d:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@15e2831
02-06 17:21:51.959  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.hotspot2.PasspointConfigUserStoreData@378db33:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@15e2831
02-06 17:21:51.970  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.SsidSetStoreData@b302a1c:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@15e2831
02-06 17:21:51.970  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.NetworkRequestStoreData@dfea625:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@15e2831
02-06 17:21:51.971  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.WakeupConfigStoreData@1aa33fa:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@15e2831
02-06 17:21:51.971  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeDatasInvoked=[com.android.server.wifi.WakeupConfigStoreData@1aa33fa, com.android.server.wifi.NetworkListUserStoreData@2bc166d, com.android.server.wifi.ImsiPrivacyProtectionExemptionStoreData@eeb7cd8, com.android.server.wifi.hotspot2.PasspointConfigUserStoreData@378db33, com.android.server.wifi.NetworkRequestStoreData@dfea625, com.android.server.wifi.SsidSetStoreData@b302a1c]
02-06 17:21:51.971  7067  7238 E WifiConfigStore: xhbruce readFromUserStoreFiles : userStoreFile=/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStoreNetworkSuggestions.xml
02-06 17:21:51.976  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeData=com.android.server.wifi.NetworkSuggestionStoreData@69c74dd:storeFile:com.android.server.wifi.WifiConfigStore$StoreFile@c274852
02-06 17:21:51.982  7067  7238 E WifiConfigStore: xhbruce deserializeData : storeDatasInvoked=[com.android.server.wifi.NetworkSuggestionStoreData@69c74dd]
02-06 17:21:51.982  7067  7238 D WifiConfigStore: Reading from user stores completed in 98 ms.
02-06 17:21:51.999  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:52.020  7067  7238 E WifiConfigStore:  xhbruce write :userStoreFile:/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:52.084  7067  7238 E WifiConfigStore:  xhbruce write :userStoreFile:/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStoreNetworkSuggestions.xml
02-06 17:21:52.178  7067  7238 D WifiConfigStore: Writing to stores completed in 21 ms.
02-06 17:21:52.332  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:52.357  7067  7238 E WifiConfigStore:  xhbruce write :userStoreFile:/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:52.362  7067  7238 E WifiConfigStore:  xhbruce write :userStoreFile:/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStoreNetworkSuggestions.xml
02-06 17:21:52.379  7067  7238 D WifiConfigStore: Writing to stores completed in 17 ms.
02-06 17:21:52.386  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:52.401  7067  7238 E WifiConfigStore:  xhbruce write :userStoreFile:/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:52.419  7067  7238 D WifiConfigStore: Writing to stores completed in 18 ms.
02-06 17:21:54.247  7067  7238 E WifiConfigStore:  xhbruce write :sharedStoreFile:/data/misc/apexdata/com.android.wifi/WifiConfigStore.xml
02-06 17:21:54.247  7067  7238 E WifiConfigStore:  xhbruce write :userStoreFile:/data/misc_ce/0/apexdata/com.android.wifi/WifiConfigStore.xml

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/673961.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

读千脑智能笔记07_人工智能的未来(中)

1. 机器智能的未来 1.1. 没有任何技术原因阻止我们创造智能机器 1.1.1. 障碍在于我们缺乏对智能的理解&#xff0c;也不知道产生智能所需的机制 1.2. 历史表明&#xff0c;我们无法预测将推动机器智能向前发展的技术进步 1.2.1. …

pytorch训练指标记录之tensoboard,wandb

详解Tensorboard及使用教程_tensorboard怎么用-CSDN博客文章浏览阅读5.1w次&#xff0c;点赞109次&#xff0c;收藏456次。目录一、什么是Tensorboard二、配置Tensorboard环境要求安装三、Tensorboard的使用使用各种add方法记录数据单条曲线(scalar)多条曲线(scalars)直方图(hi…

使用frp时遇到的问题connect: connection refuseddial tcp xxxx:7000: connect: connection refused

最近在做的项目需要用到frp来做代理连接本地内网机&#xff0c;卡在最后启动客户端的时候&#xff0c;提示报错&#xff1a;login to server failed: dial tcp xxxx:7000: connect: connection refuseddial tcp xxxx:7000: connect: connection refused&#xff01;&#xff01…

功能强大的国外商业PHP在线教育系统LMS源码,直播课程系统

源码介绍 Proacademy是在线教育一体化的解决方案&#xff0c;用于创建类似于Udemy、Skillshare、Coursera这种在线教育市场。 这个平台提供在线课程&#xff0c;现场课程&#xff0c;测验等等&#xff0c;并有一个基于实际业务需要的高级认证插件&#xff0c;程序基于Laravel…

BeginCTF2024 RE 部分复现

8. arc 上面一托混淆&#xff0c;左边似乎是三个东西相乘 单独取出最左边一托打印&#xff0c;可以得到大数组 接下来要解密&#xff0c;原代码非常混乱&#xff0c;我们先整理一下&#xff0c;简单去混淆 print (all([[data][a][d] e for a, b in enumerate([[int(a) for a …

MOS管防反接电路设计

电子元件大都是使用直流工作&#xff0c;电源线反接就有可能就会烧坏&#xff0c;那电路如何防反接&#xff1f;首当其冲我们想到的就是二极管了&#xff0c;运用其单向导通特性可有效防止电源反接而损坏电路&#xff0c;但是随之而来的问题是二极管存在PN节电压&#xff0c;通…

PyTorch 2.2大更新!集成FlashAttention-2,性能提升2倍

【新智元导读】新的一年&#xff0c;PyTorch也迎来了重大更新&#xff0c;PyTorch 2.2集成了FlashAttention-2和AOTInductor等新特性&#xff0c;计算性能翻倍。 新的一年&#xff0c;PyTorch也迎来了重大更新&#xff01; 继去年十月份的PyTorch大会发布了2.1版本之后&#…

如何获取和查找您的Android设备的序列号

Hello大家好&#xff01;我是咕噜铁蛋&#xff01;&#xff0c;我们经常会在文章中提及到各种各样的Android设备&#xff0c;而其中一个重要的标识就是设备的序列号。设备的序列号在很多情况下被用于唯一标识一个设备&#xff0c;例如在软件开发中进行设备的调试和测试&#xf…

Redis篇之分布式锁

一、为什么要使用分布式锁 1.抢劵场景 &#xff08;1&#xff09;代码及流程图 &#xff08;2&#xff09;抢劵执行的正常流程 就是正好线程1执行完整个操作&#xff0c;线程2再执行。 &#xff08;3&#xff09;抢劵执行的非正常流程 因为线程是交替进行的&#xff0c;所以有…

C 语言学习七:指针

指针 指针与地址指针的声明和初始化指针的解引用指针的比较指针和数组指针数组指针和动态内存分配 指针与函数参数指针作为函数参数二级指针 指向函数的指针 指针与地址 指针的声明和初始化 int variable 42; int *ptr &variable; //间接访问 int value *ptr; // valu…

C# 实现微信自定义分享

目录 需求与调整 代码实现 获取令牌 生成合法票据 获取有效签名 客户端准备 客户端实现 小结 需求与调整 在微信中打开网页应用后&#xff0c;可以选择将地址发送给朋友进行分享&#xff0c;如下图&#xff1a; 在实际的应用中&#xff0c;我们可能不是简单的将该网页…

通过dockerfile 生成自定义nginx镜像

通过dockerfile生成自定义nginx镜像 &#xff01;&#xff01;&#xff01;docker 必须在linux环境下才能进行如果你是window则需要装虚拟机 新建一个文件名字为Dockerfile&#xff0c;无需后缀 文件完整名就是Dockerfile 编写dockerfile FROM nginx RUN echo hello nginx!…

Ubuntu Linux使用PL2302串口和minicom进行开发板调试

调试远程的服务器上面的BMC&#xff0c;服务器上面安装了Ubuntu&#xff0c;想着可以在服务器接个串口到BMC&#xff0c;然后SSH到服务器的Ubuntu&#xff0c;用minicom来查看串口信息。 准备&#xff1a; 服务器Ubuntu安装mimicom 本机可以ssh到Ubuntu 串口工具PL2302 或者CH3…

【数据分享】1929-2023年全球站点的逐年平均降水量(Shp\Excel\免费获取)

气象数据是在各项研究中都经常使用的数据&#xff0c;气象指标包括气温、风速、降水、湿度等指标&#xff0c;说到常用的降水数据&#xff0c;最详细的降水数据是具体到气象监测站点的降水数据&#xff01; 有关气象指标的监测站点数据&#xff0c;之前我们分享过1929-2023年全…

全局唯一id生成器 各种实现记录

全局唯一id生成器 Redis 生成 前提知识~~ 时间戳 时间戳这个东西我们老是听到,却可能不是特别了解 首先,时间戳是从1970年1月1号0点0分开始的秒数,我查了蛮多资料,理论上来说,时间戳是没有上限的,而我们一般用位数来限制这里的上限,比如32位 我们来实际计算一下 32位的二进…

巴尔加瓦算法图解:算法运用。

树 如果能将用户名插入到数组的正确位置就好了&#xff0c;这样就无需在插入后再排序。为此&#xff0c;有人设计了一种名为二叉查找树(binary search tree)的数据结构。 每个node的children 都不大于两个。对于其中的每个节点&#xff0c;左子节点的值都比它小&#xff0c;…

MySQL用心总结

大家好&#xff0c;好久不见&#xff0c;今天笔者用心一步步写一份mysql的基础操作指南&#xff0c;欢迎各位点赞收藏 -- 启动MySQL net start mysql-- 创建Windows服务 sc create mysql binPath mysqld_bin_path(注意&#xff1a;等号与值之间有空格) mysql -h 地址 -…

Android Studio安装过程遇到SDK无法安装问题解决

首次打开studio遇到该类问题&#xff0c;需要下载SDK文件&#xff0c;后又发现SDK由于是Google源&#xff0c;无法进行正常安装&#xff0c;故转而进行SDK的镜像安装。 一、下载SDK Tools 地址&#xff1a;AndroidDevTools - Android开发工具 Android SDK下载 Android Studio…

华为配置访客接入WLAN网络示例(MAC优先的Portal认证)

配置访客接入WLAN网络示例&#xff08;MAC优先的Portal认证&#xff09; 组网图形 图1 配置WLAN MAC优先的Portal认证示例组网图 业务需求组网需求数据规划配置思路配置注意事项操作步骤配置文件 业务需求 某企业为了提高WLAN网络的安全性&#xff0c;采用MAC优先的外置Portal认…

新型RedAlert勒索病毒针对VMWare ESXi服务器

前言 RedAlert勒索病毒又称为N13V勒索病毒&#xff0c;是一款2022年新型的勒索病毒&#xff0c;最早于2022年7月被首次曝光&#xff0c;主要针对Windows和Linux VMWare ESXi服务器进行加密攻击&#xff0c;到目前为止该勒索病毒黑客组织在其暗网网站上公布了一名受害者&#x…