seedvault-app/seedvault

GTS: contactsbackup: test failure caused by pre-granting contacts permissions

Open

#455 opened on Oct 6, 2022

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Kotlin (97 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (1,782 stars)
PR merge metrics
 (PR metrics pending)

Description

GTS tests verify pre-granted and default permissions.

It does not like contactsbackup to obtain the following permissions by default:

  • android.permission.READ_CONTACTS
  • android.permission.WRITE_CONTACTS

To pass GTS these permissions would need to be converted into runtime permissions.


Test

  • run gts-dev -m GtsPermissionTestCases --test com.google.android.permission.gts.DefaultPermissionGrantPolicyTest#testDefaultGrantsWithRemoteExceptions
  • run gts-dev -m GtsPermissionTestCases --test com.google.android.permission.gts.DefaultPermissionGrantPolicyTest#testPreGrantsWithRemoteExceptions
10-06 10:17:48.638 11845 11864 E TestRunner: failed: testDefaultGrantsWithRemoteExceptions(com.google.android.permission.gts.DefaultPermissionGrantPolicyTest)
10-06 10:17:48.638 11845 11864 E TestRunner: ----- begin exception -----
10-06 10:17:48.639 11845 11864 E TestRunner: java.lang.AssertionError: packageName: org.calyxos.backup.contacts {
10-06 10:17:48.639 11845 11864 E TestRunner:   priv app: false
10-06 10:17:48.639 11845 11864 E TestRunner:   targetSDK: 32
10-06 10:17:48.639 11845 11864 E TestRunner:   uid: 10113
10-06 10:17:48.639 11845 11864 E TestRunner:   persistent: false
10-06 10:17:48.639 11845 11864 E TestRunner:   signature: 4A765E535EFC55FF7C01964F6304BAE0FA5EE111F6E7A34DB3E071AAFE5D53C6
10-06 10:17:48.639 11845 11864 E TestRunner:   on system image: true
10-06 10:17:48.639 11845 11864 E TestRunner:   has platform signature: false
10-06 10:17:48.639 11845 11864 E TestRunner:   message: cannot be granted by default to package {
10-06 10:17:48.639 11845 11864 E TestRunner:     permission: android.permission.WRITE_CONTACTS
10-06 10:17:48.639 11845 11864 E TestRunner:     permission: android.permission.READ_CONTACTS
10-06 10:17:48.639 11845 11864 E TestRunner:   }
10-06 10:17:48.639 11845 11864 E TestRunner: }

Contributor guide