You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/09/04 20:34:20 UTC
[1/2] git commit: CB-4633: We really should close cursors. It's just
the right thing to do.
Updated Branches:
refs/heads/dev 382e9421e -> f33e00083
CB-4633: We really should close cursors. It's just the right thing to do.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/f33e0008
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/f33e0008
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/f33e0008
Branch: refs/heads/dev
Commit: f33e00083a853594c5ea0154ae339b87eb677454
Parents: 118ca18
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Sep 4 11:33:35 2013 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Sep 4 11:34:13 2013 -0700
----------------------------------------------------------------------
src/android/CameraLauncher.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/f33e0008/src/android/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index 02a9211..7f2f20f 100755
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -749,6 +749,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
}
Uri uri = Uri.parse(contentStore + "/" + id);
this.cordova.getActivity().getContentResolver().delete(uri, null, null);
+ cursor.close();
}
}
[2/2] git commit: No longer causes a stack trace,
but it doesn't cause the error to be called.
Posted by bo...@apache.org.
No longer causes a stack trace, but it doesn't cause the error to be called.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/118ca18d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/118ca18d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/118ca18d
Branch: refs/heads/dev
Commit: 118ca18d5a7d77dfe37c5c9a85350a7890448de9
Parents: 382e942
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Aug 21 15:39:43 2013 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Sep 4 11:34:13 2013 -0700
----------------------------------------------------------------------
src/android/CameraLauncher.java | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/118ca18d/src/android/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index ba432cb..02a9211 100755
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -76,7 +76,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
private static final String GET_PICTURE = "Get Picture";
private static final String GET_VIDEO = "Get Video";
private static final String GET_All = "Get All";
-
+
private static final String LOG_TAG = "CameraLauncher";
private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
@@ -153,15 +153,26 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
this.targetHeight = -1;
}
- if (srcType == CAMERA) {
- this.takePicture(destType, encodingType);
+ try {
+ if (srcType == CAMERA) {
+ this.takePicture(destType, encodingType);
+ }
+ else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
+ this.getImage(srcType, destType);
+ }
}
- else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
- this.getImage(srcType, destType);
+ catch (IllegalArgumentException e)
+ {
+ callbackContext.error("Illegal Argument Exception");
+ PluginResult r = new PluginResult(PluginResult.Status.ERROR);
+ callbackContext.sendPluginResult(r);
+ return true;
}
+
PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
r.setKeepCallback(true);
callbackContext.sendPluginResult(r);
+
return true;
}
return false;