summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-04-07 17:20:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-04-07 17:20:01 +0000
commit1f77177c64177d51fe6312532195d133a7c6186c (patch)
tree4bea687b26a5d439896fe1df10a0911e25ae9157 /InCallUI
parent87b9abf1fe4d480e15b2af03876003e6b8808b84 (diff)
parentc0388bfd7d50b93be45fdd86de31f7b8bfb9949f (diff)
Merge "IMS-VT: Fix race-condition causing preview freeze." into nyc-dev
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/Call.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 54ec52829..447c34c88 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -374,6 +374,7 @@ public class Call {
private int mRequestedVideoState = VideoProfile.STATE_AUDIO_ONLY;
private InCallVideoCallCallback mVideoCallCallback;
+ private boolean mIsVideoCallCallbackRegistered;
private String mChildNumber;
private String mLastForwardedNumber;
private String mCallSubject;
@@ -448,6 +449,7 @@ public class Call {
mVideoCallCallback = new InCallVideoCallCallback(this);
}
mTelecomCall.getVideoCall().registerCallback(mVideoCallCallback);
+ mIsVideoCallCallbackRegistered = true;
}
mChildCallIds.clear();
@@ -754,8 +756,14 @@ public class Call {
return mTelecomCall == null ? null : mTelecomCall.getDetails().getAccountHandle();
}
+ /**
+ * @return The {@link VideoCall} instance associated with the {@link android.telecom.Call}.
+ * Will return {@code null} until {@link #updateFromTelecomCall()} has registered a valid
+ * callback on the {@link VideoCall}.
+ */
public VideoCall getVideoCall() {
- return mTelecomCall == null ? null : mTelecomCall.getVideoCall();
+ return mTelecomCall == null || !mIsVideoCallCallbackRegistered ? null
+ : mTelecomCall.getVideoCall();
}
public List<String> getChildCallIds() {