分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
wifi相关的文件位置:
WIFISettings应用程序位于
packages/apps/Settings/src/com/android/settings/wifi/
JAVA部分:
frameworks/base/services/java/com/android/server/
frameworks/base/wifi/java/android/net/wifi/
JNI部分:
frameworks/base/core/jni/android_net_wifi_Wifi.cpp
wifi管理库。
hardware/libhardware_legary/wifi/
wifi用户空间的程序和库:
external/wpa_supplicant/
生成库libwpaclient.so和守护进程wpa_supplicant。
调用流程:
wifi模块的初始化:
(frameworks/base/services/java/com/android/server/SystemServer.Java)
在 SystemServer 启动的时候,会生成一个ConnectivityService 的实例,
classServerThreadextends Thread {
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
try {
Slog.i(TAG,"Connectivity Service");
connectivity= ConnectivityService.getInstance(context);
ServiceManager.addService(Context.CONNECTIVITY_SERVICE,connectivity);
} catch(Throwable e) {
Slog.e(TAG,"Failure starting Connectivity Service", e);
}
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
}
其中,ConnectivityService.getInstance(context); 对应于(frameworks/base/services/java/com/android/server/ ConnectivityService.Java)ConnectivityService.Java。
下面看下ConnectivityService.Java中的
publicstatic ConnectivityServicegetInstance(Context context) {
return ConnectivityThread.getServiceInstance(context);
}函数,继续往下看:
publicstatic ConnectivityService getServiceInstance(Context context) {
ConnectivityThreadthread = newConnectivityThread(context);
thread.start();
synchronized(thread) {
while(sServiceInstance == null) {
try {
// Wait until sServiceInstance has beeninitialized.
thread.wait();
} catch (InterruptedExceptionignore) {
Slog.e(TAG,
"UnexpectedInterruptedException while waiting"+
" forConnectivityService thread");
}
}
}
return sServiceInstance;
}
}
继续往下跟:
privatest