cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject android commit: CB-1605: Going through Eclipse warnings, removing the unused imports
Date Fri, 15 Feb 2013 23:46:58 GMT
Updated Branches:
  refs/heads/master a31714f8a -> a45d5a98d


CB-1605: Going through Eclipse warnings, removing the unused imports


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

Branch: refs/heads/master
Commit: a45d5a98dd71f07cc808dfbb42995c4a49934ba2
Parents: a31714f
Author: Joe Bowser <bowserj@apache.org>
Authored: Fri Feb 15 15:46:36 2013 -0800
Committer: Joe Bowser <bowserj@apache.org>
Committed: Fri Feb 15 15:46:36 2013 -0800

----------------------------------------------------------------------
 .../src/org/apache/cordova/ContactAccessor.java    |    1 -
 .../org/apache/cordova/CordovaChromeClient.java    |    2 -
 .../src/org/apache/cordova/CordovaWebView.java     |    1 -
 framework/src/org/apache/cordova/Device.java       |    1 -
 framework/src/org/apache/cordova/DroidGap.java     |    1 -
 framework/src/org/apache/cordova/ExposedJsApi.java |    1 -
 framework/src/org/apache/cordova/InAppBrowser.java |   40 ++++++++++++++-
 framework/src/org/apache/cordova/Storage.java      |    1 -
 .../org/apache/cordova/api/CordovaInterface.java   |    1 -
 .../src/org/apache/cordova/api/PluginManager.java  |    4 --
 10 files changed, 38 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/ContactAccessor.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/ContactAccessor.java b/framework/src/org/apache/cordova/ContactAccessor.java
index 44bed23..04b4342 100644
--- a/framework/src/org/apache/cordova/ContactAccessor.java
+++ b/framework/src/org/apache/cordova/ContactAccessor.java
@@ -18,7 +18,6 @@ package org.apache.cordova;
 
 import java.util.HashMap;
 
-import android.content.Context;
 import android.util.Log;
 import android.webkit.WebView;
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/CordovaChromeClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaChromeClient.java b/framework/src/org/apache/cordova/CordovaChromeClient.java
index 4b30894..e650781 100755
--- a/framework/src/org/apache/cordova/CordovaChromeClient.java
+++ b/framework/src/org/apache/cordova/CordovaChromeClient.java
@@ -24,12 +24,10 @@ import org.json.JSONArray;
 import org.json.JSONException;
 
 import android.annotation.TargetApi;
-import android.app.Activity;
 import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.net.Uri;
-import android.util.Log;
 import android.view.Gravity;
 import android.view.KeyEvent;
 import android.view.View;

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/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 8e3a2af..06651b1 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -27,7 +27,6 @@ import java.util.Stack;
 
 import org.apache.cordova.Config;
 import org.apache.cordova.api.CordovaInterface;
-import org.apache.cordova.api.CordovaPlugin;
 import org.apache.cordova.api.LOG;
 import org.apache.cordova.api.PluginManager;
 import org.apache.cordova.api.PluginResult;

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/Device.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Device.java b/framework/src/org/apache/cordova/Device.java
index 883fc55..e8ea7e1 100644
--- a/framework/src/org/apache/cordova/Device.java
+++ b/framework/src/org/apache/cordova/Device.java
@@ -24,7 +24,6 @@ import org.apache.cordova.api.CallbackContext;
 import org.apache.cordova.api.CordovaPlugin;
 import org.apache.cordova.api.LOG;
 import org.apache.cordova.api.CordovaInterface;
-import org.apache.cordova.api.PluginResult;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index ee21eb8..9a7be4e 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -51,7 +51,6 @@ import android.view.ViewGroup;
 import android.view.Window;
 import android.view.WindowManager;
 import android.webkit.ValueCallback;
-import android.webkit.WebView;
 import android.webkit.WebViewClient;
 import android.widget.LinearLayout;
 

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/ExposedJsApi.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/ExposedJsApi.java b/framework/src/org/apache/cordova/ExposedJsApi.java
index a36bb62..48e7102 100755
--- a/framework/src/org/apache/cordova/ExposedJsApi.java
+++ b/framework/src/org/apache/cordova/ExposedJsApi.java
@@ -20,7 +20,6 @@ package org.apache.cordova;
 
 import android.webkit.JavascriptInterface;
 import org.apache.cordova.api.PluginManager;
