Merge "IMS-VT: Fix race-condition causing preview freeze." into nyc-dev am: 1f77177
am: d75990c
* commit 'd75990c1c893caf86cc09a2ccf6d0c3937401194':
IMS-VT: Fix race-condition causing preview freeze.
Change-Id: I4162ad954b4d78c365265bded0c720935553368c
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java
index 3973fdf..a27efec 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -376,6 +376,7 @@
private int mRequestedVideoState = VideoProfile.STATE_AUDIO_ONLY;
private InCallVideoCallCallback mVideoCallCallback;
+ private boolean mIsVideoCallCallbackRegistered;
private String mChildNumber;
private String mLastForwardedNumber;
private String mCallSubject;
@@ -478,6 +479,7 @@
mVideoCallCallback = new InCallVideoCallCallback(this);
}
mTelecomCall.getVideoCall().registerCallback(mVideoCallCallback);
+ mIsVideoCallCallbackRegistered = true;
}
mChildCallIds.clear();
@@ -784,8 +786,14 @@
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() {