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

Commit ca367b71 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Fix race condition with preview callback.

Bug: 6301018
Change-Id: I19b8bc03ef3983d69e1e986c0f1a8154af5ab080
parent 03e93e51
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -736,8 +736,8 @@ public class Camera {
                return;

            case CAMERA_MSG_PREVIEW_FRAME:
                if (mPreviewCallback != null) {
                    PreviewCallback cb = mPreviewCallback;
                PreviewCallback pCb = mPreviewCallback;
                if (pCb != null) {
                    if (mOneShot) {
                        // Clear the callback variable before the callback
                        // in case the app calls setPreviewCallback from
@@ -749,7 +749,7 @@ public class Camera {
                        // Set to oneshot mode again.
                        setHasPreviewCallback(true, false);
                    }
                    cb.onPreviewFrame((byte[])msg.obj, mCamera);
                    pCb.onPreviewFrame((byte[])msg.obj, mCamera);
                }
                return;