CTS测试中出现如下CASE FAIL:
android.net.cts.ConnectivityManagerTest-- testGetAllNetworkInfo
android.net.cts.ConnectivityManagerTest-- testGetNetworkInfoandroid.net.cts.ConnectivityManagerTest-- testIsNetworkSupported
android.net.cts.ConnectivityManagerTest-- testIsNetworkTypeValidandroid.net.cts.ConnectivityManagerTest-- testRequestRouteToHost
android.net.cts.ConnectivityManagerTest-- testSetNetworkPreference
android.net.http.cts.ApacheHttpClientTest-- testExecute_withMobile
理论上说网络类型都在config.xml中定义好的,而且在framework中也是定义的,理论上不应该出现这种问题。CTS的目的就是google不想其它厂商修改自己的API保证兼容性。
所以这显然是由于厂商自己修改了网络类型,扩展了网络类型造成的。一般这种问题还是比较难查的,我们是远程解决客户的问题所以更是难上加难,还好后来有为专业的CTS工程师到场终于解决了。当然每个项目还有可能不一样,解决的方法也有可能不一样。实际情况实际对待。
修改方案:在current.txt和public.xml固定这个ID,不随平台资源修改变化:
api/current.txt | 2 ++
core/res/res/values/public.xml | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/api/current.txt b/api/current.txt
index b079ed6..100b288 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -219,6 +219,7 @@ package android {
ctor public R.array();
field public static final int emailAddressTypes = 17235968; // 0x1070000
field public static final int imProtocols = 17235969; // 0x1070001
+ field public static final int networkAttributes = 17235979; // 0x107000b
field public static final int organizationTypes = 17235970; // 0x1070002
field public static final int phoneTypes = 17235971; // 0x1070003
field public static final int postalAddressTypes = 17235972; // 0x1070004
@@ -1236,6 +1237,7 @@ package android {
public static final class R.bool {
ctor public R.bool();
+ field public static final int config_useFixedVolume = 17891414; // 0x1110056
}
public static final class R.color {
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 62c3237..b3561f6 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2087,4 +2087,10 @@
<public type="style" name="Theme.DeviceDefault.NoActionBar.TranslucentDecor" id="0x010301e3" />
<public type="style" name="Theme.DeviceDefault.Light.NoActionBar.TranslucentDecor" id="0x010301e4" />
+ <!-- CTS tests reference these resources, but fail because we added
+ new ones, changing the order, and Google didn't declare these
+ as public resources. This fixes it for the 4.4_r1 CTS release. -->
+ <public type="bool" name="config_useFixedVolume" id="0x1110056" />
+ <public type="array" name="networkAttributes" id="0x107000b" />
+
</resources>