summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-08-20 16:49:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-19 02:43:23 +0000
commita72a9116ae170239c5cc34dc1f46a4a165c1974b (patch)
tree0e33b181bab925c99fa13ded6f908c88f8ff9f26 /InCallUI
parentc44f654b992c6ab8a4acff9cb5aa2678c58755d9 (diff)
parent537431d81624ea24d71df8e42251e795dcdc0d3c (diff)
Merge "Ensure the InCallUI does not reanimate when it already is shown." into lmp-dev
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java4
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java2
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java22
3 files changed, 20 insertions, 8 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 8ca1dd67c..1319246b0 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -369,7 +369,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
@Override
public void setPrimaryName(String name, boolean nameIsNumber) {
if (TextUtils.isEmpty(name)) {
- mPrimaryName.setText("");
+ mPrimaryName.setText(null);
} else {
mPrimaryName.setText(name);
@@ -393,7 +393,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
public void setPrimaryPhoneNumber(String number) {
// Set the number
if (TextUtils.isEmpty(number)) {
- mPhoneNumber.setText("");
+ mPhoneNumber.setText(null);
mPhoneNumber.setVisibility(View.GONE);
} else {
mPhoneNumber.setText(number);
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 930818901..2dc4274c4 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -187,8 +187,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
Log.d(this, "Primary call: " + primary);
Log.d(this, "Secondary call: " + secondary);
- final boolean outgoingCallReady = newState == InCallState.OUTGOING &&
- oldState == InCallState.PENDING_OUTGOING;
final boolean primaryChanged = !Call.areSame(mPrimary, primary);
final boolean secondaryChanged = !Call.areSame(mSecondary, secondary);
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 38b5f5400..77ef49d28 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -804,16 +804,18 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
// A new outgoing call indicates that the user just now dialed a number and when that
// happens we need to display the screen immediately or show an account picker dialog if
- // no default is set.
+ // no default is set. However, if the main InCallUI is already visible, we do not want to
+ // re-initiate the start-up animation, so we do not need to do anything here.
//
// It is also possible to go into an intermediate state where the call has been initiated
// but Telecomm has not yet returned with the details of the call (handle, gateway, etc.).
- // This pending outgoing state also launches the call screen.
+ // This pending outgoing state can also launch the call screen.
//
// This is different from the incoming call sequence because we do not need to shock the
// user with a top-level notification. Just show the call UI normally.
+ final boolean mainUiNotVisible = !isShowingInCallUi() || !getCallCardFragmentVisible();
final boolean showCallUi = ((InCallState.PENDING_OUTGOING == newState ||
- InCallState.OUTGOING == newState) || showAccountPicker);
+ InCallState.OUTGOING == newState) && mainUiNotVisible);
// TODO: Can we be suddenly in a call without it having been in the outgoing or incoming
// state? I havent seen that but if it can happen, the code below should be enabled.
@@ -829,7 +831,7 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
return mInCallState;
}
- if (showCallUi) {
+ if (showCallUi || showAccountPicker) {
Log.i(this, "Start in call UI");
showInCall(false /* showDialpad */, !showAccountPicker /* newOutgoingCall */);
} else if (startStartupSequence) {
@@ -1014,6 +1016,18 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener {
}
/**
+ * Returns whether the call card fragment is currently visible.
+ *
+ * @return True if the call card fragment is visible.
+ */
+ public boolean getCallCardFragmentVisible() {
+ if (mInCallActivity != null) {
+ return mInCallActivity.getCallCardFragment().isVisible();
+ }
+ return false;
+ }
+
+ /**
* @return True if the application is currently running in a right-to-left locale.
*/
public static boolean isRtl() {