summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-08-31 17:18:36 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-27 11:23:31 -0700
commitf1235036ca21bda6b145a4c7660b59b2e8b67e95 (patch)
tree380a1d8da2b8d06937197d7f081d6fb285c7f1b4 /src/com/android/camera/CaptureModule.java
parent5fb8a1dea57501a24cc46fc605d4f0b8d41335c6 (diff)
downloadandroid_packages_apps_Snap-f1235036ca21bda6b145a4c7660b59b2e8b67e95.tar.gz
android_packages_apps_Snap-f1235036ca21bda6b145a4c7660b59b2e8b67e95.tar.bz2
android_packages_apps_Snap-f1235036ca21bda6b145a4c7660b59b2e8b67e95.zip
SnapdragonCamera: Set GPS location info for Camera2 photos
Set the GPS location info for Camera2 photos if the options is enabled and there is a valid location returned from LocationManager. CRs-Fixed: 1061772 Change-Id: I3c385304912edba806439f233407bdb42a57cbfc
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rw-r--r--src/com/android/camera/CaptureModule.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 12bc47b02..6cedbc650 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1114,6 +1114,15 @@ public class CaptureModule implements CameraModule, PhotoController,
captureBuilder = mCameraDevice[id].createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
}
+ Location location = mLocationManager.getCurrentLocation();
+ if(location != null) {
+ Log.d(TAG, "captureStillPicture gps: " + location.toString());
+ // workaround for Google bug. Need to convert timestamp from ms -> sec
+ location.setTime(location.getTime()/1000);
+ captureBuilder.set(CaptureRequest.JPEG_GPS_LOCATION, location);
+ } else {
+ Log.d(TAG, "captureStillPicture no location - getRecordLocation: " + getRecordLocation());
+ }
captureBuilder.set(CaptureRequest.JPEG_ORIENTATION, CameraUtil.getJpegRotation(id, mOrientation));
captureBuilder.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_AUTO);
addPreviewSurface(captureBuilder, null, id);