cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [6/6] android commit: Merge branch 'master' into 4.0.x (ConfigXmlParser breakout)
Date Fri, 04 Jul 2014 15:49:28 GMT
Merge branch 'master' into 4.0.x (ConfigXmlParser breakout)

Conflicts:
	framework/src/org/apache/cordova/CordovaActivity.java
	framework/src/org/apache/cordova/PluginManager.java


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

Branch: refs/heads/4.0.x
Commit: bdf2f22f81632ffe8e81678a36b2a78b2e2c5a63
Parents: a833077 79aa3e1
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jul 4 11:48:49 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jul 4 11:48:49 2014 -0400

----------------------------------------------------------------------
 framework/.classpath                            |   2 +-
 framework/src/org/apache/cordova/Config.java    | 189 ++-----------------
 .../src/org/apache/cordova/ConfigXmlParser.java | 163 ++++++++++++++++
 .../src/org/apache/cordova/CordovaActivity.java |  78 +-------
 .../org/apache/cordova/CordovaPreferences.java  | 158 ++++++++++++++++
 .../src/org/apache/cordova/PluginManager.java   |  99 +---------
 framework/src/org/apache/cordova/Whitelist.java |   4 +
 7 files changed, 359 insertions(+), 334 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/bdf2f22f/framework/src/org/apache/cordova/CordovaActivity.java
----------------------------------------------------------------------
diff --cc framework/src/org/apache/cordova/CordovaActivity.java
index 77e896c,18ac670..d8e218a
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@@ -137,23 -127,68 +129,10 @@@ public class CordovaActivity extends Ac
      // when another application (activity) is started.
      protected boolean keepRunning = true;
  
-     private int lastRequestCode;
- 
-     private Object responseCode;
- 
-     private Intent lastIntent;
- 
-     private Object lastResponseCode;
- 
      private String initCallbackClass;
  
-     private Object LOG_TAG;
- 
- 
      /**
 -    * Sets the authentication token.
 -    *
 -    * @param authenticationToken
 -    * @param host
 -    * @param realm
 -    */
 -    public void setAuthenticationToken(AuthenticationToken authenticationToken, String host,
String realm) {
 -        if (this.appView != null && this.appView.viewClient != null) {
 -            this.appView.viewClient.setAuthenticationToken(authenticationToken, host, realm);
 -        }
 -    }
 -
 -    /**
 -     * Removes the authentication token.
 -     *
 -     * @param host
 -     * @param realm
 -     *
 -     * @return the authentication token or null if did not exist
 -     */
 -    public AuthenticationToken removeAuthenticationToken(String host, String realm) {
 -        if (this.appView != null && this.appView.viewClient != null) {
 -            return this.appView.viewClient.removeAuthenticationToken(host, realm);
 -        }
 -        return null;
 -    }
 -
 -    /**
 -     * Gets the authentication token.
 -     *
 -     * In order it tries:
 -     * 1- host + realm
 -     * 2- host
 -     * 3- realm
 -     * 4- no host, no realm
 -     *
 -     * @param host
 -     * @param realm
 -     *
 -     * @return the authentication token
 -     */
 -    public AuthenticationToken getAuthenticationToken(String host, String realm) {
 -        if (this.appView != null && this.appView.viewClient != null) {
 -            return this.appView.viewClient.getAuthenticationToken(host, realm);
 -        }
 -        return null;
 -    }
 -
 -    /**
 -     * Clear all authentication tokens.
 -     */
 -    public void clearAuthenticationTokens() {
 -        if (this.appView != null && this.appView.viewClient != null) {
 -            this.appView.viewClient.clearAuthenticationTokens();
 -        }
 -    }
 -
 -    /**
       * Called when the activity is first created.
-      *
-      * @param savedInstanceState
       */
      @SuppressWarnings("deprecation")
      @Override
@@@ -314,12 -322,8 +293,8 @@@
  
          // Add web view but make it invisible while loading URL
          this.appView.setVisibility(View.INVISIBLE);
 -        this.root.addView(this.appView);
 +        this.root.addView((View) this.appView.getView());
          setContentView(this.root);
- 
-         // Clear cancel flag
-         this.cancelLoadUrl = false;
-         
      }
  
      /**
@@@ -416,7 -417,10 +388,6 @@@
          }
      }
  
- 
 -    @Deprecated
 -    public void cancelLoadUrl() {
 -    }
 -
      /**
       * Clear the resource cache.
       */
