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

Commit 05417755 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Merge "Add teardown method for video call provider wrapper." am: 3d041462 am: 4930d1c4

am: eb12c603

Change-Id: I3ebb0a714ef54183584bbbebf52fc81fc5d39153
parents d2d1992b eb12c603
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.SomeArgs;

import java.util.Collections;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

@@ -76,7 +77,11 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider {
    private IBinder.DeathRecipient mDeathRecipient = new IBinder.DeathRecipient() {
        @Override
        public void binderDied() {
            try {
                mVideoCallProvider.asBinder().unlinkToDeath(this, 0);
            } catch (NoSuchElementException nse) {
                // Already unlinked, potentially below in tearDown.
            }
        }
    };

@@ -595,4 +600,17 @@ public class ImsVideoCallProviderWrapper extends Connection.VideoProvider {
    public void setIsVideoEnabled(boolean isVideoEnabled) {
        mIsVideoEnabled = isVideoEnabled;
    }

    /**
     * Tears down the ImsVideoCallProviderWrapper.
     */
    public void tearDown() {
        if (mDeathRecipient != null) {
            try {
                mVideoCallProvider.asBinder().unlinkToDeath(mDeathRecipient, 0);
            } catch (NoSuchElementException nse) {
                // Already unlinked in binderDied above.
            }
        }
    }
}