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

Commit 36d32c37 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Correct EXIF GPS timestamp"

parents 39cb8895 8f240961
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -792,7 +792,8 @@ public class CameraMetadataNative implements Parcelable {
    private Location getGpsLocation() {
        String processingMethod = get(CaptureResult.JPEG_GPS_PROCESSING_METHOD);
        double[] coords = get(CaptureResult.JPEG_GPS_COORDINATES);
        Long timeStamp = get(CaptureResult.JPEG_GPS_TIMESTAMP);
        // Location expects timestamp in [ms.]
        Long timeStamp = get(CaptureResult.JPEG_GPS_TIMESTAMP) * 1000;

        if (areValuesAllNull(processingMethod, coords, timeStamp)) {
            return null;
@@ -823,7 +824,8 @@ public class CameraMetadataNative implements Parcelable {

        double[] coords = { l.getLatitude(), l.getLongitude(), l.getAltitude() };
        String processMethod = translateLocationProviderToProcess(l.getProvider());
        long timestamp = l.getTime();
        //JPEG_GPS_TIMESTAMP expects sec. instead of msec.
        long timestamp = l.getTime() / 1000;

        set(CaptureRequest.JPEG_GPS_TIMESTAMP, timestamp);
        set(CaptureRequest.JPEG_GPS_COORDINATES, coords);