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

Commit 897e587e authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊 Committed by Nishith Khanna
Browse files

camera: Don't disable preview bitmap if its enabled already

parent b61533a6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1165,8 +1165,11 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
    public void onSurfaceTextureUpdated(@NonNull SurfaceTexture arg0) {
        refreshPreviewBitmap();

        boolean previewBitmapWasEnabled = isPreviewBitmapEnabled();
        if (isQRCode()) {
            if (!previewBitmapWasEnabled) {
                enablePreviewBitmap();
            }
            TextureView textureView = (TextureView) this.cameraSurface;
            Bitmap bitmap =  textureView.getBitmap(preview_bitmap);

@@ -1195,7 +1198,7 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
            } else {
                // K1ZFP TODO Error 1
            }
        } else {
        } else if (!previewBitmapWasEnabled) {
            disablePreviewBitmap();
        }
    }