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

Commit 57493689 authored by Ruben Brunk's avatar Ruben Brunk Committed by Eino-Ville Talvala
Browse files

camera2: Update native/managed key mappings.

Switches to using managed value classes for the following keys:
- android.sensor.info.sensitivityRange
- android.sensor.info.exposureTimeRange
- android.jpeg.gpsCoordinates
- android.jpeg.gpsTimestamp
- android.jpeg.gpsProcessingMethod
- android.statistics.lensShadingMap
- android.lens.info.shadingMapSize
Also fixes a minor bug in LensShadingMap

Bug: 14628001
Change-Id: Ia0f541242f529ab9ba3111db799306b198f2b40b
parent 8490ace7
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -12165,7 +12165,6 @@ package android.hardware.camera2 {
    field public static final android.hardware.camera2.CameraCharacteristics.Key LENS_INFO_FOCUS_DISTANCE_CALIBRATION;
    field public static final android.hardware.camera2.CameraCharacteristics.Key LENS_INFO_HYPERFOCAL_DISTANCE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key LENS_INFO_MINIMUM_FOCUS_DISTANCE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key LENS_INFO_SHADING_MAP_SIZE;
    field public static final android.hardware.camera2.CameraCharacteristics.Key NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_AVAILABLE_CAPABILITIES;
    field public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_MAX_NUM_INPUT_STREAMS;
@@ -12484,9 +12483,7 @@ package android.hardware.camera2 {
    field public static final android.hardware.camera2.CaptureRequest.Key EDGE_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key FLASH_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key HOT_PIXEL_MODE;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_GPS_COORDINATES;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_GPS_PROCESSING_METHOD;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_GPS_TIMESTAMP;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_GPS_LOCATION;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_ORIENTATION;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_QUALITY;
    field public static final android.hardware.camera2.CaptureRequest.Key JPEG_THUMBNAIL_QUALITY;
@@ -12560,9 +12557,7 @@ package android.hardware.camera2 {
    field public static final android.hardware.camera2.CaptureResult.Key FLASH_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key FLASH_STATE;
    field public static final android.hardware.camera2.CaptureResult.Key HOT_PIXEL_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_GPS_COORDINATES;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_GPS_PROCESSING_METHOD;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_GPS_TIMESTAMP;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_GPS_LOCATION;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_ORIENTATION;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_QUALITY;
    field public static final android.hardware.camera2.CaptureResult.Key JPEG_THUMBNAIL_QUALITY;
@@ -12591,7 +12586,7 @@ package android.hardware.camera2 {
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_FACE_DETECT_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_HOT_PIXEL_MAP;
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_HOT_PIXEL_MAP_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_LENS_SHADING_MAP;
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_LENS_SHADING_CORRECTION_MAP;
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_LENS_SHADING_MAP_MODE;
    field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_SCENE_FLICKER;
    field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_CURVE;
+6 −6
Original line number Diff line number Diff line
@@ -587,6 +587,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <p>Dimensions of lens shading map.</p>
     * <p>The map should be on the order of 30-40 rows and columns, and
     * must be smaller than 64x64.</p>
     * @hide
     */
    public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
            new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
@@ -852,7 +853,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * value.</p>
     * <p>The following keys may return <code>null</code> unless they are enabled:</p>
     * <ul>
     * <li>{@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
     * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
     * </ul>
     * <p>(Those sometimes-null keys should nevertheless be listed here
     * if they are available.)</p>
@@ -863,7 +864,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <p>TODO: This should be used by #getAvailableCaptureResultKeys.</p>
     *
     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
     * @hide
     */
@@ -1331,8 +1331,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
    /**
     * <p>Range of valid sensitivities</p>
     */
    public static final Key<int[]> SENSOR_INFO_SENSITIVITY_RANGE =
            new Key<int[]>("android.sensor.info.sensitivityRange", int[].class);
    public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
            new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});

    /**
     * <p>Arrangement of color filters on sensor;
@@ -1353,8 +1353,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     *
     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
     */
    public static final Key<long[]> SENSOR_INFO_EXPOSURE_TIME_RANGE =
            new Key<long[]>("android.sensor.info.exposureTimeRange", long[].class);
    public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
            new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});

    /**
     * <p>Maximum possible frame duration (minimum frame
+3 −1
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ public final class CameraManager {
    private CameraDevice openCameraDeviceUserAsync(String cameraId,
            CameraDevice.StateListener listener, Handler handler)
            throws CameraAccessException {
        CameraCharacteristics characteristics = getCameraCharacteristics(cameraId);
        CameraDevice device = null;
        try {

@@ -231,7 +232,8 @@ public final class CameraManager {
                        new android.hardware.camera2.impl.CameraDevice(
                                cameraId,
                                listener,
                                handler);
                                handler,
                                characteristics);

                BinderHolder holder = new BinderHolder();

+2 −4
Original line number Diff line number Diff line
@@ -290,8 +290,8 @@ public abstract class CameraMetadata<TKey> {
     * </ul>
     * </li>
     * <li>Lens shading map information<ul>
     * <li>{@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}</li>
     * <li>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}</li>
     * <li>android.statistics.lensShadingMap</li>
     * <li>android.lens.info.shadingMapSize</li>
     * </ul>
     * </li>
     * </ul>
@@ -302,8 +302,6 @@ public abstract class CameraMetadata<TKey> {
     *
     * @see CaptureRequest#COLOR_CORRECTION_GAINS
     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
     * @see CaptureRequest#TONEMAP_CURVE
     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
     * @see CaptureRequest#TONEMAP_MODE
+14 −9
Original line number Diff line number Diff line
@@ -1051,9 +1051,16 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
    public static final Key<Integer> HOT_PIXEL_MODE =
            new Key<Integer>("android.hotPixel.mode", int.class);

    /**
     * <p>A location object to use when generating image GPS metadata.</p>
     */
    public static final Key<android.location.Location> JPEG_GPS_LOCATION =
            new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);

    /**
     * <p>GPS coordinates to include in output JPEG
     * EXIF</p>
     * @hide
     */
    public static final Key<double[]> JPEG_GPS_COORDINATES =
            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
