catch null exception for filter event

Change-Id: I96021d83f3f32d5e99775c7b951fff11cf576798
bug:271245391
Test: manual
This commit is contained in:
Henry Fang
2023-03-04 00:07:35 +00:00
parent 0dcaf197b4
commit d3d570acde

View File

@@ -32,6 +32,7 @@ import android.util.Log;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.NullPointerException;
import java.util.concurrent.Executor;
/**
@@ -271,7 +272,12 @@ public class Filter implements AutoCloseable {
mExecutor.execute(() -> {
synchronized (mCallbackLock) {
if (mCallback != null) {
mCallback.onFilterStatusChanged(this, status);
try {
mCallback.onFilterStatusChanged(this, status);
}
catch (NullPointerException e) {
Log.d(TAG, "catch exception:" + e);
}
}
}
});
@@ -285,7 +291,12 @@ public class Filter implements AutoCloseable {
mExecutor.execute(() -> {
synchronized (mCallbackLock) {
if (mCallback != null) {
mCallback.onFilterEvent(this, events);
try {
mCallback.onFilterEvent(this, events);
}
catch (NullPointerException e) {
Log.d(TAG, "catch exception:" + e);
}
} else {
for (FilterEvent event : events) {
if (event instanceof MediaEvent) {