summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-11-02 20:28:51 -0700
committerArne Coucheron <arco68@gmail.com>2017-06-13 07:16:26 +0200
commit922c4b3b80f07ba064aea58a98b0d5026c64e045 (patch)
tree27daba912d73ef1f4fd7d880e349a759bb0daa42
parentbd1d6ea46043e54feca75826572a6b7f5db9400e (diff)
downloadandroid_packages_apps_Snap-922c4b3b80f07ba064aea58a98b0d5026c64e045.zip
android_packages_apps_Snap-922c4b3b80f07ba064aea58a98b0d5026c64e045.tar.gz
android_packages_apps_Snap-922c4b3b80f07ba064aea58a98b0d5026c64e045.tar.bz2
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
-rwxr-xr-xsrc/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 2e6a127..6242fe4 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1179,10 +1179,12 @@ public class CaptureModule extends BaseModule<CaptureUI> 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());
}