You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2015/05/16 00:29:41 UTC
cordova-amazon-fireos git commit: Removing Intent funtionality out of
3.6
Repository: cordova-amazon-fireos
Updated Branches:
refs/heads/master 79fca2504 -> 7ec09a6bd
Removing Intent funtionality out of 3.6
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/7ec09a6b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/7ec09a6b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/7ec09a6b
Branch: refs/heads/master
Commit: 7ec09a6bdcab3b7a31d3fe8c051e2fdea5f7e8d9
Parents: 79fca25
Author: Joe Bowser <bo...@apache.org>
Authored: Fri May 15 11:15:34 2015 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Fri May 15 15:28:43 2015 -0700
----------------------------------------------------------------------
framework/src/org/apache/cordova/Config.java | 1 -
.../src/org/apache/cordova/CordovaActivity.java | 1 -
.../org/apache/cordova/CordovaPreferences.java | 86 +-------------------
3 files changed, 2 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/7ec09a6b/framework/src/org/apache/cordova/Config.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Config.java b/framework/src/org/apache/cordova/Config.java
index caf3f44..44716f0 100644
--- a/framework/src/org/apache/cordova/Config.java
+++ b/framework/src/org/apache/cordova/Config.java
@@ -37,7 +37,6 @@ public class Config {
parser = new ConfigXmlParser();
parser.parse(action);
parser.getPreferences().setPreferencesBundle(action.getIntent().getExtras());
- parser.getPreferences().copyIntoIntentExtras(action);
}
// Intended to be used for testing only; creates an empty configuration.
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/7ec09a6b/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 1534b79..fff645e 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -249,7 +249,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
parser.parse(this);
preferences = parser.getPreferences();
preferences.setPreferencesBundle(getIntent().getExtras());
- preferences.copyIntoIntentExtras(this);
internalWhitelist = parser.getInternalWhitelist();
externalWhitelist = parser.getExternalWhitelist();
launchUrl = parser.getLaunchUrl();
http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/7ec09a6b/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 ed0b9b8..27fb826 100644
--- a/framework/src/org/apache/cordova/CordovaPreferences.java
+++ b/framework/src/org/apache/cordova/CordovaPreferences.java
@@ -61,13 +61,6 @@ public class CordovaPreferences {
String value = prefs.get(name);
if (value != null) {
return Boolean.parseBoolean(value);
- } else if (preferencesBundleExtras != null) {
- Object bundleValue = preferencesBundleExtras.get(name);
- if (bundleValue instanceof String) {
- return "true".equals(bundleValue);
- }
- // Gives a nice warning if type is wrong.
- return preferencesBundleExtras.getBoolean(name, defaultValue);
}
return defaultValue;
}
@@ -78,13 +71,6 @@ public class CordovaPreferences {
if (value != null) {
// Use Integer.decode() can't handle it if the highest bit is set.
return (int)(long)Long.decode(value);
- } else if (preferencesBundleExtras != null) {
- Object bundleValue = preferencesBundleExtras.get(name);
- if (bundleValue instanceof String) {
- return Integer.valueOf((String)bundleValue);
- }
- // Gives a nice warning if type is wrong.
- return preferencesBundleExtras.getInt(name, defaultValue);
}
return defaultValue;
}
@@ -94,14 +80,7 @@ public class CordovaPreferences {
String value = prefs.get(name);
if (value != null) {
return Double.valueOf(value);
- } else if (preferencesBundleExtras != null) {
- Object bundleValue = preferencesBundleExtras.get(name);
- if (bundleValue instanceof String) {
- return Double.valueOf((String)bundleValue);
- }
- // Gives a nice warning if type is wrong.
- return preferencesBundleExtras.getDouble(name, defaultValue);
- }
+ }
return defaultValue;
}
@@ -110,69 +89,8 @@ public class CordovaPreferences {
String value = prefs.get(name);
if (value != null) {
return value;
- } else if (preferencesBundleExtras != null && !"errorurl".equals(name)) {
- Object bundleValue = preferencesBundleExtras.get(name);
- if (bundleValue != null) {
- return bundleValue.toString();
- }
- }
+ }
return defaultValue;
}
- // Plugins should not rely on values within the intent since this does not work
- // for apps with multiple webviews. Instead, they should retrieve prefs from the
- // Config object associated with their webview.
- public void copyIntoIntentExtras(Activity action) {
- for (String name : prefs.keySet()) {
- String value = prefs.get(name);
- if (value == null) {
- continue;
- }
- if (name.equals("loglevel")) {
- LOG.setLogLevel(value);
- } 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")) {
- int asInt = (int)(long)Long.decode(value);
- action.getIntent().putExtra(name, asInt);
- }
- else if(name.equals("loadurltimeoutvalue")) {
- int asInt = Integer.decode(value);
- action.getIntent().putExtra(name, asInt);
- }
- else if(name.equals("splashscreendelay")) {
- int asInt = Integer.decode(value);
- action.getIntent().putExtra(name, asInt);
- }
- else if(name.equals("keeprunning"))
- {
- boolean asBool = Boolean.parseBoolean(value);
- action.getIntent().putExtra(name, asBool);
- }
- else if(name.equals("inappbrowserstorageenabled"))
- {
- boolean asBool = Boolean.parseBoolean(value);
- action.getIntent().putExtra(name, asBool);
- }
- else if(name.equals("disallowoverscroll"))
- {
- boolean asBool = Boolean.parseBoolean(value);
- action.getIntent().putExtra(name, asBool);
- }
- else
- {
- action.getIntent().putExtra(name, value);
- }
- }
- // In the normal case, the intent extras are null until the first call to putExtra().
- if (preferencesBundleExtras == null) {
- preferencesBundleExtras = action.getIntent().getExtras();
- }
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org