修改framework中config.xml的networkAttributes网络资源后导致CTS testGetAllNetworkInfo失败
来源:互联网 发布:淘宝信用卡哪个好 编辑:程序博客网 时间:2024/05/01 07:09
修改framework中config.xml的networkAttributes网络资源后导致CTS testGetAllNetworkInfo失败
例如:
<!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION. Please don't copy them, copy anything else. --> <!-- This string array should be overridden by the device to present a list of network attributes. This is used by the connectivity manager to decide which networks can coexist based on the hardware --> <!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx], [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] --> <!-- the 5th element "resore-time" indicates the number of milliseconds to delay before automatically restore the default connection. Set -1 if the connection does not require auto-restore. --> <!-- the 6th element indicates boot-time dependency-met value. --> <string-array translatable="false" name="networkAttributes"> <item>"wifi,1,1,1,-1,true"</item> <item>"mobile,0,0,0,-1,true"</item> <item>"mobile_mms,2,0,2,60000,true"</item> <item>"mobile_supl,3,0,2,60000,true"</item> <item>"mobile_hipri,5,0,3,60000,true"</item> <item>"mobile_fota,10,0,2,60000,true"</item> <item>"mobile_ims,11,0,2,60000,true"</item> <item>"mobile_cbs,12,0,2,60000,true"</item> <item>"wifi_p2p,13,1,0,-1,true"</item> <item>"mobile_ia,14,0,2,-1,true"</item><item>"mobile,1000,0,0,-1,true"</item> <item>"mobile_mms,1002,0,2,60000,true"</item> <item>"mobile_supl,1003,0,2,60000,true"</item> <item>"mobile_hipri,1005,0,3,60000,true"</item> <item>"mobile_fota,1010,0,2,60000,true"</item> <item>"mobile_ims,1011,0,2,60000,true"</item> <item>"mobile_cbs,1012,0,2,60000,true"</item> <item>"wifi_p2p,1013,1,0,-1,true"</item> <item>"mobile_ia,1014,0,2,-1,true"</item>......自定义的网络类型等... </string-array>
CTS测试报错:
9-24 14:26:25 I/7731G110248210367: android.net.cts.ConnectivityManagerTest#testGetAllNetworkInfo FAILjunit.framework.AssertionFailedError: Unexpected foundCount of 0 for type 16at android.net.cts.ConnectivityManagerTest.testGetAllNetworkInfo(ConnectivityManagerTest.java:184)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1756)
修改方案:在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.txtindex 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 //视current.txt资源对比后而定 } public static final class R.color {diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xmlindex 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" /> //<span style="font-family: Arial, Helvetica, sans-serif;">视current.txt资源对比后而定</span>+ <public type="array" name="networkAttributes" id="0x107000b" />+ </resources>
0 0
- 修改framework中config.xml的networkAttributes网络资源后导致CTS testGetAllNetworkInfo失败
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- android中修改framework层代码后怎样操作才能看到修改后的效果?
- Rac 安装后修改用户名导致CRS启动失败
- Linux主机名修改后导致mysql重启失败
- Tomcat自动缓存context.xml,导致在eclipse中修改后,不能立即启作用
- framework推送失败后的处理
- spring的xml配置文件中获取jdbc.properties乱码导致连接数据库失败
- .NET Framework中CTS、CLS、CLR是什么?
- .NET Framework中CTS、CLS、CLR是什么?
- .NET Framework中CTS、CLS、CLR是什么?
- James中关于改动config.xml后,无法再启动run.bat的情况解决办法
- Spark视频第2期:Shark、SparkSQL
- [Leetcode] Add Two Numbers
- Spark视频第3期:Spark 1.0内核探索
- nyist 小博弈 大数求余
- Spark视频第4期:构建商业生产环境下的Spark集群实战
- 修改framework中config.xml的networkAttributes网络资源后导致CTS testGetAllNetworkInfo失败
- flashback之flashback query
- 平板是这么炼成的:谷歌新Nexus 7拆解
- Spark视频第5期:Spark SQL架构和案例深入实战
- 日常生活中的知识表及解题——找物品应用设想
- poj - 1953 - World Cup Noise(dp)
- scp远程拷贝文件
- 【无限互联】iOS开发之瀑布流布局实现(UICollectionView拓展Layout)
- 【BZOJ】【P1531】【POI2005】【Bank notes】【题解】【二进制优化背包】【300T留念】