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

Commit 9296d15b authored by Sham Rathod's avatar Sham Rathod
Browse files

Tuner: Clean up frontend sharee resource before sharing another resource

Before sharing another resource in shareFrontendFromTuner method Clean
up old frontend sharee.

Test: cts-tradefed run commandAndExit cts -m CtsTvTestCases -t
android.media.tv.tuner.cts.TunerTest
Bug: 284386302

Change-Id: I606de9f4a95923183d0e2e94a8e73f9c0ed5df43
parent 60a60047
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -443,6 +443,12 @@ public class Tuner implements AutoCloseable {
        acquireTRMSLock("shareFrontendFromTuner()");
        mFrontendLock.lock();
        try {
            if (mFeOwnerTuner != null) {
                // unregister self from the Frontend callback
                mFeOwnerTuner.unregisterFrontendCallbackListener(this);
                mFeOwnerTuner = null;
                nativeUnshareFrontend();
            }
            mTunerResourceManager.shareFrontend(mClientId, tuner.mClientId);
            mFeOwnerTuner = tuner;
            mFeOwnerTuner.registerFrontendCallbackListener(this);