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

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

Camera2: Change face detect/scene mode priority.

Explicit scene modes should override the implicit face priority scene
mode from enabling face detection, to match application/API
expectations.

Change-Id: I6f0f44fadeacfdc0594dd2fdc280e294d2d87df6
parent 874a4618
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1380,8 +1380,11 @@ status_t Parameters::updateRequest(CameraMetadata *request) const {
            &reqControlMode, 1);
    if (res != OK) return res;

    uint8_t reqSceneMode = enableFaceDetect ?
            (uint8_t)ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY : sceneMode;
    uint8_t reqSceneMode =
            (sceneMode !=
                    (uint8_t)ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED) ? sceneMode :
            enableFaceDetect ? (uint8_t)ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY :
            (uint8_t)ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED;
    res = request->update(ANDROID_CONTROL_SCENE_MODE,
            &reqSceneMode, 1);
    if (res != OK) return res;