1、GtsGmscoreHostTestCases com.google.android.gts.devicepolicy.ManagedProfileTest#testPendingSystemUpdate fial
分析:首先,这个失败项是我们自己添加功能导致的,原始版本是好的。
失败的log:
TestRunner: failed: testNotifyPendingSystemUpdate(com.google.android.gts.managedprofile.NotifyPendingSystemUpdateTest)
TestRunner: ----- begin exception -----
TestRunner: junit.framework.AssertionFailedError: Profile owner didn't indicate receipt of update notification
TestRunner: at junit.framework.Assert.fail(Assert.java:50)
TestRunner: at junit.framework.Assert.assertTrue(Assert.java:20)
TestRunner: at com.google.android.gts.managedprofile.NotifyPendingSystemUpdateTest.testNotifyPendingSystemUpdate(NotifyPendingSystemUpdateTest.java:115)
TestRunner: at java.lang.reflect.Method.invoke(Native Method)
比较关键的log是 Profile owner didn't indicate receipt of update notification
继续分析log,发现下面的log:
Logger: AutoStartupDataMgr:isUnderControll third party not in whitelist: com.google.android.gts.managedprofile
Logger: AutoStartupDataMgr:retrieveStartupSettings type 0 of com.google.android.gts.managedprofile is 0
Logger: AppAutoStartupPolicy:sendStartupRecordMsg, pkg=com.google.android.gts.managedprofile,caller=r,resultfalse,pid=-1,uid=-1
Logger: AppAutoStartupPolicy:prevent start receiver of package com.google.android.gts.managedprofile for action android.app.action.NOTIFY_PENDING_SYSTEM_UPDATE
可以看到 prevent start receiver of package com.google.android.gts.managedprofile,是因为限制了receiver的启动,导致的失败;将限制去掉之后就可以通过测试。
2、GtsPackageManagerHostTestCases com.google.android.pm.gts.PackageManagerHostTest#testSettingsReadable fail
解决方法:
修改/frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG_BROADCAST,
(sticky ? "Broadcast sticky: ": "Broadcast: ") + intent
+ " ordered=" + ordered + " userid=" + userId);
//*/add code
if (intent.getAction() != null &&
intent.getAction().equals("android.app.action.DEVICE_ADMIN_DISABLED") ) {
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
}
//*/
3、GtsBackupHostTestCases com.google.android.gts.backup.SettingsProviderBackupHostTest#testSoftApE2EBR fail
分析:
- 请确认在设置中打开backup后进行测试。
- 此为google o版本原生行为,对比机nexus 6p也是如此。
4、GtsGmscoreHostTestCases
com.google.android.gts.security.AttestationRootHostTest#testEcAttestationChain
com.google.android.gts.security.AttestationRootHostTest#testRsaAttestationChain
- 分析: google key没有正确写入
5、GtsSearchHostTestCases com.google.android.search.gts.GoogleSearchWidgetTest#testWidgetPresence fail
- 分析:桌面需包含google search widget
6、GtsPackageManagerHostTestCases com.google.android.pm.gts.PackageManagerHostTest#testStartForegroundService fail
- 分析:可申请豁免, bug id:70933248