android_N项目(高通平台)CTS修改总结
第一个android_N项目的CTS修改总结
1: 对于wifi only版本可能发现的问题:
android.telephony.cts.TelephonyManagerTest#testGetPhoneCount
junit.framework.AssertionFailedError: Phone count should be 0
需要在项目配置文件中修改:
replace file:vendor/qcom/proprietary/qrdplus/Extension/config/default.prop
persist.radio.multisim.config=dsds (双卡单通)
persist.radio.multisim.config=dsda (双卡双通)
persist.radio.multisim.config=tsts (三卡单通)
修改为: persist.radio.multisim.config=ssss(不支持多卡,可能为单卡或无卡)
*修改值只要不是dsds、dsda、tsts,即可。
getPhoneCount相关其它修改
1) com.android.internal.R.bool.config_voice_capable = false (是否支持语音)
2) com.android.internal.R.bool.config_sms_capable = false (是否支持短彩信)
3) wifi only prop属性:ro.radio.noril=true (wifi only 决定是否加入默认mobile network 类型)
4) 手动修改默认network类型:com.android.internal.R.array.networkAttributes
以上1到3配置影响到getPhoneCount的数量:
1) 2) 设为false,3) 设为true,即PhoneCount 为0;否则为1
2: android.cts.security.SELinuxNeverallowRulesTest#testNeverallowRules119
linux权限问题,此问题一般是修改了原生的linux默认权限导致,需要驱动配合修改。例如:The following errors were encountered when validating the SELinuxnever allow rule:
never allow { domain -init -uncrypt -update_engine -vold -recovery -ueventd } misc_block_device:blk_file { append link relabelfrom rename write open read ioctl lock };
misc_block_device 默认权限修改导致,需要将修改的此项回退或去除。
相关文件目录:
system/sepolicy/xxxx.te
device/qcom/sepolicy/common/file_contexts
device/qcom/sepolicy/common/qcomsysd.te
3: android.app.cts.SystemFeaturesTest#testCameraFeatures
PackageManager#hasSystemFeature should return true for android.hardware.camera.level.full
当开启HAL3时,需要添加这个feature项。
可以replace_files/frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml
添加:<feature name=”android.hardware.camera.level.full” />
当关闭HAL3时,需要去除这个feature项。
HAL3的开关和camera调试效果有关:persist.camera.HAL3.enabled=1
*HAL3开启时,CTS Verifier 需要测试CameraITS项,此项较难测过。一般做关闭HAL3处理修改。
4: android.opengl.cts.OpenGlEsVersionTest#testExtensionPack
System feature FEATURE_OPENGLES_EXTENSION_PACK is not available, but extension GL_ANDROID_extension_pack_es31a is in the OpenGL ES extension list.
尝试修改将frameworks/native/opengl/tools/glgen2/registry/gl.xml中,GL_ANDROID_extension_pack_es31a注释掉,修改失败。
因此,需要在OpenGL 3.1中,将FEATURE_OPENGLES_EXTENSION_PACK打开。方法如下:
replace_files/device/qcom/msm8953_32/msm8953_32.mk
PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.opengles.aep.xml:system/etc/permissions/android.hardware.opengles.aep.xml
5: android.security.cts.KernelSettingsTest#testNoConfigGz
/proc/config.gz is readable. Please recompile your kernel with CONFIG_IKCONFIG_PROC disabled
此项很简单,只要把CONFIG_IKCONFIG_PROC关掉就行了:
kernel/msm-3.18/arch/arm/arm64/configs/msmcortex_p3590_pcb-perf_defconfig
kernel/msm-3.18/arch/arm/arm64/configs/msmcortex_p3590_pcb_defconfig
# CONFIG_IKCONFIG_PROC=y
6: android.app.cts.SystemFeaturesTest#testSensorFeatures
PackageManager#hasSystemFeature(android.hardware.sensor.barometer) returns true but SensorManager#getSensorList(6) shows sensors [] expected: true but was: false
这类SensorFeatures,就是检查sensor的设备是否与feature匹配。如果有这些feature但是没有Sensor设备,将会报错。此类问题修改如下:
replace_files/device/qcom/msm8953_32/msm8953_32.mk(64位也如此)
1) 去除:PRODUCT_COPY_FILES += \ …
# frameworks/native/data/etc/android.hardware.sensor.barometer.xml : system/etc/permissions/android.hardware.sensor.barometer.xml
2) 注释掉:
replace_files/frameworks/native/data/etc/android.hardware.sensor.barometer.xml
当中feature (驱动说这个也要注释掉)
3) 如果frameworks/native/data/etc/tablet_core_hardware.xml中存在该feature,也要注释掉。例如compass
7: android.media.cts.RingtoneManagerTest: Must have at least one ring tone available
至少默认要添加一个铃声文件:
LCTPreConfig_lxf_p3590_b01.mk
添加默认铃声:
PRODUCT_PROPERTY_OVERRIDES += \
ro.config.ringtone=Fantastic_Clang.ogg
添加铃声路径:
PRODUCT_COPY_FILES += \
frameworks/base/data/sounds/ringtones/Fantastic_Clang.ogg:system/media/audio/ringtones/Fantastic_Clang.ogg
8. android.icu.dev.test.collator.CollationAPITest#TestGetLocale
Error: (CollationAPITest.java:1023) [Coll sr_RS]: Error in valid locale, expected sr_Cyrl_RS, got sr_Latn_RS
Error: (CollationAPITest.java:1028) [Coll sr_RS]: Error in actual locale, expected sr, got sr_Latn
默认塞尔维亚语的字库不是预期sr_Cyrl_RS.
这类原因一般都是后期修改了字库导致。相关目录:
external/icu/icu4c/source/stubdata/icudt56l.dat
external/icu/icu4c/source/data/xxx/sr_RS.txt
需要回退的xxx目录的该文件有:lang、locales、region这三个目录的txt文件和icudt56l.dat
9. android.permission.cts.DebuggableTest:
Packages marked debuggable: [com.goodix.rawdata, com.goodix.fingerprinttest]
AndroidManifest.xml中的 android:debuggable要置为false, 或者去掉那些android.debuggable置为true的apk.
10. android.media.cts.VideoDecoderPerfTest
testHevcOtherperf1920x1080、testHevcOtherperf3840x2160
Expected achievable frame rates for OMX.qcom.video.decoder.hevc video/hevc 1920x1080: [50.0, 60.0].
Measured frame rate: [179.64555326793428, 178.97307661756975].
修改相关配置文件,将帧率的范围扩大,例如:
device/qcom/msm8953_32/media/media_codecs_performace_8953.xml
<MediaCodec name=”OMX.qcom.video.decoder.hevc” type=”video/hevc” update=”true”>
<Limit name=”measured-frame-rate-1920x1088” range=”50-300”><!--最大值超过180-->
<!-- <Limit name=”measured-frame-rate-1920x1088” range=”50-60”> -->
</MediaCodec>
11. android.backup.cts.BackupQuotaTest
LocalTransport should be available.
1) 需要添加LocalTransport功能。
customer_lxf_p3590_b01.cfg:
packages= …
LocalBackupTransport
2) 添加白名单:zprojects/longcheer-binary/system/etc/sysconfig/backup.xml
<?xml version=”1.0” encoding=”utf-8”>
<config>
<backup-transport-whitelisted-service
service=”android/com.android.internal.backup.LocalTransportService” />
</config>
3) 添加package:zprojects/longcheer-binary/packages.xml
<package name=”LocalBackupTransport”>
<file dst=”system/etc/sysconfig/backup.xml” src=”system/etc/sysconfig/backup.xml”/>
</package>
最后关于一些CTS异常测试项:
1、相关KeyEvent
android.app.cts.DialogTest#testOnKeyDownKeyUp
android.app.cts.InstrumentationTest#testSendKeySync
android.view.cts.ContentPaneFocusTest#testAccessActionBar
android.webkit.cts.WebViewTest#testGetHitTestResult
android.widget.cts.DialerFilterTest#testOnKeyUpDown
测试异常由于输入法没有响应,需要对第三方预置默认输入法手动授权或者禁用并使用Android 键盘输入法。
2、CtsLibcoreTestCases:
libcore.java.text.SimpleDateFormatTest#testNonDstZoneWithDstTimestampForNonHourDstZone
java.text.ParseException: Unparseable date: "2011-06-21T20:00 Lord Howe Daylight Time"
需要联网后,重新进入时区列表,选择Pacific Daylight Time,重启机器再测试。
3、部分蓝牙扫描超时,可以点击设置->蓝牙进入列表界面,即可pass
4、部分wifi无法连接超时,可以点击设置->wifi进入列表,即可pass
5、部分测试项需要断网并关闭蓝牙才可以pass:
android.appsecurity.cts.DirectBootHostTest#testDirectBootEmulated
android.media.cts.VideoDecoderPerfTest#testAvcGoog0Perf0320x0240(帧率达不到)
android.media.cts.VideoDecoderPerfTest#testAvcGoog0Perf0720x0480(帧率达不到)
6、android.appsecurity.cts.AdoptableHostTest#testPrimaryStorage
测试需要插入SD卡并设置为内部存储。测试过程10分钟,测试完成会读不到SD卡,所以需要重启后,其它需要SD卡的测试项才能测试过(armeabi-v7a 和 arm64-v8a,连续测试这一项,会有1项不过)