You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2015/05/21 01:11:49 UTC
[1/2] android commit: CB-9042 updated for release 3.7.2
Repository: cordova-android
Updated Branches:
refs/heads/3.7.x a64203f81 -> 86f9b618e
CB-9042 updated for release 3.7.2
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/ec1cc70c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/ec1cc70c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/ec1cc70c
Branch: refs/heads/3.7.x
Commit: ec1cc70c8b90483fc10db5856655f207823f6785
Parents: a64203f
Author: Steve Gill <st...@gmail.com>
Authored: Wed May 20 15:44:14 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Wed May 20 15:44:14 2015 -0700
----------------------------------------------------------------------
VERSION | 2 +-
bin/templates/cordova/version | 2 +-
framework/assets/www/cordova.js | 136 +++++++++----------
.../src/org/apache/cordova/CordovaWebView.java | 2 +-
package.json | 4 +-
5 files changed, 73 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ec1cc70c/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
index a76ccff..0b2eb36 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.7.1
+3.7.2
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ec1cc70c/bin/templates/cordova/version
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version
index 3daf724..3eb0631 100755
--- a/bin/templates/cordova/version
+++ b/bin/templates/cordova/version
@@ -20,6 +20,6 @@
*/
// Coho updates this line:
-var VERSION = "3.7.1";
+var VERSION = "3.7.2";
console.log(VERSION);
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ec1cc70c/framework/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js
index ec9f771..89485c7 100644
--- a/framework/assets/www/cordova.js
+++ b/framework/assets/www/cordova.js
@@ -1,5 +1,5 @@
// Platform: android
-// 24ab6855470f2dc0662624b597c98585e56a1666
+// 23738581906992092a43ad2e643b1e0c43bba38a
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '3.7.1';
+var PLATFORM_VERSION_BUILD_LABEL = '3.7.2';
// file: src/scripts/require.js
/*jshint -W079 */
@@ -101,10 +101,15 @@ if (typeof module === "object" && typeof require === "function") {
// file: src/cordova.js
define("cordova", function(require, exports, module) {
+if(window.cordova){
+ throw new Error("cordova already defined");
+}
+
var channel = require('cordova/channel');
var platform = require('cordova/platform');
+
/**
* Intercept calls to addEventListener + removeEventListener and handle deviceready,
* resume, and pause events.
@@ -323,7 +328,7 @@ module.exports = cordova;
});
-// file: src/android/android/nativeapiprovider.js
+// file: node_modules/cordova-android/cordova-js-src/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) {
/**
@@ -346,7 +351,7 @@ module.exports = {
});
-// file: src/android/android/promptbasednativeapi.js
+// file: node_modules/cordova-android/cordova-js-src/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
@@ -856,7 +861,7 @@ module.exports = channel;
});
-// file: src/android/exec.js
+// file: node_modules/cordova-android/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@@ -900,9 +905,13 @@ var cordova = require('cordova'),
jsToNativeBridgeMode, // Set lazily.
nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
pollEnabled = false,
- messagesFromNative = [],
bridgeSecret = -1;
+var messagesFromNative = [];
+var isProcessing = false;
+var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve();
+var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); };
+
function androidExec(success, fail, service, action, args) {
if (bridgeSecret < 0) {
// If we ever catch this firing, we'll need to queue up exec()s
@@ -931,16 +940,17 @@ function androidExec(success, fail, service, action, args) {
cordova.callbacks[callbackId] = {success:success, fail:fail};
}
- var messages = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
+ var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
// If argsJson was received by Java as null, try again with the PROMPT bridge mode.
// This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
- if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && messages === "@Null arguments.") {
+ if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") {
androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
androidExec(success, fail, service, action, args);
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
- return;
- } else {
- androidExec.processMessages(messages, true);
+ } else if (msgs) {
+ messagesFromNative.push(msgs);
+ // Always process async to avoid exceptions messing up stack.
+ nextTick(processMessages);
}
}
@@ -959,8 +969,12 @@ function pollOnce(opt_fromOnlineEvent) {
// We know there's nothing to retrieve, so no need to poll.
return;
}
- var msg = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
- androidExec.processMessages(msg);
+ var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
+ if (msgs) {
+ messagesFromNative.push(msgs);
+ // Process sync since we know we're already top-of-stack.
+ processMessages();
+ }
}
function pollingTimerFunc() {
@@ -1053,63 +1067,51 @@ function buildPayload(payload, message) {
// Processes a single message, as encoded by NativeToJsMessageQueue.java.
function processMessage(message) {
- try {
- var firstChar = message.charAt(0);
- if (firstChar == 'J') {
- eval(message.slice(1));
- } else if (firstChar == 'S' || firstChar == 'F') {
- var success = firstChar == 'S';
- var keepCallback = message.charAt(1) == '1';
- var spaceIdx = message.indexOf(' ', 2);
- var status = +message.slice(2, spaceIdx);
- var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
- var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
- var payloadMessage = message.slice(nextSpaceIdx + 1);
- var payload = [];
- buildPayload(payload, payloadMessage);
- cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
- } else {
- console.log("processMessage failed: invalid message: " + JSON.stringify(message));
- }
- } catch (e) {
- console.log("processMessage failed: Error: " + e);
- console.log("processMessage failed: Stack: " + e.stack);
- console.log("processMessage failed: Message: " + message);
+ var firstChar = message.charAt(0);
+ if (firstChar == 'J') {
+ // This is deprecated on the .java side. It doesn't work with CSP enabled.
+ eval(message.slice(1));
+ } else if (firstChar == 'S' || firstChar == 'F') {
+ var success = firstChar == 'S';
+ var keepCallback = message.charAt(1) == '1';
+ var spaceIdx = message.indexOf(' ', 2);
+ var status = +message.slice(2, spaceIdx);
+ var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
+ var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
+ var payloadMessage = message.slice(nextSpaceIdx + 1);
+ var payload = [];
+ buildPayload(payload, payloadMessage);
+ cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
+ } else {
+ console.log("processMessage failed: invalid message: " + JSON.stringify(message));
}
}
-var isProcessing = false;
-
-// This is called from the NativeToJsMessageQueue.java.
-androidExec.processMessages = function(messages, opt_useTimeout) {
- if (messages) {
- messagesFromNative.push(messages);
- }
+function processMessages() {
// Check for the reentrant case.
if (isProcessing) {
return;
}
- if (opt_useTimeout) {
- window.setTimeout(androidExec.processMessages, 0);
+ if (messagesFromNative.length === 0) {
return;
}
isProcessing = true;
try {
- // TODO: add setImmediate polyfill and process only one message at a time.
- while (messagesFromNative.length) {
- var msg = popMessageFromQueue();
- // The Java side can send a * message to indicate that it
- // still has messages waiting to be retrieved.
- if (msg == '*' && messagesFromNative.length === 0) {
- setTimeout(pollOnce, 0);
- return;
- }
- processMessage(msg);
+ var msg = popMessageFromQueue();
+ // The Java side can send a * message to indicate that it
+ // still has messages waiting to be retrieved.
+ if (msg == '*' && messagesFromNative.length === 0) {
+ nextTick(pollOnce);
+ return;
}
+ processMessage(msg);
} finally {
isProcessing = false;
+ if (messagesFromNative.length > 0) {
+ nextTick(processMessages);
+ }
}
-};
+}
function popMessageFromQueue() {
var messageBatch = messagesFromNative.shift();
@@ -1502,7 +1504,7 @@ exports.reset();
});
-// file: src/android/platform.js
+// file: node_modules/cordova-android/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1566,9 +1568,6 @@ function onMessageFromNative(msg) {
// App life cycle events
case 'pause':
case 'resume':
- // Keyboard events
- case 'hidekeyboard':
- case 'showkeyboard':
// Volume events
case 'volumedownbutton':
case 'volumeupbutton':
@@ -1581,17 +1580,18 @@ function onMessageFromNative(msg) {
});
-// file: src/android/plugin/android/app.js
+// file: node_modules/cordova-android/cordova-js-src/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec');
+var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
module.exports = {
/**
* Clear the resource cache.
*/
clearCache:function() {
- exec(null, null, "App", "clearCache", []);
+ exec(null, null, APP_PLUGIN_NAME, "clearCache", []);
},
/**
@@ -1609,14 +1609,14 @@ module.exports = {
* navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
*/
loadUrl:function(url, props) {
- exec(null, null, "App", "loadUrl", [url, props]);
+ exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
},
/**
* Cancel loadUrl that is waiting to be loaded.
*/
cancelLoadUrl:function() {
- exec(null, null, "App", "cancelLoadUrl", []);
+ exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []);
},
/**
@@ -1624,7 +1624,7 @@ module.exports = {
* Instead of BACK button loading the previous web page, it will exit the app.
*/
clearHistory:function() {
- exec(null, null, "App", "clearHistory", []);
+ exec(null, null, APP_PLUGIN_NAME, "clearHistory", []);
},
/**
@@ -1632,7 +1632,7 @@ module.exports = {
* This is the same as pressing the backbutton on Android device.
*/
backHistory:function() {
- exec(null, null, "App", "backHistory", []);
+ exec(null, null, APP_PLUGIN_NAME, "backHistory", []);
},
/**
@@ -1645,7 +1645,7 @@ module.exports = {
* @param override T=override, F=cancel override
*/
overrideBackbutton:function(override) {
- exec(null, null, "App", "overrideBackbutton", [override]);
+ exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]);
},
/**
@@ -1660,14 +1660,14 @@ module.exports = {
* @param override T=override, F=cancel override
*/
overrideButton:function(button, override) {
- exec(null, null, "App", "overrideButton", [button, override]);
+ exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]);
},
/**
* Exit and terminate the application.
*/
exitApp:function() {
- return exec(null, null, "App", "exitApp", []);
+ return exec(null, null, APP_PLUGIN_NAME, "exitApp", []);
}
};
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ec1cc70c/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index 741355f..0e9d35d 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -62,7 +62,7 @@ import android.widget.FrameLayout;
public class CordovaWebView extends WebView {
public static final String TAG = "CordovaWebView";
- public static final String CORDOVA_VERSION = "3.7.1";
+ public static final String CORDOVA_VERSION = "3.7.2";
private HashSet<Integer> boundKeyCodes = new HashSet<Integer>();
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/ec1cc70c/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index ba4f243..a2d7722 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-android",
- "version": "3.7.1",
+ "version": "3.7.2",
"description": "cordova-android release",
"main": "bin/create",
"repository": {
@@ -26,4 +26,4 @@
"jasmine-node": "~1",
"promise-matchers": "~0"
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] android commit: CB-9042 updated releasenotes for 3.7.2 release
Posted by st...@apache.org.
CB-9042 updated releasenotes for 3.7.2 release
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/86f9b618
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/86f9b618
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/86f9b618
Branch: refs/heads/3.7.x
Commit: 86f9b618ef8919be10b7228f900f57a42f5c6ad6
Parents: ec1cc70
Author: Steve Gill <st...@gmail.com>
Authored: Wed May 20 16:11:41 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Wed May 20 16:11:41 2015 -0700
----------------------------------------------------------------------
RELEASENOTES.md | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/86f9b618/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index f636c0f..304403b 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,6 +20,10 @@
-->
## Release Notes for Cordova (Android) ##
+### Release 3.7.2 (May 2015) ###
+
+* Removed Intent Functionality from Preferences - Preferences can no longer be set by intents
+
### Release 3.7.1 (January 2015) ###
* CB-8411 Initialize plugins only after `createViews()` is called (regression in 3.7.0)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org