diff options
author | junjiez <junjiez@codeaurora.org> | 2016-11-15 09:28:35 +0800 |
---|---|---|
committer | junjiez <junjiez@codeaurora.org> | 2017-01-06 10:21:50 +0800 |
commit | 9d924d9ca95ece1686a8cdca8c46607078f44618 (patch) | |
tree | eec3b238c191052f858ecfbd90d2c073b2a6a373 /src/com/android/camera/Storage.java | |
parent | 15f6d966c807c371a12f68bf9f5f4e7447a9ba8e (diff) | |
download | android_packages_apps_Snap-9d924d9ca95ece1686a8cdca8c46607078f44618.tar.gz android_packages_apps_Snap-9d924d9ca95ece1686a8cdca8c46607078f44618.tar.bz2 android_packages_apps_Snap-9d924d9ca95ece1686a8cdca8c46607078f44618.zip |
SnapdragonCamera:Add Raw capture to developer option
Add raving as Raw option to the developer options, and
save both JPEG and RAW data when it't turned on
Change-Id: Id2462d0bacc3f2acdf3610b2ca8054079dc40b85
CRs-Fixed: 1087490
Diffstat (limited to 'src/com/android/camera/Storage.java')
-rwxr-xr-x[-rw-r--r--] | src/com/android/camera/Storage.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/camera/Storage.java b/src/com/android/camera/Storage.java index 6239494dc..13f65e14c 100644..100755 --- a/src/com/android/camera/Storage.java +++ b/src/com/android/camera/Storage.java @@ -168,6 +168,18 @@ public class Storage { return insertImage(resolver, values); } + public static long addRawImage(String title, byte[] data, + String mimeType) { + String path = generateFilepath(title, mimeType); + int size = writeFile(path, data, null, mimeType); + // Try to get the real image size after add exif. + File f = new File(path); + if (f.exists() && f.isFile()) { + size = (int) f.length(); + } + return size; + } + // Overwrites the file and updates the MediaStore, or inserts the image if // one does not already exist. public static void updateImage(Uri imageUri, ContentResolver resolver, String title, long date, |