Catch all exceptions in onFrameDraw

... as throwing an exception in there somehow will mess up the
hwui task queue.

Test: Have a crashy app, swipe up while the app is crashing
Fixes: 134583193
Change-Id: Ie3ba5f991759f807b154f55f9fc816e7efe2fdfe
This commit is contained in:
Jorim Jaggi
2019-06-25 15:36:46 +02:00
parent 544e00d382
commit b0bb2f778f

View File

@@ -1107,7 +1107,13 @@ public final class ViewRootImpl implements ViewParent,
*/
public void registerRtFrameCallback(FrameDrawingCallback callback) {
if (mAttachInfo.mThreadedRenderer != null) {
mAttachInfo.mThreadedRenderer.registerRtFrameCallback(callback);
mAttachInfo.mThreadedRenderer.registerRtFrameCallback(frame -> {
try {
callback.onFrameDraw(frame);
} catch (Exception e) {
Log.e(TAG, "Exception while executing onFrameDraw", e);
}
});
}
}