diff options
author | Ketut Putu Kumajaya <ketut.kumajaya@gmail.com> | 2016-04-25 22:46:06 +0700 |
---|---|---|
committer | Ketut Putu Kumajaya <ketut.kumajaya@gmail.com> | 2016-05-01 23:12:38 +0700 |
commit | 35cf43e34c230f2a4cff1d147685c8da026d2b1f (patch) | |
tree | 23ec268258f00b4a1741072bda30cbcc57536649 | |
parent | cd544e6e0ea8c89a9c42f8e81b4a091dd2b0090f (diff) | |
download | android_packages_apps_Snap-35cf43e34c230f2a4cff1d147685c8da026d2b1f.tar.gz android_packages_apps_Snap-35cf43e34c230f2a4cff1d147685c8da026d2b1f.tar.bz2 android_packages_apps_Snap-35cf43e34c230f2a4cff1d147685c8da026d2b1f.zip |
Snap: Support override maker and model exif tag
Camera HAL not always return proper values
Change-Id: Id81fe40ac84b0ffb70560e55077d90544139e463
-rw-r--r-- | res/values/config.xml | 3 | ||||
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index 5676755c1..268475a2e 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -61,4 +61,7 @@ <!-- Enable support for LGE HDR --> <bool name="lge_hdr_mode">false</bool> + + <!-- Set this to true to use device manufacturer and model for exif --> + <bool name="override_maker_and_model_tag">false</bool> </resources> 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. |