@@@ -558,10 -551,70 +518,10 @@@
          return p.doubleValue();
      }
  
-     @Override
      /**
 -     * Set boolean property on activity.
 -     * This method has been deprecated in 3.0 and will be removed at a future
 -     * time. Please use config.xml instead.
 -     *
 -     * @param name
 -     * @param value
 -     * @deprecated
 -     */
 -    @Deprecated
 -    public void setBooleanProperty(String name, boolean value) {
 -        Log.d(TAG, "Setting boolean properties in CordovaActivity will be deprecated in
3.0 on July 2013, please use config.xml");
 -        this.getIntent().putExtra(name.toLowerCase(), value);
 -    }
 -
 -    /**
 -     * Set int property on activity.
 -     * This method has been deprecated in 3.0 and will be removed at a future
 -     * time. Please use config.xml instead.
 -     *
 -     * @param name
 -     * @param value
 -     * @deprecated
 -     */
 -    @Deprecated
 -    public void setIntegerProperty(String name, int value) {
 -        Log.d(TAG, "Setting integer properties in CordovaActivity will be deprecated in
3.0 on July 2013, please use config.xml");
 -        this.getIntent().putExtra(name.toLowerCase(), value);
 -    }
 -
 -    /**
 -     * Set string property on activity.
 -     * This method has been deprecated in 3.0 and will be removed at a future
 -     * time. Please use config.xml instead.
 -     *
 -     * @param name
 -     * @param value
 -     * @deprecated
 -     */
 -    @Deprecated
 -    public void setStringProperty(String name, String value) {
 -        Log.d(TAG, "Setting string properties in CordovaActivity will be deprecated in 3.0
on July 2013, please use config.xml");
 -        this.getIntent().putExtra(name.toLowerCase(), value);
 -    }
 -
 -    /**
 -     * Set double property on activity.
 -     * This method has been deprecated in 3.0 and will be removed at a future
 -     * time. Please use config.xml instead.
 -     *
 -     * @param name
 -     * @param value
 -     * @deprecated
 -     */
 -    @Deprecated
 -    public void setDoubleProperty(String name, double value) {
 -        Log.d(TAG, "Setting double properties in CordovaActivity will be deprecated in 3.0
on July 2013, please use config.xml");
 -        this.getIntent().putExtra(name.toLowerCase(), value);
 -    }
 -
 -    /**
       * Called when the system is about to start resuming a previous activity.
       */
+     @Override
      protected void onPause() {
          super.onPause();
  
@@@ -664,8 -708,20 +615,7 @@@
          }
      }
  
- 
      /**
 -     * @deprecated
 -     * Add services to res/xml/plugins.xml instead.
 -     *
 -     * Add a class that implements a service.
 -     */
 -    @Deprecated
 -    public void addService(String serviceType, String className) {
 -        if (this.appView != null && this.appView.pluginManager != null) {
 -            this.appView.pluginManager.addService(serviceType, className);
 -        }
 -    }
 -
 -    /**
       * Send JavaScript statement back to JavaScript.
       * (This is a convenience method)
       *

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/bdf2f22f/framework/src/org/apache/cordova/PluginManager.java
----------------------------------------------------------------------
diff --cc framework/src/org/apache/cordova/PluginManager.java
index feb5680,c5ffd6c..13c55c8
--- a/framework/src/org/apache/cordova/PluginManager.java
+++ b/framework/src/org/apache/cordova/PluginManager.java
@@@ -56,30 -51,14 +52,20 @@@ public class PluginManager 
      private final CordovaInterface ctx;
      private final CordovaWebView app;
  
-     // Flag to track first time through
-     private boolean firstRun;
- 
      // Stores mapping of Plugin Name -> <url-filter> values.
      // Using <url-filter> is deprecated.
-     protected HashMap<String, List<String>> urlMap = new HashMap<String,
List<String>>();
+     protected HashMap<String, List<String>> urlMap;
  
 +    private Set<String> pluginIdWhitelist;
 +
      public PluginManager(CordovaWebView app, CordovaInterface ctx) {
          this.ctx = ctx;
          this.app = app;
-         this.firstRun = true;
      }
 +    
 +    public void setPluginIdWhitelist(Set<String> pluginIdWhitelist) {
 +        this.pluginIdWhitelist = pluginIdWhitelist;
 +    }
  
      /**
       * Init when loading a new HTML page into webview.


Mime
View raw message