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

Commit 4930d1c4 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

Change-Id: I0babb11ee14b5cd41c7be99ede6c5eb1fb004534
parents 7bcf28b2 3d041462
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.
            }
        }
    }
}