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

Commit a3ccdd88 authored by Mark Harman's avatar Mark Harman
Browse files

Should call setToDefault() before checking mPreview.supportsFocus().

parent e6d442a1
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -576,12 +576,13 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
     */
    private void subTestSaveFocusMode() {
        Log.d(TAG, "subTestSaveFocusMode");
        setToDefault();
        if( !mPreview.supportsFocus() ) {
            Log.d(TAG, "test requires focus");
            return;
        }
        setToDefault();
        String non_default_focus = getNonDefaultFocus();
        String focus_value = mPreview.getCameraController().getFocusValue();
@@ -4786,12 +4787,15 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            Log.d(TAG, "test requires camera2 api");
            return;
        }
        setToDefault();
        if( !mPreview.supportsFocus() ) {
            // if no focus, then the photo will be taken on th UI thread
            // if no focus, then the photo will be taken on the UI thread
            Log.d(TAG, "test requires focus");
            return;
        }
        setToDefault();
        switchToFocusValue("focus_mode_auto");
        mPreview.getCameraController().test_release_during_photo = true;
@@ -5826,12 +5830,13 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
    private void takePhotoRepeatFocus(boolean locked) throws InterruptedException {
        Log.d(TAG, "takePhotoRepeatFocus");
        setToDefault();
        if( !mPreview.supportsFocus() ) {
            Log.d(TAG, "test requires focus");
            return;
        }
        setToDefault();
        if( locked ) {
            switchToFocusValue("focus_mode_locked");
        }