Android学习笔记--GMS认证(常见的cts—fail及解决方法)

GMS认证
 一、lunch桌面的google应用排序要求:
Google apps folder should contain applications in the following order from left to right; top to bottom.Google Chrome, Gmail, Google+, Google Maps, Google Play Music, Google Play Movies, Google Play Books, Google Play Newsstand, Google Play Games, Google Drive, YouTube, Google Plus Photos, Hangouts
 二、 测试命令
1)全量测试:
 run cts –plan CTS
2) fail项测试:
  l  r
  run cts –continue-session session ID

3)单测试某个case:
a.run cts -c class name -m case name
比如:run cts -c android.hardware.cts.CameraGLTest -m testCameraToSurfaceTextureMetadata
b.  run cts -t class name#case name ,
如:run cts -t android.hardware.cts.CameraGLTest#testCameraToSurfaceTextureMetadata
4)测试一个包:
a.  run cts -c class name; 比如:run cts -c android.hardware.cts.CameraGLTest
b.  run cts -p class name,

比如: start --plan CTS -p android.hardware.cts.CameraGLTest
5)fail项测试:
    add derivedplan -r fail -s 0 -p xie//导出fail项
    run cts --plan xie//测试fail项



三、 CTS_fail总结
1)android.view.accessibility.cts.AccessibilityManagerTest
-- testAddAndRemoveAccessibilityStateChangeListener    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testGetAccessibilityServiceList    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testGetEnabledAccessibilityServiceList    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testGetEnabledAccessibilityServiceListForType    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testGetInstalledAccessibilityServicesList    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testInterrupt    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testIsTouchExplorationEnabled    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testSendAccessibilityEvent    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)
-- testAndroidTestCaseSetupProperly    fail    junit.framework.AssertionFailedError: Accessibility should have been enabled by the test runner. expected:<1> but was:<0> at junit.framework.Assert.fail(Assert.java:50)

android.view.accessibility.cts.AccessibilityServiceInfoTest
-- testAccessibilityServiceInfoForEnabledService    fail    junit.framework.AssertionFailedError: There should be one speaking service. expected same:<1> was not:<0> at junit.framework.Assert.fail(Assert.java:50)
首先确认手机是否是低内存的,如果是请关闭内存优化:
修改: ProjectConfig.mk
修改记录:-CONFIG_LOWMEMORY = yes
+CONFIG_LOWMEMORY = n
o

2)testBatchScan
android.bluetooth.cts.BluetoothLeScanTest
-- testBatchScan    fail    junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48)
-- testOpportunisticScan    fail    junit.framework.AssertionFailedError: Scan results shouldn't be empty at junit.framework.Assert.fail(Assert.java:50)
-- testScanFilter    fail    junit.framework.AssertionFailedError: Scan results shouldn't be empty at junit.framework.Assert.fail(Assert.java:50)
该项测试是测试bluetooth的需要测试环境要包含三个或者三个以上的BLE设备,一般也可以安装apk来模拟BLE设备

3)test4_1MeasurePeakRms
android.media.cts.VisualizerTest
-- test4_1MeasurePeakRms    fail    junit.framework.AssertionFailedError: peak deviation in mB=2797 at junit.framework.Assert.fail(Assert.java:50)
-- test4_2MeasurePeakRmsLongMP3    fail    junit.framework.AssertionFailedError: peak deviation in mB=2813 at junit.framework.Assert.fail(Assert.java:50)
关闭besloundness再测试,这个菜单位于Settings/sound¬ification/sound enhancement ,默认是开启的。
Note:
xxxxx的DRC(BesLoudness)会在AudioEffect之前处理。该CTS测试项会在AudioEffect中取出data并计算PeakRms。由于DRC会对gain值产生影响,而CTS测试对gain值有所限制,所以BES_LOUDNESS_MUSICDRC_SB_GAIN会影响最终CTS测试的结果


4)testLiveWallpaperFeature
android.app.cts.SystemFeaturesTest
-- testLiveWallpaperFeature    fail    junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should return true for android.software.live_wallpaper at junit.framework.Assert.fail(Assert.java:50)
从问题上可以看出是需要判定需要设置 android.software.live_wallpaper为真,修改:
packages/wallpapers/LivePicker/ android.software.live_wallpaper.xml文件修改为真


