Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Make onSnapshotFailed run on main thread. #347

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -721,16 +721,20 @@ public void run() {

/**
* Called by JNI peer when snapshot has failed.
* Always called on the origin (main) thread.
*
* @param reason the exception string
*/
@Keep
protected void onSnapshotFailed(String reason) {
if (errorHandler != null) {
errorHandler.onError(reason);
reset();
}
protected void onSnapshotFailed(final String reason) {
new Handler().post(new Runnable() {
@Override
public void run() {
if (errorHandler != null) {
errorHandler.onError(reason);
reset();
}
}
});
}

/**
Expand Down