From 922c4b3b80f07ba064aea58a98b0d5026c64e045 Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Wed, 2 Nov 2016 20:28:51 -0700 Subject: SnapdragonCamera: Make copy of location before altering timestamp Make a copy of saved location object before altering timestamp since we may end up re-using the same location object down the line. CRs-Fixed: 1007285 Change-Id: Ifa8b7cd3ecfe2dede5cfa155818f48f51f4405f1 --- src/com/android/camera/CaptureModule.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 2e6a127ba..6242fe499 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1179,10 +1179,12 @@ public class CaptureModule extends BaseModule implements PhotoControl Location location = mLocationManager.getCurrentLocation(); if(location != null) { - Log.d(TAG, "captureStillPicture gps: " + location.toString()); + // make copy so that we don't alter the saved location since we may re-use it + location = new Location(location); // workaround for Google bug. Need to convert timestamp from ms -> sec location.setTime(location.getTime()/1000); captureBuilder.set(CaptureRequest.JPEG_GPS_LOCATION, location); + Log.d(TAG, "captureStillPicture gps: " + location.toString()); } else { Log.d(TAG, "captureStillPicture no location - getRecordLocation: " + getRecordLocation()); } -- cgit v1.2.3