incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [7/7] android commit: Tacked on file extension to camera file
Date Thu, 21 Jun 2012 19:37:01 GMT
Tacked on file extension to camera file


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/66872de8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/66872de8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/66872de8

Branch: refs/heads/master
Commit: 66872de8e53e837b1f5e6472e67e134e9c53eace
Parents: f6d4402
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed Jun 20 14:38:22 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu Jun 21 12:09:50 2012 -0700

----------------------------------------------------------------------
 .../src/org/apache/cordova/CameraLauncher.java     |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/66872de8/framework/src/org/apache/cordova/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java
index d9467fb..0e86d2c 100755
--- a/framework/src/org/apache/cordova/CameraLauncher.java
+++ b/framework/src/org/apache/cordova/CameraLauncher.java
@@ -353,9 +353,10 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
                         }
                         if (!this.saveToPhotoAlbum) {
                             File tempFile = new File(this.imageUri.toString());
-                            Uri jailURI = Uri.fromFile(new File("/data/data/" + this.cordova.getActivity().getPackageName()
+ "/", tempFile.getName()));
+                            Uri jailURI = Uri.fromFile(new File("/data/data/" + this.cordova.getActivity().getPackageName()
+ "/", tempFile.getName() + "." + (this.encodingType == JPEG ? "jpg" : "png" )));
                             
-                            // Clean up initial URI before writing out safe URI
+                            // Clean up initial URI before writing out safe URI.
+                            // First try File-based approach to delete. Then use the media
delete method. Neither seem to work on ICS right now...
                             boolean didWeDeleteIt = tempFile.delete();
                             if (!didWeDeleteIt) {
                                 int result = this.cordova.getActivity().getContentResolver().delete(
@@ -363,7 +364,6 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie
                                     MediaStore.Images.Media.DATA + " = ?",
                                     new String[] { this.imageUri.toString() }
                                 );
-                                LOG.d("TAG!","result is " + result);
                             }
                             this.imageUri = jailURI;
                         }


Mime
View raw message