summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-11-02 20:28:51 -0700
committerJay Wang <jaywang@codeaurora.org>2016-11-02 20:29:47 -0700
commit86887b9fea3b9e279688c0af75b7d2004c93a51a (patch)
tree90e28212922b2c7388d3a6f116c8de60ec0697f1
parent82019206491a2d55dcf115d4e9f1e8d7391b443d (diff)
downloadandroid_packages_apps_Snap-86887b9fea3b9e279688c0af75b7d2004c93a51a.tar.gz
android_packages_apps_Snap-86887b9fea3b9e279688c0af75b7d2004c93a51a.tar.bz2
android_packages_apps_Snap-86887b9fea3b9e279688c0af75b7d2004c93a51a.zip
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
-rw-r--r--src/com/android/camera/CaptureModule.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index c800c6e4e..88eabbdec 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1177,10 +1177,12 @@ public class CaptureModule implements CameraModule, PhotoController,
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());
}