-import org.apache.cordova.api.PluginResult;
 import org.json.JSONException;
 
 /**

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/InAppBrowser.java b/framework/src/org/apache/cordova/InAppBrowser.java
index 0b5246e..7e7f862 100644
--- a/framework/src/org/apache/cordova/InAppBrowser.java
+++ b/framework/src/org/apache/cordova/InAppBrowser.java
@@ -49,6 +49,7 @@ import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
+import android.webkit.WebStorage;
 import android.webkit.WebView;
 import android.webkit.WebViewClient;
 import android.widget.Button;
@@ -68,13 +69,14 @@ public class InAppBrowser extends CordovaPlugin {
     private static final String EXIT_EVENT = "exit";
     private static final String LOAD_START_EVENT = "loadstart";
     private static final String LOAD_STOP_EVENT = "loadstop";
+    private long MAX_QUOTA = 100 * 1024 * 1024;
 
     private Dialog dialog;
     private WebView inAppWebView;
     private EditText edittext;
     private boolean showLocationBar = true;
     private CallbackContext callbackContext;
-
+    
     /**
      * Executes the request and returns PluginResult.
      *
@@ -413,7 +415,7 @@ public class InAppBrowser extends CordovaPlugin {
                 // WebView
                 inAppWebView = new WebView(cordova.getActivity());
                 inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT));
-                inAppWebView.setWebChromeClient(new WebChromeClient());
+                inAppWebView.setWebChromeClient(new InAppChromeClient());
                 WebViewClient client = new InAppBrowserClient(thatWebView, edittext);
                 inAppWebView.setWebViewClient(client);
                 WebSettings settings = inAppWebView.getSettings();
@@ -480,6 +482,40 @@ public class InAppBrowser extends CordovaPlugin {
         this.callbackContext.sendPluginResult(result);
     }
 
+    public class InAppChromeClient extends WebChromeClient {
+
+        /**
+         * Handle database quota exceeded notification.
+         *
+         * @param url
+         * @param databaseIdentifier
+         * @param currentQuota
+         * @param estimatedSize
+         * @param totalUsedQuota
+         * @param quotaUpdater
+         */
+        @Override
+        public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota,
long estimatedSize,
+                long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
+        {
+            LOG.d(LOG_TAG, "onExceededDatabaseQuota estimatedSize: %d  currentQuota: %d 
totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
+
+            if (estimatedSize < MAX_QUOTA)
+            {
+                //increase for 1Mb
+                long newQuota = estimatedSize;
+                LOG.d(LOG_TAG, "calling quotaUpdater.updateQuota newQuota: %d", newQuota);
+                quotaUpdater.updateQuota(newQuota);
+            }
+            else
+            {
+                // Set the quota to whatever it is and force an error
+                // TODO: get docs on how to handle this properly
+                quotaUpdater.updateQuota(currentQuota);
+            }
+        }
+    }
+    
     /**
      * The webview client receives notifications about appView
      */

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/Storage.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Storage.java b/framework/src/org/apache/cordova/Storage.java
index 5ec3068..34ebf38 100755
--- a/framework/src/org/apache/cordova/Storage.java
+++ b/framework/src/org/apache/cordova/Storage.java
@@ -22,7 +22,6 @@ import java.io.File;
 
 import org.apache.cordova.api.CallbackContext;
 import org.apache.cordova.api.CordovaPlugin;
-import org.apache.cordova.api.PluginResult;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/api/CordovaInterface.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/api/CordovaInterface.java b/framework/src/org/apache/cordova/api/CordovaInterface.java
index 22e36b6..aaa5885 100755
--- a/framework/src/org/apache/cordova/api/CordovaInterface.java
+++ b/framework/src/org/apache/cordova/api/CordovaInterface.java
@@ -19,7 +19,6 @@
 package org.apache.cordova.api;
 
 import android.app.Activity;
-import android.content.Context;
 import android.content.Intent;
 
 import java.util.concurrent.ExecutorService;

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/a45d5a98/framework/src/org/apache/cordova/api/PluginManager.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/api/PluginManager.java b/framework/src/org/apache/cordova/api/PluginManager.java
index 98bb157..d0e6aef 100755
--- a/framework/src/org/apache/cordova/api/PluginManager.java
+++ b/framework/src/org/apache/cordova/api/PluginManager.java
@@ -22,17 +22,13 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map.Entry;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 import org.apache.cordova.CordovaWebView;
-import org.json.JSONArray;
 import org.json.JSONException;
 import org.xmlpull.v1.XmlPullParserException;
 
 import android.content.Intent;
 import android.content.res.XmlResourceParser;
-import android.util.Log;
 
 /**
  * PluginManager is exposed to JavaScript in the Cordova WebView.


Mime
View raw message