Android11 Wi-Fi 开启_android wifimanager.setwifienabled() 不起作用_ho_mgx的博客-CSDN博客
Android 11 WiFi启动流程_android wifi启动流程_ChaserDtao的博客-CSDN博客
Android 11 热点(softap)流程分析_android softap_LILI007的博客-CSDN博客
ActiveModeWarden.java | ||
HostapdHal.java | To maintain thread-safety, the locking protocol is that every non-static method (regardless of access level) acquires mLock. | |
HalDeviceManager.java | ||
SupplicantStaIfaceHal.java | ||
SupplicantStateTracker.java | ||
SupplicantStateTracker.java | ||
WifiMonitor.java | ||
WifiNative.java | ||
WifiVendorHal.java |
frameworks/opt/net/wifi/service/java/com/android/server/wifi/ActiveModeWarden.java
/**
* To maintain thread-safety, the locking protocol is that every non-static method (regardless of
* access level) acquires mLock.
*/
frameworks/opt/net/wifi/service/java/com/android/server/wifi/HostapdHal.java
/**
* Handles device management through the HAL (HIDL) interface.
*/
frameworks/opt/net/wifi/service/java/com/android/server/wifi/HalDeviceManager.java
/**
* Hal calls for bring up/shut down of the supplicant daemon and for
* sending requests to the supplicant daemon
* To maintain thread-safety, the locking protocol is that every non-static method (regardless of
* access level) acquires mLock.
*/
frameworks/opt/net/wifi/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
/**
* Tracks the state changes in supplicant and provides functionality
* that is based on these state changes:
* - detect a failed WPA handshake that loops indefinitely
* - authentication failure handling
*/
frameworks/opt/net/wifi/service/java/com/android/server/wifi/SupplicantStateTracker.java
frameworks/opt/net/wifi/service/java/com/android/server/wifi/SupplicantStaNetworkHal.java
frameworks/opt/net/wifi/service/java/com/android/server/wifi/SupplicantStateTracker.java
/**
* WifiMonitor: Listen for events from the wpa_supplicant & wificond and broadcast them on
* to the various {@link ClientModeImpl} modules interested in handling these events.
*/
frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMonitor.java
/**
* Native calls for bring up/shut down of the supplicant daemon and for
* sending requests to the supplicant daemon
*/
frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiNative.java
//Vendor HAL via HIDL
frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiVendorHal.java
hal的接口,可以生成IWifi.java
hardware/interfaces/wifi/1.0/IWifi.hal
hardware/interfaces/wifi/1.4/default
hardware/interfaces/wifi/1.4/default/wifi.cpp (startWifi在这儿)
(1)startHal方法内部调用
startHal()->startHal()->WifiVendorHal.startVendorHal()->HalDeviceManager.start()->HalDeviceManager.startWifi()
./net/wifi/service/java/com/android/server/wifi/WifiNative.java:612:
mHostapdHal.removeAccessPoint
./net/wifi/service/java/com/android/server/wifi/WifiNative.java:631:
setupInterfaceForSoftApMode
createApIface
InterfaceDestoyedListenerInternal-->onDestroyed
onInterfaceDestroyed
onSoftApInterfaceDestroyed
frameworks/opt/net/wifi/service/java/com/android/server/wifi/SoftApManager.java
mApInterfaceName = mWifiNative.setupInterfaceForSoftApMode
startSoftAp
frameworks/opt/net/wifi/service/java/com/android/server/wifi/ActiveModeWarden.java
stopSoftApModeManagers
WifiCond
wificond 启动hostapd,wpa_supplicant以及扫描
在frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiInjector.java
说明wificond应该是个系统服务
mWifiCondManager = (WifiNl80211Manager) mContext.getSystemService(
Context. WIFI_NL80211_SERVICE);
mWifiNative = new WifiNative(
mWifiVendorHal, mSupplicantStaIfaceHal, mHostapdHal, mWifiCondManager,
mWifiMonitor, mPropertyService, mWifiMetrics,
wifiHandler, new Random(), this);
为什么会需要wificond还不太清楚