grepcode サイトから AOSP コードをトレースしようとしています。
を呼び出すとgetSystemService(Context.WIFI_P2P_SERVICE)
、次のコードになります。
@Override public Object getSystemService(String name) {
if (getBaseContext() == null) {
throw new IllegalStateException(
"System services not available to Activities before onCreate()");
}
if (WINDOW_SERVICE.equals(name)) {
return mWindowManager;
} else if (SEARCH_SERVICE.equals(name)) {
ensureSearchManager();
return mSearchManager;
}
return super.getSystemService(name);
}
そして、WIFI_P2P_SERVICE
として宣言されているpublic static final String WIFI_P2P_SERVICE = "wifip2p";
ため、条件のいずれにも該当せず、super.getSystemService(name);
Activity extends ContextThemeWrapper, the code there is:
@Override public Object getSystemService(String name) {
if (LAYOUT_INFLATER_SERVICE.equals(name)) {
if (mInflater == null) {
mInflater = LayoutInflater.from(mBase).cloneInContext(this);
}
return mInflater;
}
return mBase.getSystemService(name);
}
ここでも、必要なサービス名が一致しません。これmBase
はのインスタンスであるContext
ため、Context のコードは次のようになります。
public abstract Object getSystemService(String name);
つまり、そこから拡張されたクラスはその機能を処理する必要があります。 さて、私のリクエストはどこで処理されますか?