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

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

Camera: Allow 0-face notifications to be sent

Applications need to know when all faces have left a scene, so
filtering out zero-faces messages is incorrect.

Test: atest CameraTest on sargo-userdebug
Bug: 162302014
Change-Id: I269fccd3ac04c1aa650bfea95da16e8c4871b7e5
parent e52b8fa8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -142,7 +142,8 @@ status_t BnCameraClient::onTransact(
            camera_frame_metadata_t metadata;
            if (data.dataAvail() > 0) {
                metadata.number_of_faces = data.readInt32();
                if (metadata.number_of_faces <= 0 ||
                // Zero faces is a valid case, to notify clients that no faces are now visible
                if (metadata.number_of_faces < 0 ||
                        metadata.number_of_faces > (int32_t)(INT32_MAX / sizeof(camera_face_t))) {
                    ALOGE("%s: Too large face count: %d", __FUNCTION__, metadata.number_of_faces);
                    return BAD_VALUE;