From 61dc939969bce0a6246deb7109dc5dc64cd84942 Mon Sep 17 00:00:00 2001 From: erfanian Date: Fri, 15 Jun 2018 14:10:34 -0700 Subject: Check phone capabilities. Bug: 110177989 Test: none/manual PiperOrigin-RevId: 200771224 Change-Id: I6c9d9b6eb0aa98be8e60d693549c07fbbf73c5d7 --- java/com/android/incallui/call/DialerCall.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'java/com') diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 585421eab..dd6c25b5b 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1714,6 +1714,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa /** Indicates the call is eligible for SpeakEasy */ public boolean isSpeakEasyEligible() { + + PhoneAccount phoneAccount = getPhoneAccount(); + + if (phoneAccount == null) { + return false; + } + + if (!phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { + return false; + } + return !isPotentialEmergencyCallback() && !isEmergencyCall() && !isActiveRttCall() -- cgit v1.2.3