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

Commit f2f0a73d authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Fix SessionProcessor vendor id initialization

The Camera Extension 'SessionProcessor' will infer the
corresponding metadata vendor id by inspecting the incoming
native metadata map. This must be done before the map is
passed to the extension implementation. This step requires
the transfer of the underlying native metadata in to a
new CharacteristicsMap, any subsequent queries will only
be using empty metadata buffers.

Flag: EXEMPT bugfix
Bug: 437259360
Test: Camera CTS
Change-Id: I2c0a7e9485881b4e2273102003fca7ca888c1bea
parent fed1c95a
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -509,6 +509,17 @@ public abstract class SessionProcessor {
            mPostviewSurface = postviewSurface;
            mImageCaptureSurface = imageCaptureSurface;

            // Extract the vendor ID from the camera characteristics. This is needed to ensure that
            // the vendor-specific capture results are correctly processed by the framework.
            Object thisClass = CameraCharacteristics.Key.class;
            Class<CameraCharacteristics.Key<?>> keyClass =
                    (Class<CameraCharacteristics.Key<?>>)thisClass;
            ArrayList<CameraCharacteristics.Key<?>> vendorKeys =
                    charsMap.get(cameraId).getAllVendorKeys(keyClass);
            if ((vendorKeys != null) && !vendorKeys.isEmpty()) {
                mVendorId = vendorKeys.get(0).getVendorId();
            }

            ExtensionConfiguration config;
            if (Flags.efvCaptureLatency()) {
                CameraConfiguration cameraConfig = new CameraConfiguration(
@@ -527,14 +538,6 @@ public abstract class SessionProcessor {
                throw  new  IllegalArgumentException("Invalid extension configuration");
            }

            Object thisClass = CameraCharacteristics.Key.class;
            Class<CameraCharacteristics.Key<?>> keyClass =
                    (Class<CameraCharacteristics.Key<?>>)thisClass;
            ArrayList<CameraCharacteristics.Key<?>> vendorKeys =
                    charsMap.get(cameraId).getAllVendorKeys(keyClass);
            if ((vendorKeys != null) && !vendorKeys.isEmpty()) {
                mVendorId = vendorKeys.get(0).getVendorId();
            }
            return config.getCameraSessionConfig();
        }