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

Commit 16cbb942 authored by Weng Su's avatar Weng Su
Browse files

Fixed camera flaky issue in monkey testing

- Cache RuntimeException when stop previewing camera failed

Fix: 306606307
Test: unit test
make RunSettingsLibRoboTests

Change-Id: Ia05f7c528b6e74f755ca2cf81bbfbb7bc37f4f7a
parent c2bc3752
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -116,8 +116,13 @@ public class QrCamera extends Handler {
            mDecodeTask = null;
        }
        if (mCamera != null) {
            try {
                mCamera.stopPreview();
                releaseCamera();
            } catch (RuntimeException e) {
                Log.e(TAG, "Stop previewing camera failed:" + e);
                mCamera = null;
            }
        }
    }