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

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

Merge "Camera2: Check for valid GPS timestamp before usage"

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

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

        Location l = new Location(translateProcessToLocationProvider(processingMethod));
        if (timeStamp != null) {
            l.setTime(timeStamp);
            // Location expects timestamp in [ms.]
            l.setTime(timeStamp * 1000);
        } else {
            Log.w(TAG, "getGpsLocation - No timestamp for GPS location.");
        }