Loading media/java/android/media/tv/tuner/Lnb.java +20 −16 Original line number Diff line number Diff line Loading @@ -264,6 +264,25 @@ public class Lnb implements AutoCloseable { } } /* package */ void closeInternal() { synchronized (mLock) { if (mIsClosed) { return; } int res = nativeClose(); if (res != Tuner.RESULT_SUCCESS) { TunerUtils.throwExceptionForResult(res, "Failed to close LNB"); } else { mIsClosed = true; if (mOwner != null) { mOwner.releaseLnb(); mOwner = null; } mCallbackMap.clear(); } } } /** * Sets the LNB's power voltage. * Loading Loading @@ -330,22 +349,7 @@ public class Lnb implements AutoCloseable { public void close() { acquireTRMSLock("close()"); try { synchronized (mLock) { if (mIsClosed) { return; } int res = nativeClose(); if (res != Tuner.RESULT_SUCCESS) { TunerUtils.throwExceptionForResult(res, "Failed to close LNB"); } else { mIsClosed = true; if (mOwner != null) { mOwner.releaseLnb(); mOwner = null; } mCallbackMap.clear(); } } closeInternal(); } finally { releaseTRMSLock(); } Loading media/java/android/media/tv/tuner/Tuner.java +5 −4 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ public class Tuner implements AutoCloseable { if (DEBUG) { Log.d(TAG, "calling mLnb.close() : " + mClientId); } mLnb.close(); mLnb.closeInternal(); } else { if (DEBUG) { Log.d(TAG, "NOT calling mLnb.close() : " + mClientId); Loading Loading @@ -2353,6 +2353,7 @@ public class Tuner implements AutoCloseable { @Nullable public Lnb openLnbByName(@NonNull String name, @CallbackExecutor @NonNull Executor executor, @NonNull LnbCallback cb) { acquireTRMSLock("openLnbByName"); mLnbLock.lock(); try { Objects.requireNonNull(name, "LNB name must not be null"); Loading @@ -2361,7 +2362,7 @@ public class Tuner implements AutoCloseable { Lnb newLnb = nativeOpenLnbByName(name); if (newLnb != null) { if (mLnb != null) { mLnb.close(); mLnb.closeInternal(); mLnbHandle = null; } mLnb = newLnb; Loading @@ -2372,6 +2373,7 @@ public class Tuner implements AutoCloseable { } return mLnb; } finally { releaseTRMSLock(); mLnbLock.unlock(); } } Loading Loading @@ -2789,8 +2791,8 @@ public class Tuner implements AutoCloseable { } } // Must be called while TRMS lock is being held /* package */ void releaseLnb() { acquireTRMSLock("releaseLnb()"); mLnbLock.lock(); try { if (mLnbHandle != null) { Loading @@ -2807,7 +2809,6 @@ public class Tuner implements AutoCloseable { } mLnb = null; } finally { releaseTRMSLock(); mLnbLock.unlock(); } } Loading Loading
media/java/android/media/tv/tuner/Lnb.java +20 −16 Original line number Diff line number Diff line Loading @@ -264,6 +264,25 @@ public class Lnb implements AutoCloseable { } } /* package */ void closeInternal() { synchronized (mLock) { if (mIsClosed) { return; } int res = nativeClose(); if (res != Tuner.RESULT_SUCCESS) { TunerUtils.throwExceptionForResult(res, "Failed to close LNB"); } else { mIsClosed = true; if (mOwner != null) { mOwner.releaseLnb(); mOwner = null; } mCallbackMap.clear(); } } } /** * Sets the LNB's power voltage. * Loading Loading @@ -330,22 +349,7 @@ public class Lnb implements AutoCloseable { public void close() { acquireTRMSLock("close()"); try { synchronized (mLock) { if (mIsClosed) { return; } int res = nativeClose(); if (res != Tuner.RESULT_SUCCESS) { TunerUtils.throwExceptionForResult(res, "Failed to close LNB"); } else { mIsClosed = true; if (mOwner != null) { mOwner.releaseLnb(); mOwner = null; } mCallbackMap.clear(); } } closeInternal(); } finally { releaseTRMSLock(); } Loading
media/java/android/media/tv/tuner/Tuner.java +5 −4 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ public class Tuner implements AutoCloseable { if (DEBUG) { Log.d(TAG, "calling mLnb.close() : " + mClientId); } mLnb.close(); mLnb.closeInternal(); } else { if (DEBUG) { Log.d(TAG, "NOT calling mLnb.close() : " + mClientId); Loading Loading @@ -2353,6 +2353,7 @@ public class Tuner implements AutoCloseable { @Nullable public Lnb openLnbByName(@NonNull String name, @CallbackExecutor @NonNull Executor executor, @NonNull LnbCallback cb) { acquireTRMSLock("openLnbByName"); mLnbLock.lock(); try { Objects.requireNonNull(name, "LNB name must not be null"); Loading @@ -2361,7 +2362,7 @@ public class Tuner implements AutoCloseable { Lnb newLnb = nativeOpenLnbByName(name); if (newLnb != null) { if (mLnb != null) { mLnb.close(); mLnb.closeInternal(); mLnbHandle = null; } mLnb = newLnb; Loading @@ -2372,6 +2373,7 @@ public class Tuner implements AutoCloseable { } return mLnb; } finally { releaseTRMSLock(); mLnbLock.unlock(); } } Loading Loading @@ -2789,8 +2791,8 @@ public class Tuner implements AutoCloseable { } } // Must be called while TRMS lock is being held /* package */ void releaseLnb() { acquireTRMSLock("releaseLnb()"); mLnbLock.lock(); try { if (mLnbHandle != null) { Loading @@ -2807,7 +2809,6 @@ public class Tuner implements AutoCloseable { } mLnb = null; } finally { releaseTRMSLock(); mLnbLock.unlock(); } } Loading