Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0bb2f77 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

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
parent 544e00d3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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);
                }
            });
        }
    }