You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by na...@apache.org on 2014/12/22 16:52:58 UTC
[01/12] cordova-amazon-fireos git commit: CB-8112 Turn off
mediaPlaybackRequiresUserGesture
Repository: cordova-amazon-fireos
Updated Branches:
refs/heads/master b84610a6c -> 24d21700d
CB-8112 Turn off mediaPlaybackRequiresUserGesture
Conflicts:
framework/src/org/apache/cordova/CordovaWebView.java
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/b8dcd4e6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/b8dcd4e6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/b8dcd4e6
Branch: refs/heads/master
Commit: b8dcd4e647fdfb0f21d3ebb77ea333b3f3d26720
Parents: b84610a
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 3 10:04:54 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 18:38:51 2014 +0000
----------------------------------------------------------------------
.../src/org/apache/cordova/CordovaWebView.java | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/b8dcd4e6/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 bf16362..df56a48 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -279,9 +279,12 @@ public class CordovaWebView extends AmazonWebView {
// Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
// while we do this
- if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN
|| (getWebViewBackend(this.cordova.getFactory()) == WebViewBackend.CHROMIUM))
Level16Apis.enableUniversalAccess(settings);
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ Level17Apis.setMediaPlaybackRequiresUserGesture(settings, false);
+ }
String databasePath = getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
if (getWebViewBackend(this.cordova.getFactory()) == WebViewBackend.ANDROID) {
@@ -294,7 +297,7 @@ public class CordovaWebView extends AmazonWebView {
// shouldn't get here...
Log.e(TAG, "Unable to construct application cache directory, feature disabled");
}
- // Enable database
+ // Enable database
// We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
settings.setDatabaseEnabled(true);
settings.setDatabasePath(databasePath);
@@ -965,7 +968,14 @@ public class CordovaWebView extends AmazonWebView {
settings.setAllowUniversalAccessFromFileURLs(true);
}
}
-
+
+ @TargetApi(17)
+ private static final class Level17Apis {
+ static void setMediaPlaybackRequiresUserGesture(AmazonWebSettings settings, boolean value) {
+ settings.setMediaPlaybackRequiresUserGesture(value);
+ }
+ }
+
public void printBackForwardList() {
AmazonWebBackForwardList currentList = this.copyBackForwardList();
int currentSize = currentList.getSize();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[11/12] cordova-amazon-fireos git commit: Fix syntax error in
3aca14d53068
Posted by na...@apache.org.
Fix syntax error in 3aca14d53068
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/f36ebacd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/f36ebacd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/f36ebacd
Branch: refs/heads/master
Commit: f36ebacd2de06bd61bae9bd1c53c08a0fa942db0
Parents: 06b3ee5
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 21:16:18 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:09:26 2014 +0000
----------------------------------------------------------------------
bin/templates/cordova/lib/build.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f36ebacd/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 3dc3b3d..461af3b 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -348,10 +348,10 @@ function parseOpts(options, resolvedTarget) {
ret.buildMethod = 'none';
break;
default :
- console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
+ console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).');
}
} else {
- console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
+ console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).');
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[12/12] cordova-amazon-fireos git commit: CB-8079 Use activity class
package name,
but fallback to application package name when looking for splash screen
drawable
Posted by na...@apache.org.
CB-8079 Use activity class package name, but fallback to application
package name when looking for splash screen drawable
Close #136
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/24d21700
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/24d21700
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/24d21700
Branch: refs/heads/master
Commit: 24d21700d662c47f9fed6fab1162b37ba1ac5f8c
Parents: f36ebac
Author: Daniel Toplak <d....@cadenas.de>
Authored: Wed Nov 26 08:31:45 2014 +0100
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:13:47 2014 +0000
----------------------------------------------------------------------
framework/src/org/apache/cordova/CordovaPreferences.java | 3 +++
framework/src/org/apache/cordova/SplashScreenInternal.java | 3 +++
2 files changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/24d21700/framework/src/org/apache/cordova/CordovaPreferences.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaPreferences.java b/framework/src/org/apache/cordova/CordovaPreferences.java
index 536f25a..ed0b9b8 100644
--- a/framework/src/org/apache/cordova/CordovaPreferences.java
+++ b/framework/src/org/apache/cordova/CordovaPreferences.java
@@ -133,6 +133,9 @@ public class CordovaPreferences {
} else if (name.equals("splashscreen")) {
// Note: We should probably pass in the classname for the variable splash on splashscreen!
int resource = action.getResources().getIdentifier(value, "drawable", action.getClass().getPackage().getName());
+ if(resource == 0) {
+ resource = action.getResources().getIdentifier(value, "drawable", action.getPackageName());
+ }
action.getIntent().putExtra(name, resource);
}
else if(name.equals("backgroundcolor")) {
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/24d21700/framework/src/org/apache/cordova/SplashScreenInternal.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/SplashScreenInternal.java b/framework/src/org/apache/cordova/SplashScreenInternal.java
index 605fce7..715e418 100644
--- a/framework/src/org/apache/cordova/SplashScreenInternal.java
+++ b/framework/src/org/apache/cordova/SplashScreenInternal.java
@@ -54,6 +54,9 @@ public class SplashScreenInternal extends CordovaPlugin {
String splashResource = preferences.getString("SplashScreen", null);
if (splashResource != null) {
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
+ if (drawableId == 0) {
+ drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getPackageName());
+ }
preferences.set("SplashDrawableId", drawableId);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[07/12] cordova-amazon-fireos git commit: CB-7881 Android tooling
shouldn't lock application directory
Posted by na...@apache.org.
CB-7881 Android tooling shouldn't lock application directory
Close #130
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/0ed7d273
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/0ed7d273
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/0ed7d273
Branch: refs/heads/master
Commit: 0ed7d2735298378480b670a1e4658a0bf73331d5
Parents: df49aca
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Oct 27 17:14:35 2014 +0300
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:02:24 2014 +0000
----------------------------------------------------------------------
bin/templates/cordova/lib/build.js | 3 ++-
bin/templates/cordova/lib/device.js | 9 +++++----
bin/templates/cordova/lib/emulator.js | 15 ++++++++-------
bin/templates/cordova/lib/log.js | 3 ++-
4 files changed, 17 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/0ed7d273/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index fead206..7bc20f6 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -24,6 +24,7 @@ var shell = require('shelljs'),
Q = require('q'),
path = require('path'),
fs = require('fs'),
+ os = require('os'),
ROOT = path.join(__dirname, '..', '..');
var check_reqs = require('./check_reqs');
var exec = require('./exec');
@@ -400,7 +401,7 @@ module.exports.run = function(options, optResolvedTarget) {
*/
module.exports.detectArchitecture = function(target) {
function helper() {
- return exec('adb -s ' + target + ' shell cat /proc/cpuinfo')
+ return exec('adb -s ' + target + ' shell cat /proc/cpuinfo', os.tmpdir())
.then(function(output) {
if (/intel/i.exec(output)) {
return 'x86';
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/0ed7d273/bin/templates/cordova/lib/device.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/device.js b/bin/templates/cordova/lib/device.js
index 6430d73..9516ba4 100644
--- a/bin/templates/cordova/lib/device.js
+++ b/bin/templates/cordova/lib/device.js
@@ -22,6 +22,7 @@
var exec = require('./exec'),
Q = require('q'),
path = require('path'),
+ os = require('os'),
build = require('./build'),
appinfo = require('./appinfo'),
ROOT = path.join(__dirname, '..', '..');
@@ -32,7 +33,7 @@ var exec = require('./exec'),
*/
module.exports.list = function(lookHarder) {
function helper() {
- return exec('adb devices')
+ return exec('adb devices', os.tmpdir())
.then(function(output) {
var response = output.split('\n');
var device_list = [];
@@ -100,19 +101,19 @@ module.exports.install = function(target, buildResults) {
console.log('Using apk: ' + apk_path);
console.log('Installing app on device...');
var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
- return exec(cmd)
+ return exec(cmd, os.tmpdir())
.then(function(output) {
if (output.match(/Failure/)) return Q.reject('ERROR: Failed to install apk to device: ' + output);
//unlock screen
var cmd = 'adb -s ' + resolvedTarget.target + ' shell input keyevent 82';
- return exec(cmd);
+ return exec(cmd, os.tmpdir());
}, function(err) { return Q.reject('ERROR: Failed to install apk to device: ' + err); })
.then(function() {
// launch the application
console.log('Launching application...');
var cmd = 'adb -s ' + resolvedTarget.target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
- return exec(cmd);
+ return exec(cmd, os.tmpdir());
}).then(function() {
console.log('LAUNCH SUCCESS');
}, function(err) {
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/0ed7d273/bin/templates/cordova/lib/emulator.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js
index 8cf58e2..70e0305 100644
--- a/bin/templates/cordova/lib/emulator.js
+++ b/bin/templates/cordova/lib/emulator.js
@@ -23,6 +23,7 @@ var shell = require('shelljs'),
exec = require('./exec'),
Q = require('q'),
path = require('path'),
+ os = require('os'),
appinfo = require('./appinfo'),
build = require('./build'),
ROOT = path.join(__dirname, '..', '..'),
@@ -108,7 +109,7 @@ module.exports.best_image = function() {
// Returns a promise.
module.exports.list_started = function() {
- return exec('adb devices')
+ return exec('adb devices', os.tmpdir())
.then(function(output) {
var response = output.split('\n');
var started_emulator_list = [];
@@ -123,7 +124,7 @@ module.exports.list_started = function() {
// Returns a promise.
module.exports.list_targets = function() {
- return exec('android list targets')
+ return exec('android list targets', os.tmpdir())
.then(function(output) {
var target_out = output.split('\n');
var targets = [];
@@ -201,7 +202,7 @@ module.exports.start = function(emulator_ID) {
console.log('BOOT COMPLETE');
//unlock screen
- return exec('adb -s ' + emulator_id + ' shell input keyevent 82');
+ return exec('adb -s ' + emulator_id + ' shell input keyevent 82', os.tmpdir());
}).then(function() {
//return the new emulator id for the started emulators
return emulator_id;
@@ -231,7 +232,7 @@ module.exports.wait_for_emulator = function(num_running) {
*/
module.exports.wait_for_boot = function(emulator_id) {
var self = this;
- return exec('adb -s ' + emulator_id + ' shell getprop init.svc.bootanim')
+ return exec('adb -s ' + emulator_id + ' shell getprop init.svc.bootanim', os.tmpdir())
.then(function(output) {
if (output.match(/stopped/)) {
return;
@@ -309,7 +310,7 @@ module.exports.install = function(target, buildResults) {
var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
console.log('Installing app on emulator...');
console.log('Using apk: ' + apk_path);
- return exec('adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"')
+ return exec('adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"', os.tmpdir())
.then(function(output) {
if (output.match(/Failure/)) {
return Q.reject('Failed to install apk to emulator: ' + output);
@@ -319,13 +320,13 @@ module.exports.install = function(target, buildResults) {
return Q.reject('Failed to install apk to emulator: ' + err);
}).then(function() {
//unlock screen
- return exec('adb -s ' + resolvedTarget.target + ' shell input keyevent 82');
+ return exec('adb -s ' + resolvedTarget.target + ' shell input keyevent 82', os.tmpdir());
}).then(function() {
// launch the application
console.log('Launching application...');
var launchName = appinfo.getActivityName();
cmd = 'adb -s ' + resolvedTarget.target + ' shell am start -W -a android.intent.action.MAIN -n ' + launchName;
- return exec(cmd);
+ return exec(cmd, os.tmpdir());
}).then(function(output) {
console.log('LAUNCH SUCCESS');
}, function(err) {
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/0ed7d273/bin/templates/cordova/lib/log.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/log.js b/bin/templates/cordova/lib/log.js
index 329dfc9..d61023e 100644
--- a/bin/templates/cordova/lib/log.js
+++ b/bin/templates/cordova/lib/log.js
@@ -21,6 +21,7 @@
var shell = require('shelljs'),
path = require('path'),
+ os = require('os'),
Q = require('q'),
child_process = require('child_process'),
ROOT = path.join(__dirname, '..', '..');
@@ -32,7 +33,7 @@ var shell = require('shelljs'),
module.exports.run = function() {
var cmd = 'adb logcat | grep -v nativeGetEnabledTags';
var d = Q.defer();
- var adb = child_process.spawn('adb', ['logcat']);
+ var adb = child_process.spawn('adb', ['logcat'], {cwd: os.tmpdir()});
adb.stdout.on('data', function(data) {
var lines = data ? data.toString().split('\n') : [];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[03/12] cordova-amazon-fireos git commit: Revert Gradle
distributionUrlRegex cleanup.
Posted by na...@apache.org.
Revert Gradle distributionUrlRegex cleanup.
This reverts commit 75a0a6752a77e2e0f491ae4de7137f5163c7a4bd.
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/b409290b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/b409290b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/b409290b
Branch: refs/heads/master
Commit: b409290b1d1cd7a4dea61c1835dbf708b7f4e964
Parents: 251130b
Author: Brian Geppert <br...@briangeppert.com>
Authored: Tue Dec 9 11:57:29 2014 -0600
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 18:50:13 2014 +0000
----------------------------------------------------------------------
bin/templates/cordova/lib/build.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/b409290b/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 0d4d004..fead206 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -239,7 +239,8 @@ var builders = {
// If the gradle distribution URL is set, make sure it points to version 1.12.
// If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
- var distributionUrlRegex = '/^distributionUrl=.*$/';
+ // For some reason, using ^ and $ don't work. This does the job, though.
+ var distributionUrlRegex = /distributionUrl.*zip/;
var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-1.12-all.zip';
var gradleWrapperPropertiesPath = path.join(projectPath, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.sed('-i', distributionUrlRegex, distributionUrl, gradleWrapperPropertiesPath);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[05/12] cordova-amazon-fireos git commit: CB-3679 Move splashscreen
logic into splashscreen plugin
Posted by na...@apache.org.
CB-3679 Move splashscreen logic into splashscreen plugin
Tried as hard as possible for this not to be a breaking change (all
symbols were preserved). Planning to remove delegating symbols in 4.0.x
though.
Also for backwards compatability - a copy of the plugin is bundled. It
will likewise be removed in 4.0.x
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/585db69f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/585db69f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/585db69f
Branch: refs/heads/master
Commit: 585db69f6bf3baa2906805421208bdf4c8e29299
Parents: 87602e3
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Nov 17 23:46:39 2014 -0800
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 18:59:22 2014 +0000
----------------------------------------------------------------------
.../src/org/apache/cordova/CordovaActivity.java | 198 +++------------
.../src/org/apache/cordova/CordovaWebView.java | 11 +-
.../apache/cordova/SplashScreenInternal.java | 252 +++++++++++++++++++
3 files changed, 296 insertions(+), 165 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/585db69f/framework/src/org/apache/cordova/CordovaActivity.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java
index 9d5e1c8..1534b79 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -24,17 +24,13 @@ import java.util.Locale;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import org.apache.cordova.CordovaInterface;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.LOG;
+import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -45,7 +41,6 @@ import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle;
-import android.os.Handler;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
@@ -105,7 +100,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
@Deprecated // Will be removed. Use findViewById() to retrieve views.
protected LinearLayout root;
- protected ProgressDialog spinnerDialog = null;
private final ExecutorService threadPool = Executors.newCachedThreadPool();
private static int ACTIVITY_STARTING = 0;
@@ -122,9 +116,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
*/
// Draw a splash screen using an image located in the drawable resource directory.
- // This is not the same as calling super.loadSplashscreen(url)
+ @Deprecated // Use "SplashScreen" preference instead.
protected int splashscreen = 0;
- protected int splashscreenTime = 3000;
+ @Deprecated // Use "SplashScreenDelay" preference instead.
+ protected int splashscreenTime = -1;
// LoadUrl timeout value in msec (default of 20 sec)
protected int loadUrlTimeoutValue = 20000;
@@ -283,9 +278,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
ViewGroup.LayoutParams.MATCH_PARENT,
1.0F));
- // Add web view but make it invisible while loading URL
- appView.setVisibility(View.INVISIBLE);
-
// need to remove appView from any existing parent before invoking root.addView(appView)
ViewParent parent = appView.getParent();
if ((parent != null) && (parent != root)) {
@@ -425,6 +417,13 @@ public class CordovaActivity extends Activity implements CordovaInterface {
public void init(CordovaWebView webView, CordovaWebViewClient webViewClient, CordovaChromeClient webChromeClient) {
LOG.d(TAG, "CordovaActivity.init()");
+ if (splashscreenTime >= 0) {
+ preferences.set("SplashScreenDelay", splashscreenTime);
+ }
+ if (splashscreen != 0) {
+ preferences.set("SplashDrawableId", splashscreen);
+ }
+
appView = webView != null ? webView : makeWebView();
if (appView.pluginManager == null) {
appView.init(this, webViewClient != null ? webViewClient : makeWebViewClient(appView),
@@ -461,36 +460,10 @@ public class CordovaActivity extends Activity implements CordovaInterface {
if (appView == null) {
init();
}
- this.splashscreenTime = preferences.getInteger("SplashScreenDelay", this.splashscreenTime);
- String splash = preferences.getString("SplashScreen", null);
- if(this.splashscreenTime > 0 && splash != null)
- {
- this.splashscreen = getResources().getIdentifier(splash, "drawable", getClass().getPackage().getName());;
- if(this.splashscreen != 0)
- {
- this.showSplashScreen(this.splashscreenTime);
- }
- }
-
// If keepRunning
this.keepRunning = preferences.getBoolean("KeepRunning", true);
- //Check if the view is attached to anything
- if(appView.getParent() != null)
- {
- // Then load the spinner
- this.loadSpinner();
- }
- //Load the correct splashscreen
-
- if(this.splashscreen != 0)
- {
- this.appView.loadUrl(url, this.splashscreenTime);
- }
- else
- {
- this.appView.loadUrl(url);
- }
+ appView.loadUrlIntoView(url, true);
}
/**
@@ -500,44 +473,12 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* @param url
* @param time The number of ms to wait before loading webview
*/
+ @Deprecated // Use loadUrl(String url) instead.
public void loadUrl(final String url, int time) {
this.splashscreenTime = time;
this.loadUrl(url);
}
-
- /*
- * Load the spinner
- */
- void loadSpinner() {
-
- // If loadingDialog property, then show the App loading dialog for first page of app
- String loading = null;
- if ((this.appView == null) || !this.appView.canGoBack()) {
- loading = preferences.getString("LoadingDialog", null);
- }
- else {
- loading = preferences.getString("LoadingPageDialog", null);
- }
- if (loading != null) {
-
- String title = "";
- String message = "Loading Application...";
-
- if (loading.length() > 0) {
- int comma = loading.indexOf(',');
- if (comma > 0) {
- title = loading.substring(0, comma);
- message = loading.substring(comma + 1);
- }
- else {
- title = "";
- message = loading;
- }
- }
- this.spinnerStart(title, message);
- }
- }
@Deprecated
public void cancelLoadUrl() {
@@ -701,9 +642,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
{
this.appView.handlePause(this.keepRunning);
}
-
- // hide the splash screen to avoid leaking a window
- this.removeSplashScreen();
}
/**
@@ -758,9 +696,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
LOG.d(TAG, "CordovaActivity.onDestroy()");
super.onDestroy();
- // hide the splash screen to avoid leaking a window
- this.removeSplashScreen();
-
if (this.appView != null) {
appView.handleDestroy();
}
@@ -810,28 +745,20 @@ public class CordovaActivity extends Activity implements CordovaInterface {
* @param title Title of the dialog
* @param message The message of the dialog
*/
+ @Deprecated // Call this directly on SplashScreen plugin instead.
public void spinnerStart(final String title, final String message) {
- if (this.spinnerDialog != null) {
- this.spinnerDialog.dismiss();
- this.spinnerDialog = null;
- }
- final CordovaActivity me = this;
- this.spinnerDialog = ProgressDialog.show(CordovaActivity.this, title, message, true, true,
- new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- me.spinnerDialog = null;
- }
- });
+ JSONArray args = new JSONArray();
+ args.put(title);
+ args.put(message);
+ doSplashScreenAction("spinnerStart", args);
}
/**
* Stop spinner - Must be called from UI thread
*/
+ @Deprecated // Call this directly on SplashScreen plugin instead.
public void spinnerStop() {
- if (this.spinnerDialog != null && this.spinnerDialog.isShowing()) {
- this.spinnerDialog.dismiss();
- this.spinnerDialog = null;
- }
+ doSplashScreenAction("spinnerStop", null);
}
/**
@@ -923,8 +850,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
// Load URL on UI thread
me.runOnUiThread(new Runnable() {
public void run() {
- // Stop "app loading" spinner if showing
- me.spinnerStop();
me.appView.showWebPage(errorUrl, false, true, null);
}
});
@@ -1028,62 +953,34 @@ public class CordovaActivity extends Activity implements CordovaInterface {
}
}
- protected Dialog splashDialog;
+ private void doSplashScreenAction(String action, JSONArray args) {
+ CordovaPlugin p = appView.pluginManager.getPlugin("org.apache.cordova.splashscreeninternal");
+ if (p != null) {
+ args = args == null ? new JSONArray() : args;
+ try {
+ p.execute(action, args, null);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ }
+ }
/**
* Removes the Dialog that displays the splash screen
*/
+ @Deprecated
public void removeSplashScreen() {
- if (splashDialog != null && splashDialog.isShowing()) {
- splashDialog.dismiss();
- splashDialog = null;
- }
+ doSplashScreenAction("hide", null);
}
/**
* Shows the splash screen over the full Activity
*/
@SuppressWarnings("deprecation")
+ @Deprecated
protected void showSplashScreen(final int time) {
- final CordovaActivity that = this;
-
- Runnable runnable = new Runnable() {
- public void run() {
- // Get reference to display
- Display display = getWindowManager().getDefaultDisplay();
-
- // Create the layout for the dialog
- LinearLayout root = new LinearLayout(that.getActivity());
- root.setMinimumHeight(display.getHeight());
- root.setMinimumWidth(display.getWidth());
- root.setOrientation(LinearLayout.VERTICAL);
- root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
- root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
- root.setBackgroundResource(that.splashscreen);
-
- // Create and show the dialog
- splashDialog = new Dialog(that, android.R.style.Theme_Translucent_NoTitleBar);
- // check to see if the splash screen should be full screen
- if ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
- == WindowManager.LayoutParams.FLAG_FULLSCREEN) {
- splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
- splashDialog.setContentView(root);
- splashDialog.setCancelable(false);
- splashDialog.show();
-
- // Set Runnable to remove splash screen just in case
- final Handler handler = new Handler();
- handler.postDelayed(new Runnable() {
- public void run() {
- removeSplashScreen();
- }
- }, time);
- }
- };
- this.runOnUiThread(runnable);
+ preferences.set("SplashScreenDelay", time);
+ doSplashScreenAction("show", null);
}
/*
@@ -1142,28 +1039,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
LOG.d(TAG, "onMessage(" + id + "," + data + ")");
}
- if ("splashscreen".equals(id)) {
- if ("hide".equals(data.toString())) {
- this.removeSplashScreen();
- }
- else {
- // If the splash dialog is showing don't try to show it again
- if (this.splashDialog == null || !this.splashDialog.isShowing()) {
- String splashResource = preferences.getString("SplashScreen", null);
- if (splashResource != null) {
- splashscreen = getResources().getIdentifier(splashResource, "drawable", getClass().getPackage().getName());
- }
- this.showSplashScreen(this.splashscreenTime);
- }
- }
- }
- else if ("spinner".equals(id)) {
- if ("stop".equals(data.toString())) {
- this.spinnerStop();
- this.appView.setVisibility(View.VISIBLE);
- }
- }
- else if ("onReceivedError".equals(id)) {
+ if ("onReceivedError".equals(id)) {
JSONObject d = (JSONObject) data;
try {
this.onReceivedError(d.getInt("errorCode"), d.getString("description"), d.getString("url"));
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/585db69f/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 df56a48..c0e4cc7 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -221,6 +221,9 @@ public class CordovaWebView extends AmazonWebView {
resourceApi = new CordovaResourceApi(this.getContext(), pluginManager);
pluginManager.addService("App", "org.apache.cordova.App");
+ // This will be removed in 4.0.x in favour of the plugin not being bundled.
+ pluginManager.addService(new PluginEntry("SplashScreenInternal", "org.apache.cordova.SplashScreenInternal", true));
+ pluginManager.init();
initWebViewSettings();
exposeJsInterface();
}
@@ -493,8 +496,11 @@ public class CordovaWebView extends AmazonWebView {
initIfNecessary();
if (recreatePlugins) {
+ // Don't re-initialize on first load.
+ if (loadedUrl != null) {
+ this.pluginManager.init();
+ }
this.loadedUrl = url;
- this.pluginManager.init();
}
// Got rid of the timers logic to check for errors/non-responding webpages.
@@ -540,9 +546,6 @@ public class CordovaWebView extends AmazonWebView {
else {
LOG.d(TAG, "loadUrlIntoView(%s, %d)", url, time);
-
- // Send message to show splashscreen now if desired
- this.postMessage("splashscreen", "show");
}
// Load url
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/585db69f/framework/src/org/apache/cordova/SplashScreenInternal.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/SplashScreenInternal.java b/framework/src/org/apache/cordova/SplashScreenInternal.java
new file mode 100644
index 0000000..605fce7
--- /dev/null
+++ b/framework/src/org/apache/cordova/SplashScreenInternal.java
@@ -0,0 +1,252 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+package org.apache.cordova;
+
+import android.app.Dialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Color;
+import android.os.Handler;
+import android.view.Display;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.LinearLayout;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+
+// This file is a copy of SplashScreen.java from cordova-plugin-splashscreen, and is required only
+// for pre-4.0 Cordova as a transition path to it being extracted into the plugin.
+public class SplashScreenInternal extends CordovaPlugin {
+ private static final String LOG_TAG = "SplashScreenInternal";
+ private static Dialog splashDialog;
+ private static ProgressDialog spinnerDialog;
+ private static boolean firstShow = true;
+
+ @Override
+ protected void pluginInitialize() {
+ if (!firstShow) {
+ return;
+ }
+ // Make WebView invisible while loading URL
+ webView.setVisibility(View.INVISIBLE);
+ int drawableId = preferences.getInteger("SplashDrawableId", 0);
+ if (drawableId == 0) {
+ String splashResource = preferences.getString("SplashScreen", null);
+ if (splashResource != null) {
+ drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
+ preferences.set("SplashDrawableId", drawableId);
+ }
+ }
+
+ firstShow = false;
+ loadSpinner();
+ showSplashScreen();
+ }
+
+ @Override
+ public void onPause(boolean multitasking) {
+ // hide the splash screen to avoid leaking a window
+ this.removeSplashScreen();
+ }
+
+ @Override
+ public void onDestroy() {
+ // hide the splash screen to avoid leaking a window
+ this.removeSplashScreen();
+ firstShow = true;
+ }
+
+ @Override
+ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+ if (action.equals("hide")) {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ webView.postMessage("splashscreen", "hide");
+ }
+ });
+ } else if (action.equals("show")) {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ webView.postMessage("splashscreen", "show");
+ }
+ });
+ } else if (action.equals("spinnerStart")) {
+ final String title = args.getString(0);
+ final String message = args.getString(1);
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ spinnerStart(title, message);
+ }
+ });
+ } else {
+ return false;
+ }
+
+ callbackContext.success();
+ return true;
+ }
+
+ @Override
+ public Object onMessage(String id, Object data) {
+ if ("splashscreen".equals(id)) {
+ if ("hide".equals(data.toString())) {
+ this.removeSplashScreen();
+ } else {
+ this.showSplashScreen();
+ }
+ } else if ("spinner".equals(id)) {
+ if ("stop".equals(data.toString())) {
+ this.spinnerStop();
+ webView.setVisibility(View.VISIBLE);
+ }
+ } else if ("onReceivedError".equals(id)) {
+ spinnerStop();
+ }
+ return null;
+ }
+
+ private void removeSplashScreen() {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ if (splashDialog != null && splashDialog.isShowing()) {
+ splashDialog.dismiss();
+ splashDialog = null;
+ }
+ }
+ });
+ }
+
+ /**
+ * Shows the splash screen over the full Activity
+ */
+ @SuppressWarnings("deprecation")
+ private void showSplashScreen() {
+ final int splashscreenTime = preferences.getInteger("SplashScreenDelay", 3000);
+ final int drawableId = preferences.getInteger("SplashDrawableId", 0);
+
+ // If the splash dialog is showing don't try to show it again
+ if (this.splashDialog != null && splashDialog.isShowing()) {
+ return;
+ }
+ if (drawableId == 0 || splashscreenTime <= 0) {
+ return;
+ }
+
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ // Get reference to display
+ Display display = cordova.getActivity().getWindowManager().getDefaultDisplay();
+ Context context = webView.getContext();
+
+ // Create the layout for the dialog
+ LinearLayout root = new LinearLayout(context);
+ root.setMinimumHeight(display.getHeight());
+ root.setMinimumWidth(display.getWidth());
+ root.setOrientation(LinearLayout.VERTICAL);
+
+ // TODO: Use the background color of the webview's parent instead of using the
+ // preference.
+ root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+ root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
+ root.setBackgroundResource(drawableId);
+
+ // Create and show the dialog
+ splashDialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar);
+ // check to see if the splash screen should be full screen
+ if ((cordova.getActivity().getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
+ == WindowManager.LayoutParams.FLAG_FULLSCREEN) {
+ splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ splashDialog.setContentView(root);
+ splashDialog.setCancelable(false);
+ splashDialog.show();
+
+ // Set Runnable to remove splash screen just in case
+ final Handler handler = new Handler();
+ handler.postDelayed(new Runnable() {
+ public void run() {
+ removeSplashScreen();
+ }
+ }, splashscreenTime);
+ }
+ });
+ }
+
+ /*
+ * Load the spinner
+ */
+ private void loadSpinner() {
+ // If loadingDialog property, then show the App loading dialog for first page of app
+ String loading = null;
+ if (webView.canGoBack()) {
+ loading = preferences.getString("LoadingDialog", null);
+ }
+ else {
+ loading = preferences.getString("LoadingPageDialog", null);
+ }
+ if (loading != null) {
+ String title = "";
+ String message = "Loading Application...";
+
+ if (loading.length() > 0) {
+ int comma = loading.indexOf(',');
+ if (comma > 0) {
+ title = loading.substring(0, comma);
+ message = loading.substring(comma + 1);
+ }
+ else {
+ title = "";
+ message = loading;
+ }
+ }
+ spinnerStart(title, message);
+ }
+ }
+
+ private void spinnerStart(final String title, final String message) {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ spinnerStop();
+ spinnerDialog = ProgressDialog.show(webView.getContext(), title, message, true, true,
+ new DialogInterface.OnCancelListener() {
+ public void onCancel(DialogInterface dialog) {
+ spinnerDialog = null;
+ }
+ });
+ }
+ });
+ }
+
+ private void spinnerStop() {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ if (spinnerDialog != null && spinnerDialog.isShowing()) {
+ spinnerDialog.dismiss();
+ spinnerDialog = null;
+ }
+ }
+ });
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[08/12] cordova-amazon-fireos git commit: Close #137 (already merged).
Posted by na...@apache.org.
Close #137 (already merged).
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/533fd373
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/533fd373
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/533fd373
Branch: refs/heads/master
Commit: 533fd37315c58bdc0ef495040c815d65a356aa51
Parents: 0ed7d27
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 20:06:38 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:02:51 2014 +0000
----------------------------------------------------------------------
CONTRIBUTING.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/533fd373/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f7dbcab..0ed4e63 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,8 +25,8 @@ Anyone can contribute to Cordova. And we need your contributions.
There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
-
-For instructions on this, start with the
+
+For instructions on this, start with the
[contribution overview](http://cordova.apache.org/#contribute).
The details are explained there, but the important items are:
@@ -35,3 +35,4 @@ The details are explained there, but the important items are:
- Run the tests so your patch doesn't break existing functionality.
We look forward to your contributions!
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[09/12] cordova-amazon-fireos git commit: Close #126 (not-a-problem)
Posted by na...@apache.org.
Close #126 (not-a-problem)
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/25a43b49
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/25a43b49
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/25a43b49
Branch: refs/heads/master
Commit: 25a43b49ce39917bde4d82c84ff810404d620486
Parents: 533fd37
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 20:59:51 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:03:11 2014 +0000
----------------------------------------------------------------------
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/25a43b49/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0ed4e63..f34ecff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,7 +25,7 @@ Anyone can contribute to Cordova. And we need your contributions.
There are multiple ways to contribute: report bugs, improve the docs, and
contribute code.
-
+
For instructions on this, start with the
[contribution overview](http://cordova.apache.org/#contribute).
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[02/12] cordova-amazon-fireos git commit: CB-8119 Restart adb when we
detect it's hung
Posted by na...@apache.org.
CB-8119 Restart adb when we detect it's hung
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/251130bb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/251130bb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/251130bb
Branch: refs/heads/master
Commit: 251130bba2e936bf71458bb55c0e8ea57c03f2f9
Parents: b8dcd4e
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Dec 4 09:58:00 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 18:39:43 2014 +0000
----------------------------------------------------------------------
bin/templates/cordova/lib/build.js | 42 ++++++++++++++++++++++++++++----
bin/templates/cordova/lib/device.js | 40 ++++++++++++++++++++++--------
2 files changed, 67 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/251130bb/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 85a6e7c..0d4d004 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -398,12 +398,44 @@ module.exports.run = function(options, optResolvedTarget) {
* Returns "arm" or "x86".
*/
module.exports.detectArchitecture = function(target) {
- return exec('adb -s ' + target + ' shell cat /proc/cpuinfo')
- .then(function(output) {
- if (/intel/i.exec(output)) {
- return 'x86';
+ function helper() {
+ return exec('adb -s ' + target + ' shell cat /proc/cpuinfo')
+ .then(function(output) {
+ if (/intel/i.exec(output)) {
+ return 'x86';
+ }
+ return 'arm';
+ });
+ }
+ // It sometimes happens (at least on OS X), that this command will hang forever.
+ // To fix it, either unplug & replug device, or restart adb server.
+ return helper().timeout(1000, 'Device communication timed out. Try unplugging & replugging the device.')
+ .then(null, function(err) {
+ if (/timed out/.exec('' + err)) {
+ // adb kill-server doesn't seem to do the trick.
+ // Could probably find a x-platform version of killall, but I'm not actually
+ // sure that this scenario even happens on non-OSX machines.
+ return exec('killall adb')
+ .then(function() {
+ console.log('adb seems hung. retrying.');
+ return helper()
+ .then(null, function() {
+ // The double kill is sadly often necessary, at least on mac.
+ console.log('Now device not found... restarting adb again.');
+ return exec('killall adb')
+ .then(function() {
+ return helper()
+ .then(null, function() {
+ return Q.reject('USB is flakey. Try unplugging & replugging the device.');
+ });
+ });
+ });
+ }, function() {
+ // For non-killall OS's.
+ return Q.reject(err);
+ })
}
- return 'arm';
+ throw err;
});
};
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/251130bb/bin/templates/cordova/lib/device.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/device.js b/bin/templates/cordova/lib/device.js
index 6be55e3..6430d73 100644
--- a/bin/templates/cordova/lib/device.js
+++ b/bin/templates/cordova/lib/device.js
@@ -28,23 +28,43 @@ var exec = require('./exec'),
/**
* Returns a promise for the list of the device ID's found
+ * @param lookHarder When true, try restarting adb if no devices are found.
*/
-module.exports.list = function() {
- return exec('adb devices')
- .then(function(output) {
- var response = output.split('\n');
- var device_list = [];
- for (var i = 1; i < response.length; i++) {
- if (response[i].match(/\w+\tdevice/) && !response[i].match(/emulator/)) {
- device_list.push(response[i].replace(/\tdevice/, '').replace('\r', ''));
+module.exports.list = function(lookHarder) {
+ function helper() {
+ return exec('adb devices')
+ .then(function(output) {
+ var response = output.split('\n');
+ var device_list = [];
+ for (var i = 1; i < response.length; i++) {
+ if (response[i].match(/\w+\tdevice/) && !response[i].match(/emulator/)) {
+ device_list.push(response[i].replace(/\tdevice/, '').replace('\r', ''));
+ }
}
+ return device_list;
+ });
+ }
+ return helper()
+ .then(function(list) {
+ if (list.length === 0 && lookHarder) {
+ // adb kill-server doesn't seem to do the trick.
+ // Could probably find a x-platform version of killall, but I'm not actually
+ // sure that this scenario even happens on non-OSX machines.
+ return exec('killall adb')
+ .then(function() {
+ console.log('Restarting adb to see if more devices are detected.');
+ return helper();
+ }, function() {
+ // For non-killall OS's.
+ return list;
+ });
}
- return device_list;
+ return list;
});
}
module.exports.resolveTarget = function(target) {
- return this.list()
+ return this.list(true)
.then(function(device_list) {
if (!device_list || !device_list.length) {
return Q.reject('ERROR: Failed to deploy to device, no devices found.');
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[04/12] cordova-amazon-fireos git commit: CB-8143: Use the correct
Android Gradle plugin for the installed Gradle version
Posted by na...@apache.org.
CB-8143: Use the correct Android Gradle plugin for the installed Gradle version
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/87602e30
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/87602e30
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/87602e30
Branch: refs/heads/master
Commit: 87602e303be2df4658ef4b35a958feac544e0145
Parents: b409290
Author: Ian Clelland <ic...@chromium.org>
Authored: Wed Dec 10 10:07:05 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 18:54:03 2014 +0000
----------------------------------------------------------------------
bin/templates/project/build.gradle | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/87602e30/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 63ecd81..5a997e6 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -31,8 +31,18 @@ buildscript {
mavenCentral()
}
- dependencies {
- classpath 'com.android.tools.build:gradle:0.12.0+'
+ // Switch the Android Gradle plugin version requirement depending on the
+ // installed version of Gradle. This dependency is documented at
+ // http://tools.android.com/tech-docs/new-build-system/version-compatibility
+ // and https://issues.apache.org/jira/browse/CB-8143
+ if (gradle.gradleVersion >= "2.1") {
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.14.0+'
+ }
+ } else {
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.12.0+'
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[10/12] cordova-amazon-fireos git commit: CB-8147 Have corodva/build
warn about unrecognized flags rather than fail
Posted by na...@apache.org.
CB-8147 Have corodva/build warn about unrecognized flags rather than fail
Close #127
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/06b3ee5e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/06b3ee5e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/06b3ee5e
Branch: refs/heads/master
Commit: 06b3ee5e2737468a4a7b4c85080160cfcf89719f
Parents: 25a43b4
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Dec 10 20:30:59 2014 -0500
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:07:47 2014 +0000
----------------------------------------------------------------------
bin/templates/cordova/lib/build.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/06b3ee5e/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 7bc20f6..3dc3b3d 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -339,14 +339,19 @@ function parseOpts(options, resolvedTarget) {
case 'gradle':
ret.buildMethod = option;
break;
+ case 'device':
+ case 'emulator':
+ // Don't need to do anything special to when building for device vs emulator.
+ // iOS uses this flag to switch on architecture.
+ break;
case 'nobuild' :
ret.buildMethod = 'none';
break;
default :
- return Q.reject('Build option \'' + options[i] + '\' not recognized.');
+ console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
}
} else {
- return Q.reject('Build option \'' + options[i] + '\' not recognized.');
+ console.warn('Build option \'' + options[i] + '\' not recognized (ignoring).';
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[06/12] cordova-amazon-fireos git commit: Add a section for plugin
extensions
Posted by na...@apache.org.
Add a section for plugin extensions
The build.gradle will apply gradle srcipte from plugin extension
When install the plugin with "gradleReference" framework.
The gradle can set ext.multiarch=true to support multiple APKs by
default, so add this section in here.
Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/df49aca5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/df49aca5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/df49aca5
Branch: refs/heads/master
Commit: df49aca55e3dfb1cceba8a1966ccb486dc415e45
Parents: 585db69
Author: fujunwei <ju...@intel.com>
Authored: Mon Nov 17 15:52:40 2014 +0800
Committer: Ajitha <aj...@amazon.com>
Committed: Sat Dec 13 19:01:35 2014 +0000
----------------------------------------------------------------------
bin/templates/project/build.gradle | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/df49aca5/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 5a997e6..f427561 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -50,6 +50,9 @@ task wrapper(type: Wrapper) {
gradleVersion = '1.12'
}
+// PLUGIN GRADLE EXTENSIONS START
+// PLUGIN GRADLE EXTENSIONS END
+
ext.multiarch=false
android {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org