You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/07/03 19:25:09 UTC

git commit: CB-7071 android: Fix callback firing before CROP intent is sent when allowEdit=true

Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master f20703de2 -> e4ab155fd


CB-7071 android: Fix callback firing before CROP intent is sent when allowEdit=true


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/e4ab155f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/e4ab155f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/e4ab155f

Branch: refs/heads/master
Commit: e4ab155fd097381151357b64e69a1e6f40b076a5
Parents: f20703d
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jul 3 13:21:52 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jul 3 13:21:52 2014 -0400

----------------------------------------------------------------------
 src/android/CameraLauncher.java | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/e4ab155f/src/android/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java
index 64d185b..7196fcf 100644
--- a/src/android/CameraLauncher.java
+++ b/src/android/CameraLauncher.java
@@ -425,14 +425,14 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
                     exif.writeExifData();
                 }
                 if (this.allowEdit) {
-          performCrop(uri);
-        } else {
-          // Send Uri back to JavaScript for viewing image
-          this.callbackContext.success(uri.toString());
-        }
+                    performCrop(uri);
+                } else {
+                    // Send Uri back to JavaScript for viewing image
+                    this.callbackContext.success(uri.toString());
+                }
             }
-            // Send Uri back to JavaScript for viewing image
-            this.callbackContext.success(uri.toString());
+        } else {
+            throw new IllegalStateException();
         }
 
         this.cleanup(FILE_URI, this.imageUri, uri, bitmap);