From 35cf43e34c230f2a4cff1d147685c8da026d2b1f Mon Sep 17 00:00:00 2001 From: Ketut Putu Kumajaya Date: Mon, 25 Apr 2016 22:46:06 +0700 Subject: Snap: Support override maker and model exif tag Camera HAL not always return proper values Change-Id: Id81fe40ac84b0ffb70560e55077d90544139e463 --- src/com/android/camera/PhotoModule.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/com') diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 859f42f48..d48557d0c 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1211,6 +1211,21 @@ public class PhotoModule mUI.setSwipingEnabled(true); } + ExifInterface exif = Exif.getExif(jpegData); + boolean overrideMakerAndModelTag = false; + if (mApplicationContext != null) { + overrideMakerAndModelTag = + mApplicationContext.getResources() + .getBoolean(R.bool.override_maker_and_model_tag); + } + + if (overrideMakerAndModelTag) { + ExifTag maker = exif.buildTag(ExifInterface.TAG_MAKE, Build.MANUFACTURER); + exif.setTag(maker); + ExifTag model = exif.buildTag(ExifInterface.TAG_MODEL, Build.MODEL); + exif.setTag(model); + } + mReceivedSnapNum = mReceivedSnapNum + 1; mJpegPictureCallbackTime = System.currentTimeMillis(); if(mSnapshotMode == CameraInfo.CAMERA_SUPPORT_MODE_ZSL) { @@ -1303,7 +1318,6 @@ public class PhotoModule } } if (!mRefocus || (mRefocus && mReceivedSnapNum == 7)) { - ExifInterface exif = Exif.getExif(jpegData); int orientation = Exif.getOrientation(exif); if (!mIsImageCaptureIntent) { // Burst snapshot. Generate new image name. -- cgit v1.2.3