Loading telecomm/java/android/telecom/Call.java +17 −5 Original line number Diff line number Diff line Loading @@ -25,8 +25,11 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.ParcelFileDescriptor; import com.android.internal.telecom.IVideoProvider; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; Loading Loading @@ -2132,13 +2135,22 @@ public final class Call { cannedTextResponsesChanged = true; } VideoCallImpl newVideoCallImpl = parcelableCall.getVideoCallImpl(mCallingPackage, mTargetSdkVersion); boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() && !Objects.equals(mVideoCallImpl, newVideoCallImpl); IVideoProvider previousVideoProvider = mVideoCallImpl == null ? null : mVideoCallImpl.getVideoProvider(); IVideoProvider newVideoProvider = parcelableCall.getVideoProvider(); // parcelableCall.isVideoCallProviderChanged is only true when we have a video provider // specified; so we should check if the actual IVideoProvider changes as well. boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() && !Objects.equals(previousVideoProvider, newVideoProvider); if (videoCallChanged) { mVideoCallImpl = newVideoCallImpl; if (mVideoCallImpl != null) { mVideoCallImpl.destroy(); } mVideoCallImpl = parcelableCall.isVideoCallProviderChanged() ? parcelableCall.getVideoCallImpl(mCallingPackage, mTargetSdkVersion) : null; } if (mVideoCallImpl != null) { mVideoCallImpl.setVideoState(getDetails().getVideoState()); } Loading telecomm/java/android/telecom/ParcelableCall.java +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.UnsupportedAppUsage; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; Loading Loading @@ -225,6 +226,10 @@ public final class ParcelableCall implements Parcelable { return mVideoCall; } public IVideoProvider getVideoProvider() { return mVideoCallProvider; } public boolean getIsRttCallChanged() { return mIsRttCallChanged; } Loading telecomm/java/android/telecom/VideoCallImpl.java +20 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import com.android.internal.os.SomeArgs; import com.android.internal.telecom.IVideoCallback; import com.android.internal.telecom.IVideoProvider; import java.util.NoSuchElementException; /** * Implementation of a Video Call, which allows InCallUi to communicate commands to the underlying * {@link Connection.VideoProvider}, and direct callbacks from the Loading @@ -53,7 +55,11 @@ public class VideoCallImpl extends VideoCall { private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() { @Override public void binderDied() { try { mVideoProvider.asBinder().unlinkToDeath(this, 0); } catch (NoSuchElementException nse) { // Already unlinked in destroy below. } } }; Loading Loading @@ -222,6 +228,11 @@ public class VideoCallImpl extends VideoCall { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 127403196) public void destroy() { unregisterCallback(mCallback); try { mVideoProvider.asBinder().unlinkToDeath(mDeathRecipient, 0); } catch (NoSuchElementException nse) { // Already unlinked in binderDied above. } } /** {@inheritDoc} */ Loading Loading @@ -353,4 +364,12 @@ public class VideoCallImpl extends VideoCall { public void setVideoState(int videoState) { mVideoState = videoState; } /** * Get the video provider binder. * @return the video provider binder. */ public IVideoProvider getVideoProvider() { return mVideoProvider; } } Loading
telecomm/java/android/telecom/Call.java +17 −5 Original line number Diff line number Diff line Loading @@ -25,8 +25,11 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.ParcelFileDescriptor; import com.android.internal.telecom.IVideoProvider; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; Loading Loading @@ -2132,13 +2135,22 @@ public final class Call { cannedTextResponsesChanged = true; } VideoCallImpl newVideoCallImpl = parcelableCall.getVideoCallImpl(mCallingPackage, mTargetSdkVersion); boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() && !Objects.equals(mVideoCallImpl, newVideoCallImpl); IVideoProvider previousVideoProvider = mVideoCallImpl == null ? null : mVideoCallImpl.getVideoProvider(); IVideoProvider newVideoProvider = parcelableCall.getVideoProvider(); // parcelableCall.isVideoCallProviderChanged is only true when we have a video provider // specified; so we should check if the actual IVideoProvider changes as well. boolean videoCallChanged = parcelableCall.isVideoCallProviderChanged() && !Objects.equals(previousVideoProvider, newVideoProvider); if (videoCallChanged) { mVideoCallImpl = newVideoCallImpl; if (mVideoCallImpl != null) { mVideoCallImpl.destroy(); } mVideoCallImpl = parcelableCall.isVideoCallProviderChanged() ? parcelableCall.getVideoCallImpl(mCallingPackage, mTargetSdkVersion) : null; } if (mVideoCallImpl != null) { mVideoCallImpl.setVideoState(getDetails().getVideoState()); } Loading
telecomm/java/android/telecom/ParcelableCall.java +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.UnsupportedAppUsage; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; Loading Loading @@ -225,6 +226,10 @@ public final class ParcelableCall implements Parcelable { return mVideoCall; } public IVideoProvider getVideoProvider() { return mVideoCallProvider; } public boolean getIsRttCallChanged() { return mIsRttCallChanged; } Loading
telecomm/java/android/telecom/VideoCallImpl.java +20 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import com.android.internal.os.SomeArgs; import com.android.internal.telecom.IVideoCallback; import com.android.internal.telecom.IVideoProvider; import java.util.NoSuchElementException; /** * Implementation of a Video Call, which allows InCallUi to communicate commands to the underlying * {@link Connection.VideoProvider}, and direct callbacks from the Loading @@ -53,7 +55,11 @@ public class VideoCallImpl extends VideoCall { private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() { @Override public void binderDied() { try { mVideoProvider.asBinder().unlinkToDeath(this, 0); } catch (NoSuchElementException nse) { // Already unlinked in destroy below. } } }; Loading Loading @@ -222,6 +228,11 @@ public class VideoCallImpl extends VideoCall { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 127403196) public void destroy() { unregisterCallback(mCallback); try { mVideoProvider.asBinder().unlinkToDeath(mDeathRecipient, 0); } catch (NoSuchElementException nse) { // Already unlinked in binderDied above. } } /** {@inheritDoc} */ Loading Loading @@ -353,4 +364,12 @@ public class VideoCallImpl extends VideoCall { public void setVideoState(int videoState) { mVideoState = videoState; } /** * Get the video provider binder. * @return the video provider binder. */ public IVideoProvider getVideoProvider() { return mVideoProvider; } }