diff options
Diffstat (limited to 'src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java')
-rw-r--r-- | src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java | 93 |
1 files changed, 53 insertions, 40 deletions
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java index 39096f5aa..87e91c78d 100644 --- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java @@ -101,15 +101,7 @@ public class ImsPhoneConnection extends Connection implements */ private boolean mShouldIgnoreVideoStateChanges = false; - /** - * Used to indicate whether the wifi state is based on - * {@link com.android.ims.ImsConnectionStateListener# - * onFeatureCapabilityChanged(int, int[], int[])} callbacks, or values received via the - * {@link ImsCallProfile#EXTRA_CALL_RAT_TYPE} extra. Util we receive a value via the extras, - * we will use the wifi state based on the {@code onFeatureCapabilityChanged}. Once a value - * is received via the extras, we will prefer those values going forward. - */ - private boolean mIsWifiStateFromExtras = false; + private ImsVideoCallProviderWrapper mImsVideoCallProviderWrapper; //***** Event Constants private static final int EVENT_DTMF_DONE = 1; @@ -180,8 +172,6 @@ public class ImsPhoneConnection extends Connection implements mCreateTime = System.currentTimeMillis(); mUusInfo = null; - updateWifiState(); - // Ensure any extras set on the ImsCallProfile at the start of the call are cached locally // in the ImsPhoneConnection. This isn't going to inform any listeners (since the original // connection is not likely to be associated with a TelephonyConnection yet). @@ -697,13 +687,11 @@ public class ImsPhoneConnection extends Connection implements } boolean updateParent = mParent.update(this, imsCall, state); - boolean updateWifiState = updateWifiState(); boolean updateAddressDisplay = updateAddressDisplay(imsCall); boolean updateMediaCapabilities = updateMediaCapabilities(imsCall); boolean updateExtras = updateExtras(imsCall); - return updateParent || updateWifiState || updateAddressDisplay || updateMediaCapabilities - || updateExtras; + return updateParent || updateAddressDisplay || updateMediaCapabilities || updateExtras; } @Override @@ -902,28 +890,6 @@ public class ImsPhoneConnection extends Connection implements } /** - * Check for a change in the wifi state of the ImsPhoneCallTracker and update the - * {@link ImsPhoneConnection} with this information. - * - * @return Whether the ImsPhoneCallTracker's usage of wifi has been changed. - */ - public boolean updateWifiState() { - // If we've received the wifi state via the ImsCallProfile.EXTRA_CALL_RAT_TYPE extra, we - // will no longer use state updates which are based on the onFeatureCapabilityChanged - // callback. - if (mIsWifiStateFromExtras) { - return false; - } - - Rlog.d(LOG_TAG, "updateWifiState: " + mOwner.isVowifiEnabled()); - if (isWifi() != mOwner.isVowifiEnabled()) { - setWifi(mOwner.isVowifiEnabled()); - return true; - } - return false; - } - - /** * Updates the wifi state based on the {@link ImsCallProfile#EXTRA_CALL_RAT_TYPE}. * The call is considered to be a WIFI call if the extra value is * {@link ServiceState#RIL_RADIO_TECHNOLOGY_IWLAN}. @@ -934,10 +900,6 @@ public class ImsPhoneConnection extends Connection implements if (extras.containsKey(ImsCallProfile.EXTRA_CALL_RAT_TYPE) || extras.containsKey(ImsCallProfile.EXTRA_CALL_RAT_TYPE_ALT)) { - // We've received the extra indicating the radio technology, so we will continue to - // prefer the radio technology received via this extra going forward. - mIsWifiStateFromExtras = true; - ImsCall call = getImsCall(); boolean isWifi = false; if (call != null) { @@ -1059,6 +1021,15 @@ public class ImsPhoneConnection extends Connection implements return sb.toString(); } + @Override + public void setVideoProvider(android.telecom.Connection.VideoProvider videoProvider) { + super.setVideoProvider(videoProvider); + + if (videoProvider instanceof ImsVideoCallProviderWrapper) { + mImsVideoCallProviderWrapper = (ImsVideoCallProviderWrapper) videoProvider; + } + } + /** * Indicates whether current phone connection is emergency or not * @return boolean: true if emergency, false otherwise @@ -1110,4 +1081,46 @@ public class ImsPhoneConnection extends Connection implements setVideoState(currentVideoState); } } + + /** + * Issues a request to pause the video using {@link VideoProfile#STATE_PAUSED} from a source + * other than the InCall UI. + * + * @param source The source of the pause request. + */ + public void pauseVideo(int source) { + if (mImsVideoCallProviderWrapper == null) { + return; + } + + mImsVideoCallProviderWrapper.pauseVideo(getVideoState(), source); + } + + /** + * Issues a request to resume the video using {@link VideoProfile#STATE_PAUSED} from a source + * other than the InCall UI. + * + * @param source The source of the resume request. + */ + public void resumeVideo(int source) { + if (mImsVideoCallProviderWrapper == null) { + return; + } + + mImsVideoCallProviderWrapper.resumeVideo(getVideoState(), source); + } + + /** + * Determines if a specified source has issued a pause request. + * + * @param source The source. + * @return {@code true} if the source issued a pause request, {@code false} otherwise. + */ + public boolean wasVideoPausedFromSource(int source) { + if (mImsVideoCallProviderWrapper == null) { + return false; + } + + return mImsVideoCallProviderWrapper.wasVideoPausedFromSource(source); + } } |