cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject android commit: Removing Intent funtionality out of 3.7
Date Fri, 15 May 2015 21:14:30 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/3.7.x f4b315961 -> a64203f81


Removing Intent funtionality out of 3.7


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/a64203f8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/a64203f8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/a64203f8

Branch: refs/heads/3.7.x
Commit: a64203f8174b42d6359f0bbdc7b69d96497b203a
Parents: f4b3159
Author: Joe Bowser <bowserj@apache.org>
Authored: Fri May 15 11:15:34 2015 -0700
Committer: Joe Bowser <bowserj@apache.org>
Committed: Fri May 15 14:14:18 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-android/blob/a64203f8/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 f13292c..53c6871 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-android/blob/a64203f8/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 cb8f27d..4d6a403 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -232,7 +232,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-android/blob/a64203f8/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


Mime
View raw message