From ccd4365922789defc39e6b7e2a32a7a2fc534610 Mon Sep 17 00:00:00 2001 From: Davide Bertola Date: Sat, 26 May 2012 08:46:57 +0200 Subject: [PATCH 1/8] Fix calling cordova.plugin.storage.failQuery function from native code --- framework/src/org/apache/cordova/Storage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/Storage.java b/framework/src/org/apache/cordova/Storage.java index 98ec4225..8cc29b7d 100755 --- a/framework/src/org/apache/cordova/Storage.java +++ b/framework/src/org/apache/cordova/Storage.java @@ -175,7 +175,7 @@ public class Storage extends Plugin { System.out.println("Storage.executeSql(): Error=" + ex.getMessage()); // Send error message back to JavaScript - this.sendJavascript("cordova.require('cordova/plugin/android/storage').fail('" + ex.getMessage() + "','" + tx_id + "');"); + this.sendJavascript("cordova.require('cordova/plugin/android/storage').failQuery('" + ex.getMessage() + "','" + tx_id + "');"); } } From b77f1cbff8c28177ce8c0fd1231ac5299a0da6f5 Mon Sep 17 00:00:00 2001 From: Steven Gill Date: Wed, 30 May 2012 00:11:11 +1000 Subject: [PATCH 2/8] updated create script CB 839 --- bin/create | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/create b/bin/create index e7670441..05393fed 100755 --- a/bin/create +++ b/bin/create @@ -41,7 +41,8 @@ android update project --target $TARGET --path ./framework # Use curl to get the jar (TODO: Support Apache Mirrors) curl -OL http://mirror.symnds.com/software/Apache//commons/codec/binaries/commons-codec-1.6-bin.zip unzip commons-codec-1.6-bin.zip -cp commons-codec-1.6/commons-codec-1.6.jar ./framework/libs +mkdir ./framework/libs +cp commons-codec-1.6/commons-codec-1.6.jar ./framework/libs/ # compile cordova.js and cordova.jar cd ./framework && ant jar && cd ../ From 7d0cc5837d8590c3c83a7fb4e3cc3f157606512f Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 29 May 2012 14:34:14 -0700 Subject: [PATCH 3/8] Auto detect whether we have the jar already. Also, just create the directory whether it exists or not --- bin/create | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/create b/bin/create index 05393fed..736fa142 100755 --- a/bin/create +++ b/bin/create @@ -38,11 +38,13 @@ fi # update the cordova-android framework for the desired target android update project --target $TARGET --path ./framework -# Use curl to get the jar (TODO: Support Apache Mirrors) -curl -OL http://mirror.symnds.com/software/Apache//commons/codec/binaries/commons-codec-1.6-bin.zip -unzip commons-codec-1.6-bin.zip -mkdir ./framework/libs -cp commons-codec-1.6/commons-codec-1.6.jar ./framework/libs/ +if [ ! -e ./framework/libs/commons-codec-1.6.jar ]; then + # Use curl to get the jar (TODO: Support Apache Mirrors) + curl -OL http://mirror.symnds.com/software/Apache//commons/codec/binaries/commons-codec-1.6-bin.zip + unzip commons-codec-1.6-bin.zip + mkdir -p ./framework/libs + cp commons-codec-1.6/commons-codec-1.6.jar ./framework/libs/ +fi # compile cordova.js and cordova.jar cd ./framework && ant jar && cd ../ From ca1a322c7697bc2f927f4d14de309bc203a5f6ff Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 29 May 2012 14:58:32 -0700 Subject: [PATCH 4/8] Changing from currentTimeMillis to nanoTime, we need precision on Android 2.3 --- framework/src/org/apache/cordova/AccelListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/AccelListener.java b/framework/src/org/apache/cordova/AccelListener.java index 9e19d753..83a322d6 100755 --- a/framework/src/org/apache/cordova/AccelListener.java +++ b/framework/src/org/apache/cordova/AccelListener.java @@ -223,7 +223,7 @@ public class AccelListener extends Plugin implements SensorEventListener { if (this.accuracy >= SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM) { // Save time that event was received - this.timestamp = System.currentTimeMillis(); + this.timestamp = System.nanoTime(); this.x = event.values[0]; this.y = event.values[1]; this.z = event.values[2]; From d79403e352498df4bf0a8a2dbc8498ba957b5ea4 Mon Sep 17 00:00:00 2001 From: macdonst Date: Tue, 29 May 2012 15:55:21 -0400 Subject: [PATCH 5/8] CB-837: CaptureCB - mediaFile.fullPath does not resolve to file --- framework/src/org/apache/cordova/Capture.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/Capture.java b/framework/src/org/apache/cordova/Capture.java index ce7e9de0..9809ed11 100644 --- a/framework/src/org/apache/cordova/Capture.java +++ b/framework/src/org/apache/cordova/Capture.java @@ -353,7 +353,7 @@ public class Capture extends Plugin { try { // File properties obj.put("name", fp.getName()); - obj.put("fullPath", fp.getAbsolutePath()); + obj.put("fullPath", "file://" + fp.getAbsolutePath()); // Because of an issue with MimeTypeMap.getMimeTypeFromExtension() all .3gpp files // are reported as video/3gpp. I'm doing this hacky check of the URI to see if it From 5f93a26eeada8a257b992a9fc9177eada4c4f343 Mon Sep 17 00:00:00 2001 From: macdonst Date: Wed, 30 May 2012 12:52:25 -0400 Subject: [PATCH 6/8] CB-844: Contact.find does not return urls --- framework/src/org/apache/cordova/ContactAccessorSdk5.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/org/apache/cordova/ContactAccessorSdk5.java b/framework/src/org/apache/cordova/ContactAccessorSdk5.java index 6adcf009..2237e7ee 100644 --- a/framework/src/org/apache/cordova/ContactAccessorSdk5.java +++ b/framework/src/org/apache/cordova/ContactAccessorSdk5.java @@ -437,14 +437,14 @@ public class ContactAccessorSdk5 extends ContactAccessor { contact.put("ims", ims); } if (websites.length() > 0) { - contact.put("websites", websites); + contact.put("urls", websites); } if (photos.length() > 0) { contact.put("photos", photos); } } catch (JSONException e) { - Log.e(LOG_TAG,e.getMessage(),e); + Log.e(LOG_TAG,e.getMessage(),e); } return contact; } From c21e8c9c87feea7d81779f6c12d92de0a0f857f7 Mon Sep 17 00:00:00 2001 From: macdonst Date: Wed, 30 May 2012 21:07:56 -0400 Subject: [PATCH 7/8] CB-849: Cannot search by birthday --- .../org/apache/cordova/ContactAccessor.java | 191 +++++++++--------- .../apache/cordova/ContactAccessorSdk5.java | 27 ++- 2 files changed, 117 insertions(+), 101 deletions(-) diff --git a/framework/src/org/apache/cordova/ContactAccessor.java b/framework/src/org/apache/cordova/ContactAccessor.java index 12669ce4..d2bf66c8 100644 --- a/framework/src/org/apache/cordova/ContactAccessor.java +++ b/framework/src/org/apache/cordova/ContactAccessor.java @@ -18,7 +18,6 @@ package org.apache.cordova; import java.util.HashMap; -import android.app.Activity; import android.content.Context; import android.util.Log; import android.webkit.WebView; @@ -48,21 +47,21 @@ public abstract class ContactAccessor { * @return true if the key data is required */ protected boolean isRequired(String key, HashMap map) { - Boolean retVal = map.get(key); - return (retVal == null) ? false : retVal.booleanValue(); - } + Boolean retVal = map.get(key); + return (retVal == null) ? false : retVal.booleanValue(); + } /** * Create a hash map of what data needs to be populated in the Contact object * @param fields the list of fields to populate * @return the hash map of required data */ - protected HashMap buildPopulationSet(JSONArray fields) { - HashMap map = new HashMap(); + protected HashMap buildPopulationSet(JSONArray fields) { + HashMap map = new HashMap(); - String key; - try { - if (fields.length() == 1 && fields.getString(0).equals("*")) { + String key; + try { + if (fields.length() == 1 && fields.getString(0).equals("*")) { map.put("displayName", true); map.put("name", true); map.put("nickname", true); @@ -76,90 +75,90 @@ public abstract class ContactAccessor { map.put("urls", true); map.put("photos", true); map.put("categories", true); - } - else { - for (int i=0; i Date: Sat, 2 Jun 2012 11:12:12 -0400 Subject: [PATCH 8/8] Change 'websites' to 'urls' --- framework/src/org/apache/cordova/ContactAccessorSdk5.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/ContactAccessorSdk5.java b/framework/src/org/apache/cordova/ContactAccessorSdk5.java index 9e672e93..02047e8c 100644 --- a/framework/src/org/apache/cordova/ContactAccessorSdk5.java +++ b/framework/src/org/apache/cordova/ContactAccessorSdk5.java @@ -1166,7 +1166,7 @@ public class ContactAccessorSdk5 extends ContactAccessor { // Modify urls JSONArray websites = null; try { - websites = contact.getJSONArray("websites"); + websites = contact.getJSONArray("urls"); if (websites != null) { for (int i=0; i