summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Benjamin Löhner <bloehner@google.com> 2024-02-21 15:14:17 +0000
committer Benjamin Löhner <bloehner@google.com> 2024-02-21 23:32:56 +0000
commit93cf72f181903778f3b121294909433fa383cc4c (patch)
treedf9f0470173c944270c6ebf13229e61b5f477c0f
parentfbb780ea2af3c9970fe82600fef9fd106467efbe (diff)
Add voiceCapable condition to RoleManagerTest.
This follows EmergencyRoleBehavior.java, which indicates that voiceCapable is a condition for holding the emergency role. LOW_COVERAGE_REASON=Fixing test itself Bug: 325931354 Change-Id: Icb4b78f67123878760efef87d8ce12fd1ae6d9a5 Test: presubmit
-rw-r--r--tests/cts/role/src/android/app/role/cts/RoleManagerTest.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java b/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java
index ee898d660..4b618a1d7 100644
--- a/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java
+++ b/tests/cts/role/src/android/app/role/cts/RoleManagerTest.java
@@ -1112,7 +1112,8 @@ public class RoleManagerTest {
TelephonyManager telephonyManager = sContext.getSystemService(TelephonyManager.class);
List<String> emergencyRoleHolders = getRoleHolders(RoleManager.ROLE_EMERGENCY);
- if (callWithShellPermissionIdentity(() ->
+ if (telephonyManager.isVoiceCapable()
+ && callWithShellPermissionIdentity(() ->
telephonyManager.isEmergencyAssistanceEnabled())) {
String emergencyAssistancePackageName = callWithShellPermissionIdentity(() ->
telephonyManager.getEmergencyAssistancePackage());