host_log:
05-09 10:39:07 I/ConsoleReporter: [1/1 arm64-v8a CtsShortcutHostTestCases b9cacecd] android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest#testBackupAndRestore fail: junit.framework.AssertionFailedError: expected to contain regex:but was:at junit.framework.Assert.fail(Assert.java:50)
at android.content.pm.cts.shortcuthost.BaseShortcutManagerHostTest.failWithMessage(BaseShortcutManagerHostTest.java:269)
at android.content.pm.cts.shortcuthost.BaseShortcutManagerHostTest.failNotContains(BaseShortcutManagerHostTest.java:277)
at android.content.pm.cts.shortcuthost.BaseShortcutManagerHostTest.assertContainsRegex(BaseShortcutManagerHostTest.java:238)
at android.content.pm.cts.shortcuthost.BaseShortcutManagerHostTest.assertContainsRegex(BaseShortcutManagerHostTest.java:221)
at android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest.doBackup(ShortcutManagerBackupTest.java:94)
at android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest.testBackupAndRestore(ShortcutManagerBackupTest.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.android.tradefed.testtype.DeviceTestResult$1.protect(DeviceTestResult.java:81)
at com.android.tradefed.testtype.DeviceTestResult.runProtected(DeviceTestResult.java:56)
at com.android.tradefed.testtype.DeviceTestResult.run(DeviceTestResult.java:85)
at junit.framework.TestCase.run(TestCase.java:124)
at com.android.tradefed.testtype.DeviceTestCase.run(DeviceTestCase.java:180)
at com.android.tradefed.testtype.JUnitRunUtil.runTest(JUnitRunUtil.java:55)
at com.android.tradefed.testtype.JUnitRunUtil.runTest(JUnitRunUtil.java:38)
at com.android.tradefed.testtype.DeviceTestCase.run(DeviceTestCase.java:144)
at com.android.tradefed.testtype.HostTest.run(HostTest.java:253)
at com.android.compatibility.common.tradefed.testtype.ModuleDef.run(ModuleDef.java:247)
at com.android.compatibility.common.tradefed.testtype.CompatibilityTest.run(CompatibilityTest.java:439)
at com.android.tradefed.invoker.TestInvocation.runTests(TestInvocation.java:716)
at com.android.tradefed.invoker.TestInvocation.prepareAndRun(TestInvocation.java:491)
at com.android.tradefed.invoker.TestInvocation.performInvocation(TestInvocation.java:386)
at com.android.tradefed.invoker.TestInvocation.invoke(TestInvocation.java:166)
at com.android.tradefed.command.CommandScheduler$InvocationThread.run(CommandScheduler.java:471)
05-09 10:39:07 I/FailureListener: FailureListener.testFailed android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest#testBackupAndRestore false false false
05-09 10:39:07 D/ModuleListener: ModuleListener.testEnded(android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest#testBackupAndRestore, {})
05-09 10:39:07 D/ModuleListener: ModuleListener.testRunEnded(61316, {})
05-09 10:39:07 I/ConsoleReporter: [b9cacecd] arm64-v8a CtsShortcutHostTestCases completed in 1m 1s. 0 passed, 1 failed, 0 not executed
device_logcat:
01-08 01:52:14.334 2416 2713 W BackupManagerService: Proposed transport ComponentInfo{android/com.android.internal.backup.LocalTransportService} not whitelisted; ignoring
此问题发生原因为system/etc/platform.xml文件中没有添加相应的白名单,在platform.xml中添加如下即可:
<backup-transport-whitelisted-service service="android/com.android.internal.backup.LocalTransportService"/>