diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-10-30 18:08:11 +0000 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-10-30 18:17:03 +0000 |
commit | 28cd3f3375476cbf437241bfc5efb223a73955b8 (patch) | |
tree | e9387905bd77797702030008ed3f9ed61879f0b4 /camera | |
parent | 2d2391e849650ecab9dc3344b58b649c201293b2 (diff) | |
download | device_samsung_smdk4412-common-28cd3f3375476cbf437241bfc5efb223a73955b8.zip device_samsung_smdk4412-common-28cd3f3375476cbf437241bfc5efb223a73955b8.tar.gz device_samsung_smdk4412-common-28cd3f3375476cbf437241bfc5efb223a73955b8.tar.bz2 |
camera: Fix disabling location
If Camera.removeGpsData() is invoked from the userland API, we
must invalidate the previously stored GPS data to prevent it from
being saved in EXIF.
Fixes the invalid storing of location data after an explicit disable
Fixes android.hardware.cts.CameraTest#testJpegExif
Change-Id: I9618a27ab9def974bac1d69871c3454300fb4c29
Diffstat (limited to 'camera')
-rw-r--r-- | camera/exynos_camera.c | 9 | ||||
-rw-r--r-- | camera/exynos_exif.c | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c index 7b2875b..2a12243 100644 --- a/camera/exynos_camera.c +++ b/camera/exynos_camera.c @@ -4237,6 +4237,15 @@ int exynos_camera_set_parameters(struct camera_device *dev, exynos_camera = (struct exynos_camera *) dev->priv; + if (strstr(params, "gps-timestamp=") == NULL) { + /* Make sure the GPS data is ignored, it may have + * been explicitly erased with removeGpsData() + */ + exynos_param_int_set(exynos_camera, "gps-timestamp", -1); + exynos_param_int_set(exynos_camera, "gps-latitude", -1); + exynos_param_int_set(exynos_camera, "gps-longitude", -1); + } + rc = exynos_params_string_set(exynos_camera, (char *) params); if (rc < 0) { ALOGE("%s: Unable to set params string", __func__); diff --git a/camera/exynos_exif.c b/camera/exynos_exif.c index 2ba4ca1..b0d1656 100644 --- a/camera/exynos_exif.c +++ b/camera/exynos_exif.c @@ -195,6 +195,7 @@ int exynos_exif_attributes_create_gps(struct exynos_camera *exynos_camera, snprintf((char *) attributes->gps_datestamp, sizeof(attributes->gps_datestamp), "%04d:%02d:%02d", time_info.tm_year + 1900, time_info.tm_mon + 1, time_info.tm_mday); + strcpy((char *) attributes->gps_processing_method, gps_processing_method_string); attributes->enableGps = true; return 0; @@ -423,6 +424,8 @@ int exynos_exif_start(struct exynos_camera *exynos_camera, struct exynos_exif *e return -1; } + memset(&exif->attributes, 0, sizeof(exif_attribute_t)); + rc = exynos_exif_attributes_create_static(exynos_camera, exif); if (rc < 0) { ALOGE("%s: Unable to create exif attributes", __func__); |