From e20930fc565bbe69f1cb300ac4258a5130dd1282 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Thu, 7 Aug 2014 16:17:21 -0700 Subject: [PATCH] Add "CONNECTING" state for before outgoing call broadcast returns Immediately add a call to Telecomm before the outgoing call broadcast intent returns, this will reduce the latency for the InCallUI by allowing the InCallActivity to start before Telecomm has responded. Bug: 16396523 Change-Id: Iada2a6bdb803794a765b81edb2dfb0953445ae43 --- api/current.txt | 2 ++ telecomm/java/android/telecomm/Call.java | 7 +++++++ telecomm/java/android/telecomm/CallState.java | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/api/current.txt b/api/current.txt index 5710415693ee1..a7a04f238ee3b 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28599,6 +28599,7 @@ package android.telecomm { method public void swapWithBackgroundCall(); method public void unhold(); field public static final int STATE_ACTIVE = 4; // 0x4 + field public static final int STATE_CONNECTING = 9; // 0x9 field public static final int STATE_DIALING = 1; // 0x1 field public static final int STATE_DISCONNECTED = 7; // 0x7 field public static final int STATE_HOLDING = 3; // 0x3 @@ -28691,6 +28692,7 @@ package android.telecomm { method public static android.telecomm.CallState valueOf(java.lang.String); method public static final android.telecomm.CallState[] values(); enum_constant public static final android.telecomm.CallState ACTIVE; + enum_constant public static final android.telecomm.CallState CONNECTING; enum_constant public static final android.telecomm.CallState DIALING; enum_constant public static final android.telecomm.CallState DISCONNECTED; enum_constant public static final android.telecomm.CallState NEW; diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index 3374d514b95f7..55cb8b15c3083 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -69,6 +69,11 @@ public final class Call { */ public static final int STATE_PRE_DIAL_WAIT = 8; + /** + * The state of an outgoing {@code Call}, before Telecomm broadcast intent has returned. + */ + public static final int STATE_CONNECTING = 9; + public static class Details { private final Uri mHandle; private final int mHandlePresentation; @@ -771,6 +776,8 @@ public final class Call { switch (parcelableCallState) { case NEW: return STATE_NEW; + case CONNECTING: + return STATE_CONNECTING; case PRE_DIAL_WAIT: return STATE_PRE_DIAL_WAIT; case DIALING: diff --git a/telecomm/java/android/telecomm/CallState.java b/telecomm/java/android/telecomm/CallState.java index 9cb05db53a8ae..cfa78d4903e9e 100644 --- a/telecomm/java/android/telecomm/CallState.java +++ b/telecomm/java/android/telecomm/CallState.java @@ -31,6 +31,12 @@ public enum CallState { */ NEW, + /** + * Indicates an outgoing call has been initiated and is waiting for the broadcast intent to + * return and provide call details before proceeding. + */ + CONNECTING, + /** * Indicates that the call is about to go into the outgoing and dialing state but is waiting for * user input before it proceeds. For example, where no default {@link PhoneAccount} is set,