summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Chen <christinech@google.com>2013-09-18 20:36:38 -0700
committerChristine Chen <christinech@google.com>2013-09-18 20:37:42 -0700
commit6258ff60a7edc760facc3f387fc9c8ceee3fb518 (patch)
tree9a33e989ce607dfb49040c38dab22ff09843782a
parent82d64da6612291b8a73db8e452c0b3a1c26abf92 (diff)
Adds DISCONNECTING state support.
When user ends a call locally, we first set the call state to DISCONNECTING and show "Hanging up" as the status. We then show the "Call ended" status when the telephony layer comes back with the DISCONNECTED state for the call. Bug: 10808537 Change-Id: Iad5eda6ee34e2f04a861977ac1a2453a52081d27
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java25
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java4
-rw-r--r--InCallUI/src/com/android/incallui/CallList.java6
-rw-r--r--InCallUI/src/com/android/incallui/ContactInfoCache.java6
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java3
5 files changed, 22 insertions, 22 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 49ee786cd..dd3e8aea4 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -231,15 +231,15 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
// States other than disconnected not yet supported
callStateLabel = getCallStateLabelFromState(state, cause);
- Log.v(this, "setCallState ", callStateLabel);
- Log.v(this, "DisconnectCause ", cause);
- Log.v(this, "bluetooth on ", bluetoothOn);
+ Log.v(this, "setCallState " + callStateLabel);
+ Log.v(this, "DisconnectCause " + cause);
+ Log.v(this, "bluetooth on " + bluetoothOn);
Log.v(this, "gateway " + gatewayLabel + gatewayNumber);
// There are cases where we totally skip the animation, in which case remove the transition
// animation here and restore it afterwards.
final boolean skipAnimation = (state == Call.State.DIALING
- || state == Call.State.DISCONNECTED);
+ || state == Call.State.DISCONNECTED || state == Call.State.DISCONNECTING);
LayoutTransition transition = null;
if (skipAnimation) {
transition = mSupplementaryInfoContainer.getLayoutTransition();
@@ -371,15 +371,14 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
} else if (Call.State.INCOMING == state || Call.State.CALL_WAITING == state) {
callStateLabel = context.getString(R.string.card_title_incoming_call);
- // TODO(klp): Add a disconnecting state
- //} else if (Call.State.DISCONNECTING) {
- // While in the DISCONNECTING state we display a "Hanging up"
- // message in order to make the UI feel more responsive. (In
- // GSM it's normal to see a delay of a couple of seconds while
- // negotiating the disconnect with the network, so the "Hanging
- // up" state at least lets the user know that we're doing
- // something. This state is currently not used with CDMA.)
- //callStateLabel = context.getString(R.string.card_title_hanging_up);
+ } else if (Call.State.DISCONNECTING == state) {
+ // While in the DISCONNECTING state we display a "Hanging up"
+ // message in order to make the UI feel more responsive. (In
+ // GSM it's normal to see a delay of a couple of seconds while
+ // negotiating the disconnect with the network, so the "Hanging
+ // up" state at least lets the user know that we're doing
+ // something. This state is currently not used with CDMA.)
+ callStateLabel = context.getString(R.string.card_title_hanging_up);
} else if (Call.State.DISCONNECTED == state) {
callStateLabel = getCallFailedString(cause);
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 1830f054c..af7ee1bfc 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -318,6 +318,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
// to let user know quickly what call has disconnected. Disconnected
// calls are very short lived.
if (!skipDisconnected) {
+ retval = callList.getDisconnectingCall();
+ if (retval != null && retval != ignore) {
+ return retval;
+ }
retval = callList.getDisconnectedCall();
if (retval != null && retval != ignore) {
return retval;
diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java
index 8249fd481..21f86f74c 100644
--- a/InCallUI/src/com/android/incallui/CallList.java
+++ b/InCallUI/src/com/android/incallui/CallList.java
@@ -202,6 +202,10 @@ public class CallList {
return getFirstCallWithState(Call.State.DISCONNECTED);
}
+ public Call getDisconnectingCall() {
+ return getFirstCallWithState(Call.State.DISCONNECTING);
+ }
+
public Call getSecondBackgroundCall() {
return getCallWithState(Call.State.ONHOLD, 1);
}
@@ -223,7 +227,6 @@ public class CallList {
return call;
}
-
public Call getFirstCall() {
// TODO: should we switch to a simple list and pull the first one?
Call result = getIncomingCall();
@@ -316,7 +319,6 @@ public class CallList {
final Integer id = new Integer(call.getCallId());
if (call.getState() == Call.State.DISCONNECTED) {
-
// update existing (but do not add!!) disconnected calls
if (mCallMap.containsKey(id)) {
diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java
index 6c05650b9..13f8dd00d 100644
--- a/InCallUI/src/com/android/incallui/ContactInfoCache.java
+++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java
@@ -330,12 +330,6 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete
photo = context.getResources().getDrawable(R.drawable.picture_unknown);
} else {
cce.personUri = personUri;
-
- // If the image load is too slow, we show a default avatar icon afterward.
- // If it is fast enough, this message will be canceled on onImageLoadComplete().
- // TODO (klp): Figure out if this handler is still needed.
- // mHandler.removeMessages(MESSAGE_SHOW_UNKNOWN_PHOTO);
- // mHandler.sendEmptyMessageDelayed(MESSAGE_SHOW_UNKNOWN_PHOTO, MESSAGE_DELAY);
}
}
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 8c52aab2c..935399a62 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -223,7 +223,8 @@ public class InCallPresenter implements CallList.Listener {
newState = InCallState.OUTGOING;
} else if (callList.getActiveCall() != null ||
callList.getBackgroundCall() != null ||
- callList.getDisconnectedCall() != null) {
+ callList.getDisconnectedCall() != null ||
+ callList.getDisconnectingCall() != null) {
newState = InCallState.INCALL;
}