summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
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 3973fdfd6..a27efec76 100644
--- a/InCallUI/src/com/android/incallui/Call.java
+++ b/InCallUI/src/com/android/incallui/Call.java
@@ -376,6 +376,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;
@@ -478,6 +479,7 @@ public class Call {
mVideoCallCallback = new InCallVideoCallCallback(this);
}
mTelecomCall.getVideoCall().registerCallback(mVideoCallCallback);
+ mIsVideoCallCallbackRegistered = true;
}
mChildCallIds.clear();
@@ -784,8 +786,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() {