AOSP - networkAttributes 中 CSV 的含义
AOSP - Meaning of CSV in networkAttributes
networkAttributes 的项目包含逗号分隔列表:
<string-array translatable="false" name="networkAttributes">
<item>"wifi,1,1,1,-1,true"</item>
<item>"ethernet,9,9,9,-1,true"</item>
</string-array>
值 "wifi,X,Y, ..." 是什么意思?
构造函数采用这些值,位于此处:platform/frameworks/base/core/java/android/net/NetworkConfig.java
看起来像这样:
/**
* input string from config.xml resource. Uses the form:
* [Connection name],[ConnectivityManager connection type],
* [associated radio-type],[priority],[dependencyMet]
*/
public NetworkConfig(String init) {
String fragments[] = init.split(",");
name = fragments[0].trim().toLowerCase(Locale.ROOT);
type = Integer.parseInt(fragments[1]);
radio = Integer.parseInt(fragments[2]);
priority = Integer.parseInt(fragments[3]);
restoreTime = Integer.parseInt(fragments[4]);
dependencyMet = Boolean.parseBoolean(fragments[5]);
}
它用在几个地方,例如:
platform/frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DcTracker.java 方法中 private void initApnContexts()
此致!
networkAttributes 的项目包含逗号分隔列表:
<string-array translatable="false" name="networkAttributes">
<item>"wifi,1,1,1,-1,true"</item>
<item>"ethernet,9,9,9,-1,true"</item>
</string-array>
值 "wifi,X,Y, ..." 是什么意思?
构造函数采用这些值,位于此处:platform/frameworks/base/core/java/android/net/NetworkConfig.java
看起来像这样:
/**
* input string from config.xml resource. Uses the form:
* [Connection name],[ConnectivityManager connection type],
* [associated radio-type],[priority],[dependencyMet]
*/
public NetworkConfig(String init) {
String fragments[] = init.split(",");
name = fragments[0].trim().toLowerCase(Locale.ROOT);
type = Integer.parseInt(fragments[1]);
radio = Integer.parseInt(fragments[2]);
priority = Integer.parseInt(fragments[3]);
restoreTime = Integer.parseInt(fragments[4]);
dependencyMet = Boolean.parseBoolean(fragments[5]);
}
它用在几个地方,例如:
platform/frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DcTracker.java 方法中 private void initApnContexts()
此致!