Android8.1 (O1)GTS 失败项

本文针对GTS测试中出现的问题进行了详细的分析与解决方案探讨,包括系统更新通知、权限管理、备份设置、密钥管理和搜索小部件等场景。通过分析日志、修改源代码等手段,解决了多个测试案例中的失败情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


链接:https://www.jianshu.com/p/545ff154d538
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值