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

Commit 550c19a6 authored by Clément Julliard's avatar Clément Julliard Committed by android-build-merger
Browse files

Merge "Relax constraints on valid ImageReader usage flags" into pi-dev am: fa430166

am: a60cdac4

Change-Id: I7e17a6c16ec9efe64a7b5f306340cb86563fecab
parents c7db0f9b a60cdac4
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -727,18 +727,7 @@ public class ImageReader implements AutoCloseable {
            return false;
        }

        if (format == ImageFormat.PRIVATE) {
            // Usage need to be either USAGE0_GPU_SAMPLED_IMAGE or USAGE0_VIDEO_ENCODE or combined.
            boolean isAllowed = (usage == HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE);
            isAllowed = isAllowed || (usage == HardwareBuffer.USAGE_VIDEO_ENCODE);
            isAllowed = isAllowed || (usage ==
                    (HardwareBuffer.USAGE_VIDEO_ENCODE | HardwareBuffer.USAGE_GPU_SAMPLED_IMAGE));
            return isAllowed;
        } else {
            // Usage need to make the buffer CPU readable for explicit format.
            return ((usage == HardwareBuffer.USAGE_CPU_READ_RARELY) ||
                    (usage == HardwareBuffer.USAGE_CPU_READ_OFTEN));
        }
        return true;
    }

    /**