Fail的一些修改
1、直接设置问题
estUnknownSourcesOffByDe | fail | junit.framework.AssertionFailedError: Deviceshould not ship with 'Unknown Sources' enabled by default.expected:<0> butwas:<1> atandroid.provider.cts.Settings_SecureTest.testUnknownSourcesOffByD |
这种fail最好解决,直接按照字面理解就OK,设置---安全---默认关闭:未知来源。
2、permission
-- testSensorFeatures | fail | junit.framework.AssertionFailedError:PackageManager#hasSystemFeature(android.hardware.sensor.accelerometer)returns true but SensorManager#getSensorList(1) shows sensors []expected:<true> butwas:<false> atandroid.app.cts.SystemFeaturesTest.assertFeatureForSensor(SystemFeaturesTest.java:300) |
一般情况修改 - >
android.hardware.camera.xml,platform.xml等文件,这边的文件定义了设备具有的一些权限。
--------------------------------------------------------------------------------------------------------------------
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature(android.hardware.sensor.light) returns true but SensorManager#getSensorList(5) shows sensors [] expected:<true> but was:<false>
原因:手机无光感
解决方法:去除..\mediatek\config\{PROJECT}\android.hardware.sensor.light.xml及
android.hardware.sensor.proximity.xml文件中相应选项
3、由测试而引起的非测试项出错
-- testRecordingHint | fail | java.lang.RuntimeException: start failed. atandroid.media.MediaRecorder.start(Native Method) |
这种情况要根据Logcat去查看RuntimeException的具体错误。通常可以先不改,因为很难查错。
4、网络问题
-- test_isReachable | fail | java.net.UnknownHostException: Unable to resolvehost "www.google.com": No address associated with hostname atjava.net.InetAddress.lookupHostByName(InetAddress.java:426) |
这类问题是由于国内的网络无法访问国外网站导致的,最好的办法就在公司搭建一个VPN,链接出去。
5、系统文件权限
-- testAllFilesInSysAreNotW | fail | junit.framework.AssertionFailedError: Foundwritable: [/sys/devices/platform/malata_ts.0/tsclass/tsclass0/ts_power,/sys/devices/platform/malata_ts.0/tsclass/tsclass0/ts_en_file,/sys/devices/platform/malata_ts.0/tsclass/tsclass0/ts_Calibrate] atandroid.permission.cts.FileSystemPermissionTest testAllFilesInSysAreNotW |
-- testNoSetuidTcpdump | fail | junit.framework.AssertionFailedError at android.security.cts.BannedFilesTest. assertNotSetugid(BannedFilesTest.java:59) |
这些问题是系统文件权限的问题,解决方法比较土,就是全局搜索该文件,查看那些对该文件操作的脚本,然后修改即可。
上面两个fail的解决方法是:
a.
__ATTR(ts_power, 0777, NULL,ts_set_point),
__ATTR(ts_en_file, 0777, NULL,ts_set_point),
__ATTR(ts_ Calibrate, 0777,NULL, ts_set_point),
b.
{ 06755, ADD_ROOT, ADD_ROOT,“system/xbin/tcpdump”}
-------------------------------------------------------------------------------------------------
android.app.cts.SystemFeaturesTest | ||
-- testLocationFeatures |
fail
|
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should NOT return true for android.hardware.location.networkat android.app.cts.SystemFeaturesTest.assertNotAvailable(SystemFeaturesTest.java:375)
|
原因:未配置相对应功能(开启Location access中所有开关(gps和wifi))
解决方法:将..\frameworks\base\data\etc\android.hardware.location.gps.xml拷贝 到
..\mediatek\config\{PROJECT}\android.hardware.location.gps.xml目录下并做修改
<permissions>
<feature name="android.hardware.location" /> ----打开
<feature name="android.hardware.location.network" /> ----打开
<feature name="android.hardware.location.gps" /> ---无GPS则关此项
</permissions>
6、这种情况最多的。
-- testFocusDistances | fail | junit.framework.ComparisonFailure:expected:<infinity> butwas:<auto> at android.hardware.cts.CameraTest.testFocusDistancesByCame (CameraTest.java:1386) |
对于这个fail的原因是CTS对摄像头测试时,对摄像头进行参数设置,然后在读取参数后,参数出错。
这种情况要找到CameraTest源码,通常在source/cts/...下面,我们编译时没有编译到这里,仅查看代码,例如找到CameraTest.java,打开后找到1386行,行数一般情况下不会有出入,除非source下面的cts版本和下载的cts版本不一致才会找不到,找到testFocusDistancesByCame
其中camera CTS测试代码在:
source/cts/tests/tests/hardware/src/android/hardware/cts/CameraTest.java
摄像头设置的相关代码在:Source/device/Samsung/exynos4/libcamera/下面,有SecCameraHWInterface_zoom.cpp、SecCameraHWInterface_zoom.h、SecCamera_zoom.cpp、SecCamera_zoom.h
找到之后通过修改后测试再修改后再测试直到CTS PASS。
(对于摄像头,应注意是几个摄像头,不然测试可能会对两个一起测试,这样就算一个摄像头调好了,能PASS了,另外一个过不了也是FAIL的。)
---------------------------------------------------------------------------
android.app.cts.SystemFeaturesTest#testCameraFeatures FAIL
junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should NOT return true for android.hardware.camera.autofocus
原因:手机无自动对焦功能
解决方法:去除..\mediatek\config\{PROJECT}\android.hardware.camera.xml文件中
<feature name="android.hardware.camera.autofocus" />
ro.sf.lcd_density=160可以通过测试,但是Blaze Launcher菜单显示不能全屏,考虑修改api
12.Libcore cts部分
13、DisplayRefreshRateTest
android.view.cts.DisplayRefreshRateTest | ||
-- testRefreshRate |
fail
| junit.framework.AssertionFailedError at android.view.cts.DisplayRefreshRateTest.testRefreshRate(DisplayRefreshRateTest.java:168) |
- mRefreshRate = fbDev->fps-5;
- mRefreshRate = fbDev->fps-5;
- mRefreshRate = fbDev->fps-4;
- mRefreshRate = fbDev->fps-4;
Compatibility Test Package: android.permission | ||
Test | Result | Details |
android.permission.cts.FileSystemPermissionTest | ||
-- testAllFilesInSysAreNotWritable | fail | junit.framework.AssertionFailedError: Found writable: [/sys/devices/virtual/input/input3/enable_ps, /sys/devices/pci0000:00/0000:00:03.4/i2c-5/5-0068/delay, /sys/devices/virtual/input/input3/delay_ps, /sys/devices/virtual/input/input3/enable_als, /sys/devices/virtual/input/input3/delay_als, /sys/devices/pci0000:00/0000:00:03.4/i2c-5/5-0068/enable, /sys/devices/virtual/input/input3/enable_gs] at android.permission.cts.FileSystemPermissionTest.testAllFilesInSysAreNotWritable(FileSystemPermissionTest.java:577) |
将相应的delay_ps这些文件进行设置权限,rw-r-r
15、
Compatibility Test Package: android.view | ||
Test | Result | Details |
android.view.cts.DisplayRefreshRateTest | ||
-- testRefreshRate | fail | junit.framework.AssertionFailedError at android.view.cts.DisplayRefreshRateTest.testRefreshRate(DisplayRefreshRateTest.java:198) |
16、
android.media.cts.StreamingMediaPlayerTest | ||
-- testHLS | fail | junit.framework.AssertionFailedError: Stream did not play successfully after all attempts at android.media.cts.MediaPlayerTestBase.playVideoWithRetries(MediaPlayerTestBase.java:196) |
-- testHTTP_H264Base_AAC_Video1 | fail | Test failed to run to completion. Reason: 'Instrumentation run failed due to 'junit.framework.AssertionFailedError''. Check device logcat for details |
-- testHTTP_H264Base_AAC_Video2 | fail | Test failed to run to completion. Reason: 'Instrumentation run failed due to 'junit.framework.AssertionFailedError''. Check device logcat for details |
公司的带宽比较大,但实际真正的带宽可能会小好多,导致去播放高清视频是会很卡,然后失败
解决方法:
参考8x25平台做法,在 system.prop 里面对带宽做限制:
media.httplive.max-bw = 360000
最大带宽限制在360000,这样,测试HLS的时候,就只会去播放200000的普通视频,基本可以通过。
=================================android5.0+GMS-r3============================
17、android.hardware.camera2.cts.CaptureRequestTest-testAwbModeAndLock
修改vendor/intel/hardware/camera3hal/ipu2/3a/Aiq3A.cpp
- int us_min = 1000000 / minFps;
- int us_max = 1000000 / maxFps;
+ int us_min = 1000000 / maxFps;
+ int us_max = 1000000 / minFps;
修改vendor/intel/hardware/camera3hal/ipu2/CaptureStream.cpp
+#if 0
status = mCaptureDevice->setBufferPool(mV4l2CaptureBuffers, false);
status |= mPostviewDevice->setBufferPool(mV4l2PostviewBuffers, false);
+#else
+ status = mCaptureDevice->setBufferPool(mV4l2CaptureBuffers, true);
+ status |= mPostviewDevice->setBufferPool(mV4l2PostviewBuffers, true);
+#endif
18、GTS:com.google.android.xts.afw.AfwRequiredAppsOverlaysTest
添加AndroidForWork应用
19、GTS:testPermitAccessibilityServices
添加talkback应用