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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user