Merge branch 'master' into 4.0.x (up to 3.7.0-dev)

Conflicts:
	VERSION
	bin/templates/cordova/version
	framework/src/org/apache/cordova/CordovaWebView.java
	package.json
	test/src/org/apache/cordova/test/basicauth.java
	test/src/org/apache/cordova/test/menus.java
This commit is contained in:
Ian Clelland 2014-09-11 10:16:28 -04:00
commit 51e634ccb4
7 changed files with 210 additions and 36 deletions

View File

@ -20,6 +20,135 @@
--> -->
## Release Notes for Cordova (Android) ## ## Release Notes for Cordova (Android) ##
### 3.6.0 (Sept 2014) ###
* Set VERSION to 3.6.0 (via coho)
* CB-7410 fix the menu test
* CB-7410 Fix the errorUrl test
* CB-7410 Fix Basic Authentication test
* CB-3445: Allow build and run scripts to select APK by architecture
* CB-3445: Add environment variable 'BUILD_MULTIPLE_APKS' for splitting APKs based on architecture
* CB-3445: Ensure that JAR files in libs directory are included
* CB-7267 update RELEASENOTES for 3.5.1
* CB-7410 clarify the title
* CB-7385 update cordova.js for testing prior to branch/tag
* CB-7410 add whitelist entries to get iframe/GoogleMaps working
* CB-7291 propogate change in method signature to the native tests
* CB-7291: Restrict meaning of "\*" in internal whitelist to just http and https
* CB-7291: Only add file, content and data URLs to internal whitelist
* CB-7291: Add defaults to external whitelist
* CB-7291: Add external-launch-whitelist and use it for filtering intent launches
* CB-3445: Read project.properties to configure gradle libraries
* CB-7325 Fix error message in android_sdk_version.js when missing SDK on windows
* CB-7335 Add a .gitignore to android project template
* CB-7330 Fix dangling function call in last commit (broke gradle builds)
* CB-7330 Don't run "android update" during creation
* CB-3445 Add gradle support clean command (plus some code cleanup)
* CB-7044 Fix typo in prev commit causing check_reqs to always fail.
* CB-3445 Copy gradle wrapper in build instead of create
* CB-3445 Add .gradle template files for "update" as well as "create"
* CB-7044 Add JAVA_HOME when not set. Be stricter about ANDROID_HOME
* CB-3445 Speed up gradle building (incremental builds go from 10s -> 1.5s for me)
* CB-3445: android: Copy Gradle wrapper from Android SDK rather than bundling a JAR
* CB-3445: Add which to checked-in node_modules
* CB-3445: Add option to build and install with gradle
* CB-3445: Add an initial set of Gradle build scripts
* CB-7321 Don't require ant for create script
* CB-7044, CB-7299 Fix up PATH problems when possible.
* Change in test's AndroidManifest.xml needed for the test to run properly. Forgot the manifest.
* Change in test's AndroidManifest.xml needed for the test to run properly
* Adding tests related to 3.5.1
* CB-7261 Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT
* CB-7265 Fix crash when navigating to custom protocol (introduced in 3.5.1)
* Filter out non-launchable intents
* Handle unsupported protocol errors in webview better
* CB-7238: I should have collapsed this, but Config.init() must go before the creation of CordovaWebView
* CB-7238: Minor band-aid to get tests running again, this has to go away before 3.6.0 is released, since this is an API change.
* Extend whitelist to handle URLs without // chars
* CB-7172 Force window to have focus after resume
* CB-7159 Set background color of webView as well as its parent
* CB-7018 Fix setButtonPlumbedToJs never un-listening
* Undeprecate some just-deprecated symbols in PluginManager.
* @Deprecate methods of PluginManager that were never meant to be public
* Move plugin instantiation and instance storing logic PluginEntry->PluginManager
* Fix broken unit test due to missing Config.init() call
* Update to check for Google Glass APIs
* Fix for `android` not being in PATH check on Windows
* Displaying error when regex does not match.
* Fix broken compile due to previous commit :(
* Tweak CordovaPlugin.initialize method to be less deprecated.
* Un-deprecate CordovaActivity.init() - it's needed to tweak prefs in onCreate
* Tweak log messages in CordovaBridge with bridgeSecret is wrong
* Backport CordovaBridge from 4.0.x -> master
* Update unit tests to not use most deprecated things (e.g. DroidGap)
* Add non-String overloades for CordovaPreferences.set()
* Make CordovaWebview resilient to init() not being called (for backwards-compatibility)
* Add node_module licenses to LICENSE
* Update cordova.js snapshot to work with bridge changes
* Provide CordovaPlugin with CordovaPreferences. Add new Plugin.initialize()
* Convert usages of Config.\* to use the non-static versions
* Change getProperty -> prefs.get\* within CordovaActivity
* Make CordovaUriHelper class package-private
* Fix PluginManager.setPluginEntries not removing old entries
* Move registration of App plugin from config.xml -> code
* Make setWebViewClient an override instead of an overload. Delete Location-change JS->Native bridge mode (missed some of it).
* CB-4404 Revert setting android:windowSoftInputMode to "adjustPan"
* Refactor: Use ConfigXmlParser in activity. Adds CordovaWebView.init()
* Deprecate some convenience methods on CordovaActivity
* Fix CordovaPreferences not correctly parsing hex values (valueOf->decode)
* Refactor: Move url-filter information into PluginEntry.
* Don't re-parse config.xml in onResume.
* Move handling of Fullscreen preference to CordovaActivity
* Delete dead code from CordovaActivity
* Update .classpath to make Eclipse happy (just re-orders one line)
* Delete "CB-3064: The errorUrl is..." Log message left over from debugging presumably
* Refactor Config into ConfigXmlParser, CordovaPreferences
* Delete Location-change JS->Native bridge mode
* CB-5988 Allow exec() only from file: or start-up URL's domain
* CB-6761 Fix native->JS bridge ceasing to fire when page changes and online is set to false and the JS loads quickly
* Update the errorurl to no longer use intents
* This breaks running the JUnit tests, we'll bring it back soon
* Refactoring the URI handling on Cordova, removing dead code
* CB-7018 Clean up and deprecation of some button-related functions
* CB-7017 Fix onload=true being set on all subsequent plugins
* CB-5971: Fix package / project validation
* CB-5971: Add unit tests to cordova-android
* CB-5971: Factor out package/project name validation logic
* Delete explicit activity.finish() in back button handling. No change in behaviour.
* CB-5971: This would have been a good first bug, too bad
* CB-4404: Changing where android:windowSoftInputMode is in the manifest so it works
* Add documentation referencing other implementation.
* CB-6851 Deprecate WebView.sendJavascript()
* CB-6876 Show the correct executable name
* CB-6876 Fix the "print usage"
* Trivial spelling fix in comments when reading CordovaResourceApi
* CB-6818: I want to remove this code, because Square didn't do their headers properly
* CB-6860 Add activity_name and launcher_name to AndroidManifest.xml & strings.xml
* Add a comment to custom_rules.xml saying why we move AndroidManifest.xml
* Remove +x from README.md
* CB-6784 Add missing licenses
* CB-6784 Add license to CONTRIBUTING.md
* Revert "defaults.xml: Add AndroidLaunchMode preference"
* updated RELEASENOTES
* CB-6315: Wrapping this so it runs on the UI thread
* CB-6723 Update package name for Robotium
* CB-6707 Update minSdkVersion to 10 consistently
* CB-5652 make visible cordova version
* Update JS snapshot to version 3.6.0-dev (via coho)
* Update JS snapshot to version 3.6.0-dev (via coho)
* Set VERSION to 3.6.0-dev (via coho)
### 3.5.1 (August 2014) ###
This was a security update to address CVE-2014-3500, CVE-2014-3501,
and CVE-2014-3502. For more information, see
http://cordova.apache.org/announcements/2014/08/04/android-351.html
* Filter out non-launchable intents
* Handle unsupported protocol errors in webview better
* Update the errorurl to no longer use intents
* Refactoring the URI handling on Cordova, removing dead code
### 3.5.0 (May 2014) ### ### 3.5.0 (May 2014) ###
* OkHttp has broken headers. Updating for ASF compliance. * OkHttp has broken headers. Updating for ASF compliance.

View File

@ -1,5 +1,5 @@
// Platform: android // Platform: android
// 3.6.0-dev-70cdca3 // 3.7.0-dev-8f41e8d
/* /*
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
@ -19,7 +19,7 @@
under the License. under the License.
*/ */
;(function() { ;(function() {
var CORDOVA_JS_BUILD_LABEL = '3.6.0-dev-70cdca3'; var CORDOVA_JS_BUILD_LABEL = '3.7.0-dev-8f41e8d';
// file: src/scripts/require.js // file: src/scripts/require.js
/*jshint -W079 */ /*jshint -W079 */
@ -1497,6 +1497,17 @@ module.exports = {
cordova.addDocumentEventHandler('menubutton'); cordova.addDocumentEventHandler('menubutton');
cordova.addDocumentEventHandler('searchbutton'); cordova.addDocumentEventHandler('searchbutton');
function bindButtonChannel(buttonName) {
// generic button bind used for volumeup/volumedown buttons
var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
volumeButtonChannel.onHasSubscribersChange = function() {
exec(null, null, "App", "overrideButton", [buttonName, this.numHandlers == 1]);
};
}
// Inject a listener for the volume buttons on the document.
bindButtonChannel('volumeup');
bindButtonChannel('volumedown');
// Let native code know we are all done on the JS side. // Let native code know we are all done on the JS side.
// Native code will then un-hide the WebView. // Native code will then un-hide the WebView.
channel.onCordovaReady.subscribe(function() { channel.onCordovaReady.subscribe(function() {
@ -1574,6 +1585,21 @@ module.exports = {
exec(null, null, "App", "overrideBackbutton", [override]); exec(null, null, "App", "overrideBackbutton", [override]);
}, },
/**
* Override the default behavior of the Android volume button.
* If overridden, when the volume button is pressed, the "volume[up|down]button"
* JavaScript event will be fired.
*
* Note: The user should not have to call this method. Instead, when the user
* registers for the "volume[up|down]button" event, this is automatically done.
*
* @param button volumeup, volumedown
* @param override T=override, F=cancel override
*/
overrideButton:function(button, override) {
exec(null, null, "App", "overrideButton", [button, override]);
},
/** /**
* Exit and terminate the application. * Exit and terminate the application.
*/ */
@ -1667,11 +1693,11 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
function findCordovaPath() { function findCordovaPath() {
var path = null; var path = null;
var scripts = document.getElementsByTagName('script'); var scripts = document.getElementsByTagName('script');
var term = 'cordova.js'; var term = '/cordova.js';
for (var n = scripts.length-1; n>-1; n--) { for (var n = scripts.length-1; n>-1; n--) {
var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007). var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
if (src.indexOf(term) == (src.length - term.length)) { if (src.indexOf(term) == (src.length - term.length)) {
path = src.substring(0, src.length - term.length); path = src.substring(0, src.length - term.length) + '/';
break; break;
} }
} }

View File

@ -1,29 +1,29 @@
{ {
"name": "cordova-android", "name": "cordova-android",
"version": "4.0.0-dev", "version": "4.0.0-dev",
"description": "cordova-android release", "description": "cordova-android release",
"main": "bin/create", "main": "bin/create",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git" "url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
}, },
"keywords": [ "keywords": [
"android", "android",
"cordova", "cordova",
"apache" "apache"
], ],
"scripts": { "scripts": {
"test": "jasmine-node --color spec" "test": "jasmine-node --color spec"
}, },
"author": "Apache Software Foundation", "author": "Apache Software Foundation",
"license": "Apache version 2.0", "license": "Apache version 2.0",
"dependencies": { "dependencies": {
"q": "^0.9.0", "q": "^0.9.0",
"shelljs": "^0.2.6", "shelljs": "^0.2.6",
"which": "^1.0.5" "which": "^1.0.5"
}, },
"devDependencies": { "devDependencies": {
"jasmine-node": "~1", "jasmine-node": "~1",
"promise-matchers": "~0" "promise-matchers": "~0"
} }
} }

View File

@ -14,6 +14,25 @@
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License.$ under the License.
--> -->
This is an error page. <!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320, user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Expected Error</title>
<link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="../cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="../main.js"></script>
</head>
<body onload="init();" id="stage" class="theme">
<h1>Expected Error</h1>
<div id="info">
<h4>Cordova: <span id="cordova"> &nbsp;</span></h4>
<h4>Deviceready: <span id="deviceready"> &nbsp;</span></h4>
</div>
<div id="info">
This is an expected error page because the initial href doesn't exist.
</body>
</html>

View File

@ -36,7 +36,7 @@
</head> </head>
<body onload="init();" id="stage" class="theme"> <body onload="init();" id="stage" class="theme">
<h1>Cordova Android Tests</h1> <h1>Cordova Android Native Tests</h1>
<div id="info"> <div id="info">
<h4>Cordova: <span id="cordova"> &nbsp;</span></h4> <h4>Cordova: <span id="cordova"> &nbsp;</span></h4>
<h4>Deviceready: <span id="deviceready"> &nbsp;</span></h4> <h4>Deviceready: <span id="deviceready"> &nbsp;</span></h4>

View File

@ -33,7 +33,7 @@
<h4>Deviceready: <span id="deviceready"> &nbsp;</span></h4> <h4>Deviceready: <span id="deviceready"> &nbsp;</span></h4>
</div> </div>
<div id="info"> <div id="info">
<h4>The menu items should be:</h4> <h4>The options menu items should be:</h4>
<li>Item1<br> <li>Item1<br>
<li>Item2<br> <li>Item2<br>
<li>Item3<br> <li>Item3<br>

View File

@ -18,5 +18,5 @@
under the License. under the License.
--> -->
<resources> <resources>
<string name="app_name">CordovaTests</string> <string name="app_name">CordovaNativeTests</string>
</resources> </resources>