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

Commit 6d91e4f6 authored by Mark Harman's avatar Mark Harman
Browse files

New test_force_slow_preview_start for testing.

parent 3299016b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ public abstract class CameraController {
    public volatile int test_texture_view_buffer_w; // for TextureView, keep track of buffer size
    public volatile int test_texture_view_buffer_h;
    public volatile boolean test_force_run_post_capture; // for Camera2 API, test using adjustPreview() / RequestTagType.RUN_POST_CAPTURE
    public static volatile boolean test_force_slow_preview_start; // for Camera2 API, test waiting for 6s when starting preview

    /** Class for caching a subset of CameraFeatures, that are slow to read.
     *  For now only used for vendor extensions which are slow to read.
+16 −12
Original line number Diff line number Diff line
@@ -6230,13 +6230,15 @@ public class CameraController2 extends CameraController {
     */
    private void launchCameraSession(boolean wait_until_started, CreateCaptureSessionFunction function, Runnable on_failed) throws CameraAccessException {
        if( wait_until_started ) {
            /*try {
            if( test_force_slow_preview_start ) {
                try {
                    Thread.sleep(6000); // test slow to start preview
                    //Thread.sleep(25000); // test slow to start preview
                }
                catch(InterruptedException e) {
                    throw new RuntimeException(e);
            }*/
                }
            }
            function.call();
        }
        else {
@@ -6244,13 +6246,15 @@ public class CameraController2 extends CameraController {
                @Override
                public void run() {
                    try {
                        /*try {
                        if( test_force_slow_preview_start ) {
                            try {
                                Thread.sleep(6000); // test slow to start preview
                                //Thread.sleep(25000); // test slow to start preview
                            }
                            catch(InterruptedException e) {
                                throw new RuntimeException(e);
                        }*/
                            }
                        }
                        function.call();
                    }
                    catch(CameraAccessException e) {