Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ea09c58 authored by Ravi Paluri's avatar Ravi Paluri Committed by Tyler Gunn
Browse files

IMS-VT: Remove video call back attached with old video provider

If old video provider is valid, then remove video call back
attached with it.

Test: Manual
Bug: 35376544
Change-Id: I8882eed081baa1a304e939a9f1f6ddf4a582ca63
parent 67d03283
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2633,6 +2633,11 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
    public void setVideoProvider(IVideoProvider videoProvider) {
        Log.v(this, "setVideoProvider");

        if (mVideoProviderProxy != null) {
            mVideoProviderProxy.clearVideoCallback();
            mVideoProviderProxy = null;
        }

        if (videoProvider != null ) {
            try {
                mVideoProviderProxy = new VideoProviderProxy(mLock, videoProvider, this,
@@ -2640,8 +2645,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            } catch (RemoteException ignored) {
                // Ignore RemoteException.
            }
        } else {
            mVideoProviderProxy = null;
        }

        mVideoProvider = videoProvider;
+7 −0
Original line number Diff line number Diff line
@@ -129,6 +129,13 @@ public class VideoProviderProxy extends Connection.VideoProvider {
        mCurrentUserProxy = currentUserProxy;
    }

    public void clearVideoCallback() {
        try {
            mConectionServiceVideoProvider.removeVideoCallback(mVideoCallListenerBinder);
        } catch (RemoteException e) {
        }
    }

    /**
     * IVideoCallback stub implementation.  An instance of this class receives callbacks from the
     * {@code ConnectionService}'s video provider.