Merge "Fix Filter callback race condition" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e8d0d4fd90
@@ -560,6 +560,11 @@ public class Filter implements AutoCloseable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
synchronized (mCallbackLock) {
|
||||||
|
mCallback = null;
|
||||||
|
mExecutor = null;
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (mIsClosed) {
|
if (mIsClosed) {
|
||||||
return;
|
return;
|
||||||
@@ -568,8 +573,6 @@ public class Filter implements AutoCloseable {
|
|||||||
if (res != Tuner.RESULT_SUCCESS) {
|
if (res != Tuner.RESULT_SUCCESS) {
|
||||||
TunerUtils.throwExceptionForResult(res, "Failed to close filter.");
|
TunerUtils.throwExceptionForResult(res, "Failed to close filter.");
|
||||||
} else {
|
} else {
|
||||||
mCallback = null;
|
|
||||||
mExecutor = null;
|
|
||||||
mIsStarted = false;
|
mIsStarted = false;
|
||||||
mIsClosed = true;
|
mIsClosed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user