From d05d899b641349f5da46a7ab5964591a03b72d95 Mon Sep 17 00:00:00 2001 From: erfanian Date: Tue, 20 Mar 2018 19:42:26 -0700 Subject: Add more boilerplate to the incallui. Bug: 73774242 Test: unit tests where they exist PiperOrigin-RevId: 189853302 Change-Id: Ibf3431cc0d7716c2c53c7ea165dfc130102a1bc7 --- java/com/android/incallui/call/DialerCall.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'java/com/android/incallui/call/DialerCall.java') diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 5d2b1471d..2ce4550bb 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -136,6 +136,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa new CopyOnWriteArrayList<>(); private final VideoTechManager videoTechManager; + private boolean isSpeakEasyCall; private boolean isEmergencyCall; private Uri handle; private int state = State.INVALID; @@ -1544,6 +1545,25 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa this.preferredAccountRecorder = preferredAccountRecorder; } + /** Indicates the call is eligible for SpeakEasy */ + public boolean isSpeakEasyEligible() { + // TODO(erfanian): refactor key location + return ConfigProviderBindings.get(context).getBoolean("speak_easy_enabled", false); + } + + /** Indicates the user has selected SpeakEasy */ + public boolean isSpeakEasyCall() { + if (!isSpeakEasyEligible()) { + return false; + } + return isSpeakEasyCall; + } + + /** Sets the user preference for SpeakEasy */ + public void setIsSpeakEasyCall(boolean isSpeakEasyCall) { + this.isSpeakEasyCall = isSpeakEasyCall; + } + /** * Specifies whether a number is in the call history or not. {@link #CALL_HISTORY_STATUS_UNKNOWN} * means there is no result. -- cgit v1.2.3