summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/telecom
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2017-12-19 19:43:53 -0800
committerEric Erfanian <erfanian@google.com>2017-12-22 08:53:22 -0800
commit48609d015f06e262796b7ce8a088243199940a8a (patch)
treed1e3c5ce9057de09132a985bf2d42ea3bb9e6089 /java/com/android/dialer/telecom
parent043d6715d7b7f5ccc81c416ef80c1fc04ec1445a (diff)
Bubble v2 changes.
- Only show bubble for outgoing, active and background call. (Before: show bubble when is in call) - Show "Call ended" and hide bubble only when there is no outgoing, active or background call. (Before: show "Call ended" for all real call disconnection like one call in conference) - Don't show "Call ended" but only hide bubble when Duo upgrade is accepted/declined. We show bubble for Duo upgrade since the call is still connected. The solution doesn't work for fallback upgrade on pre-ODR device (so "Call ended" still shows). Bug: 67605985 Test: NewReturnToCallControllerTest PiperOrigin-RevId: 179636643 Change-Id: I5d1f6e812c94108228757af89e33d4c496beb735
Diffstat (limited to 'java/com/android/dialer/telecom')
-rw-r--r--java/com/android/dialer/telecom/TelecomUtil.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/java/com/android/dialer/telecom/TelecomUtil.java b/java/com/android/dialer/telecom/TelecomUtil.java
index 22f3727e6..c64a50231 100644
--- a/java/com/android/dialer/telecom/TelecomUtil.java
+++ b/java/com/android/dialer/telecom/TelecomUtil.java
@@ -178,6 +178,10 @@ public abstract class TelecomUtil {
* are not included.
*/
public static boolean isInManagedCall(Context context) {
+ return instance.isInManagedCall(context);
+ }
+
+ public static boolean isInCall(Context context) {
return instance.isInCall(context);
}
@@ -289,7 +293,7 @@ public abstract class TelecomUtil {
@VisibleForTesting()
public static class TelecomUtilImpl {
- public boolean isInCall(Context context) {
+ public boolean isInManagedCall(Context context) {
if (hasReadPhoneStatePermission(context)) {
// The TelecomManager#isInCall method returns true anytime the user is in a call.
// Starting in O, the APIs include support for self-managed ConnectionServices so that other
@@ -308,6 +312,10 @@ public abstract class TelecomUtil {
return false;
}
+ public boolean isInCall(Context context) {
+ return hasReadPhoneStatePermission(context) && getTelecomManager(context).isInCall();
+ }
+
public boolean hasPermission(Context context, String permission) {
return ContextCompat.checkSelfPermission(context, permission)
== PackageManager.PERMISSION_GRANTED;