android wifi源码分析,Wifi源码分析 (一) wifi初始化
时序图:
wifi初始化.png
1. 系统启动wifiServer
系统服务都是开机启动,不去说init什么等c的孵化器流程,直接进入run说起
@frameworks/base/services/java/com/android/server/SystemServer.java
private static final String WIFI_SERVICE_CLASS =
"com.android.server.wifi.WifiService";
public static void main(String[] args) {
new SystemServer().run();
}
private void run() {
...
startOtherServices();
...
}
private void startOtherServices() {
...
if (!mOnlyCore) {
if (context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WIFI)) {
// Wifi Service must be started first for wifi-related services.
traceBeginAndSlog("StartWifi");
mSystemServiceManager.startService(WIFI_SERVICE_CLASS);
traceEnd();
traceBeginAndSlog("StartWifiScanning");
mSystemServiceManager.startService(
"com.android.server.wifi.scanner.WifiScanningService");
traceEnd();
}
...
}
@frameworks/base/services/core/java/com/android/server/SystemServiceManager.java
public SystemService startService(String className) {
final Class serviceClass;
try {
serviceClass = (Class)Class.forName(className);
} catch (ClassNotFoundException ex) {
Slog.i(TAG, "Starting " + className);
throw new RuntimeException("Failed to create service " + className
+ ": service class not found, usually indicates that the caller should "
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