5)testCameraFeatures
android.app.cts.SystemFeaturesTest
-- testCameraFeatures        fail    junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should NOT return true for android.hardware.camera.autofocus at junit.framework.Assert.fail(Assert.java:50)
        
修改路径: android.hardware.camera.xml:    

<!--feature name="android.hardware.camera.autofocus" /--
>

6)testBurstVideoSnapshot
-- testBurstVideoSnapshot    fail    com.android.ex.camera2.exceptions.TimeoutRuntimeException: Timed out after 3000 ms waiting for state(s) SESSION_CLOSED at com.android.ex.camera2.utils.StateWaiter.waitForAnyOfStates(StateWaiter.java:164)
-- testVideoSnapshot    fail    junit.framework.AssertionFailedError: Wait for a capture result timed out in 3000ms at junit.framework.Assert.fail(Assert.java:50)
一般是由于光照等原因导致的,打灯进行重新测试。
要求:
1  亮度要求:后摄:不要将平板直接放在桌子上进行测试,后摄被遮挡,一般后摄的fps因为外部光源较弱就会被降低,最好放在支架上,后摄可以对着明亮的电脑屏幕或者灯光;
  前摄: 不要在平板上前摄盖着东西,或者因为全测时间很长,在夜晚关闭灯光放在黑暗环境下去测试,这样前摄的fps也很可能被降低,摄最好也对着灯光。
  明亮环境: 可以打开camera,在main log中搜索aaa_state_camera_preview: lv, 此值一般要在60以上。
2  帧率要求:最好preview,capture都可以达到30fps, 建议preview的帧率至少在24fps以上,capture的帧率在15fps以上。
3  Driver部分:
   1 )理论fps值:此方面需要和sensor FAE或者datasheet确定设置寄存器的代码,确定sensor输出的理论fps值。
   2 ) 提高driver性能:
      减少延时: camera sensor driver减少上电延时和driver init/preview/capture/setting/feature control等的延时:
尽可能在符合camera sensor spec的基础上减少延时;
      camera sensor driver I2C speed提高:
默认的I2C speed应该是100K, 如果camera sensor可支持,可以尝试提高到400K来测试,这样camera driver中读写I2C的速度会提高到之前的4倍;
     camera driver在不影响画面显示的情况下尽可能减少delay frame:
         如下的数值尽可能减少:
         .cap_delay_frame = 3,
         .pre_delay_frame = 3,
         .video_delay_frame = 3,  
实际中,可以先都改为0来测试cts是否可以pass, 如果可以pass, 再查看camera preview/capture/video开始显示画面时是否有黑屏/绿屏/杂线的问题,如果有,可以酌情。
修改路径:
baseline/kernel-3.10/drivers/misc/xxxxx/mach/xxxx/xxxx/
baseline/vendor/xxxxx/proprietary/platform/xxxxx/hardware/xxxxxcam/core/featureio/pipe/aaa/aaa_hal.cpp
baseline/vendor/xxx/xxx/ccccccc/hal/sendepfeature
/
7) testOctane
-- testOctane    fail    Test failed to run to completion. Reason: 'Instrumentation run failed due to 'junit.framework.AssertionFailedError''. Check device logcat for details
设置默认浏览器为chrome

8) testOwnerChangedBroadcast
com.android.cts.devicepolicy.CustomDeviceOwnerTest
-- testOwnerChangedBroadcast    fail    junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48)

com.android.cts.devicepolicy.LauncherAppsSingleUserTest
-- testLauncherCallbackPackageAddedMainUser    fail    junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48)
-- testLauncherCallbackPackageChangedMainUser    fail    junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48)
-- testLauncherCallbackPackageRemovedMainUser    fail    junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48)
修改:ProjectConfig.mk(关闭低内存的内存优化)
修改记录:-CONFIG_LOWMEMORY = yes
+CONFIG_LOWMEMORY = no


9)testLiveWallpaperFeature
android.app.cts.SystemFeaturesTest
-- testLiveWallpaperFeature    fail    junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should NOT return true for android.software.live_wallpaper at junit.framework.Assert.fail(Assert.java:50)
修改:baseline/packages/wallpapers/LivePicker/android.software.live_wallpaper.xml
修改记录:-   
•    

你可能感兴趣的:(Android学习笔记)