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/03/10 20:21:55 UTC

[1/3] git commit: Added overloaded constructor for CordovaWebView with Bundle as parameter. Need it for AmazonWebChromeClient.onCreateWindow callback.

Repository: cordova-amazon-fireos
Updated Branches:
  refs/heads/master f69e724c6 -> f4990a56f


Added overloaded constructor for CordovaWebView with Bundle as parameter.
Need it for AmazonWebChromeClient.onCreateWindow callback.


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/f4990a56
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/f4990a56
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/f4990a56

Branch: refs/heads/master
Commit: f4990a56f18643ac7de66af723d668c1e79359b6
Parents: 6e3e68d
Author: Archana Naik <na...@lab126.com>
Authored: Mon Mar 10 11:30:22 2014 -0700
Committer: Archana Naik <na...@lab126.com>
Committed: Mon Mar 10 12:21:39 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaWebView.java  | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/f4990a56/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 d59da69..c6a28dd 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -186,6 +186,32 @@ public class CordovaWebView extends AmazonWebView {
         this.setup();
     }
 
+////fireos_change ////
+    /**
+     * Constructor 
+     * The extraData bundle is needed for AmazonWebChromeClient.onCreateWindow callback.
+     * It's just an opaque data that needs to be passed from one call to the other.
+     * 
+     * @param context
+     * @param extraData 
+     */
+    public CordovaWebView(Context context, Bundle extraData) {
+        super(context);
+ 
+        if (CordovaInterface.class.isInstance(context))
+        {
+            this.cordova = (CordovaInterface) context;
+            this.cordova.getFactory().initializeWebView(this, 0xFFFFFF, false, extraData);
+        }
+        else
+        {
+            Log.d(TAG, "Your activity must implement CordovaInterface to work");
+        }
+        this.loadConfiguration();
+        this.setup();
+    }
+////fireos_change ////
+    
     /**
      * Constructor.
      *


[2/3] git commit: Catch uncaught exceptions in from plugins and turn them into error responses.

Posted by na...@apache.org.
Catch uncaught exceptions in from plugins and turn them into error responses.

When a plugin throws an unchecked exception, we're not catching it
anywhere and so the error callback is not being called.

This change adds a try/catch to catch such exceptions.


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/6e3e68d9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/6e3e68d9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/6e3e68d9

Branch: refs/heads/master
Commit: 6e3e68d9cc435643c659d6e5c074d483025e4513
Parents: 85067e4
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Mar 6 21:25:48 2014 -0500
Committer: Archana Naik <na...@lab126.com>
Committed: Mon Mar 10 12:21:39 2014 -0700

----------------------------------------------------------------------
 framework/src/org/apache/cordova/PluginManager.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/6e3e68d9/framework/src/org/apache/cordova/PluginManager.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/PluginManager.java b/framework/src/org/apache/cordova/PluginManager.java
index 0c52542..a7489c1 100755
--- a/framework/src/org/apache/cordova/PluginManager.java
+++ b/framework/src/org/apache/cordova/PluginManager.java
@@ -245,22 +245,25 @@ public class PluginManager {
             app.sendPluginResult(cr, callbackId);
             return;
         }
+        CallbackContext callbackContext = new CallbackContext(callbackId, app);
         try {
-            CallbackContext callbackContext = new CallbackContext(callbackId, app);
             long pluginStartTime = System.currentTimeMillis();
             boolean wasValidAction = plugin.execute(action, rawArgs, callbackContext);
             long duration = System.currentTimeMillis() - pluginStartTime;
-            
+
             if (duration > SLOW_EXEC_WARNING_THRESHOLD) {
                 Log.w(TAG, "THREAD WARNING: exec() call to " + service + "." + action + " blocked the main thread for " + duration + "ms. Plugin should use CordovaInterface.getThreadPool().");
             }
             if (!wasValidAction) {
                 PluginResult cr = new PluginResult(PluginResult.Status.INVALID_ACTION);
-                app.sendPluginResult(cr, callbackId);
+                callbackContext.sendPluginResult(cr);
             }
         } catch (JSONException e) {
             PluginResult cr = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
-            app.sendPluginResult(cr, callbackId);
+            callbackContext.sendPluginResult(cr);
+        } catch (Exception e) {
+            Log.e(TAG, "Uncaught exception from plugin", e);
+            callbackContext.error(e.getMessage());
         }
     }
 


[3/3] git commit: Add NOTICE file

Posted by na...@apache.org.
Add NOTICE file


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/85067e4e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/85067e4e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/85067e4e

Branch: refs/heads/master
Commit: 85067e4e665591f369a02875cc7699c0ecf5ea78
Parents: f69e724
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Feb 27 15:36:30 2014 -0500
Committer: Archana Naik <na...@lab126.com>
Committed: Mon Mar 10 12:21:39 2014 -0700

----------------------------------------------------------------------
 NOTICE | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/85067e4e/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 0c25c9d..8ec56a5 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,17 +1,5 @@
 Apache Cordova
-Copyright 2014 The Apache Software Foundation
+Copyright 2012 The Apache Software Foundation
 
 This product includes software developed at
-The Apache Software Foundation (http://www.apache.org)
-
-=========================================================================
-==  NOTICE file corresponding to the section 4 d of                    ==
-==  the Apache License, Version 2.0,                                   ==
-==  in this case for the Android-specific code.                        ==
-=========================================================================
-
-This product includes software developed as part of
-The Android and amazon-fireos Open Source Project (http://source.android.com).
-
-This software includes software developed at Square, Inc.
-Copyright (C) 2013 Square, Inc.
+The Apache Software Foundation (http://www.apache.org/).