@@ -1061,6 +1068,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
    /**
     * <p>32 characters describing GPS algorithm to
     * include in EXIF</p>
     * @hide
     */
    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
@@ -1068,6 +1076,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
    /**
     * <p>Time GPS fix was made to include in
     * EXIF</p>
     * @hide
     */
    public static final Key<Long> JPEG_GPS_TIMESTAMP =
            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
@@ -1416,8 +1425,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     * <p>When set to OFF mode, no lens shading correction will be applied by the
     * camera device, and an identity lens shading map data will be provided
     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
     * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>,
     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map
     * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>,
     * the output android.statistics.lensShadingMap for this case will be an identity map
     * shown below:</p>
     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
     * 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
@@ -1429,8 +1438,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     * <p>When set to other modes, lens shading correction will be applied by the
     * camera device. Applications can request lens shading map data by setting
     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide
     * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified
     * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}; the returned shading map data will be the one
     * lens shading map data in android.statistics.lensShadingMap, with size specified
     * by android.lens.info.shadingMapSize; the returned shading map data will be the one
     * applied by the camera device for this capture request.</p>
     * <p>The shading map data may depend on the AE and AWB statistics, therefore the reliability
     * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in
@@ -1440,8 +1449,6 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     *
     * @see CaptureRequest#CONTROL_AE_MODE
     * @see CaptureRequest#CONTROL_AWB_MODE
     * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
     * @see #SHADING_MODE_OFF
     * @see #SHADING_MODE_FAST
@@ -1482,10 +1489,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     * <p>Whether the camera device will output the lens
     * shading map in output result metadata.</p>
     * <p>When set to ON,
     * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in
     * android.statistics.lensShadingMap must be provided in
     * the output result metadata.</p>
     *
     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
     * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
     * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
     */
Loading