diff options
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index f181fa0e3..32cd5dcf7 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -962,15 +962,16 @@ public class PhotoModule mUI.doShutterAnimation(); + Location loc = getLocationAccordPictureFormat(mParameters.get(KEY_PICTURE_FORMAT)); if (mLongshotSave) { mCameraDevice.takePicture(mHandler, new LongshotShutterCallback(), mRawPictureCallback, mPostViewPictureCallback, - new LongshotPictureCallback(null)); + new LongshotPictureCallback(loc)); } else { mCameraDevice.takePicture(mHandler,new LongshotShutterCallback(), mRawPictureCallback, mPostViewPictureCallback, - new JpegPictureCallback(null)); + new JpegPictureCallback(loc)); } } } @@ -1532,11 +1533,7 @@ public class PhotoModule mJpegRotation = CameraUtil.getJpegRotation(mCameraId, orientation); mParameters.setRotation(mJpegRotation); String pictureFormat = mParameters.get(KEY_PICTURE_FORMAT); - Location loc = null; - if (pictureFormat != null && - PIXEL_FORMAT_JPEG.equalsIgnoreCase(pictureFormat)) { - loc = mLocationManager.getCurrentLocation(); - } + Location loc = getLocationAccordPictureFormat(pictureFormat); CameraUtil.setGpsParameters(mParameters, loc); if (mRefocus) { @@ -1601,6 +1598,14 @@ public class PhotoModule setCameraParameters(UPDATE_PARAM_PREFERENCE); } + private Location getLocationAccordPictureFormat(String pictureFormat) { + if (pictureFormat != null && + PIXEL_FORMAT_JPEG.equalsIgnoreCase(pictureFormat)) { + return mLocationManager.getCurrentLocation(); + } + return null; + } + private int getPreferredCameraId(ComboPreferences preferences) { int intentCameraId = CameraUtil.getCameraFacingIntentExtras(mActivity); if (intentCameraId != -1) { |