Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95359D5BA for ; Mon, 27 Aug 2012 19:05:51 +0000 (UTC) Received: (qmail 76148 invoked by uid 500); 27 Aug 2012 19:05:51 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 76087 invoked by uid 500); 27 Aug 2012 19:05:51 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 76078 invoked by uid 99); 27 Aug 2012 19:05:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2012 19:05:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 12F69213E9; Mon, 27 Aug 2012 19:05:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: android commit: Refactor to avoid adb warnings of VFY: on start-up. Message-Id: <20120827190551.12F69213E9@tyr.zones.apache.org> Date: Mon, 27 Aug 2012 19:05:51 +0000 (UTC) Updated Branches: refs/heads/master f111c245c -> 07439ff99 Refactor to avoid adb warnings of VFY: on start-up. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/07439ff9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/07439ff9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/07439ff9 Branch: refs/heads/master Commit: 07439ff99ca5f61c444ae7673d9fec96e4502492 Parents: f111c24 Author: Andrew Grieve Authored: Mon Aug 27 13:58:17 2012 -0400 Committer: Andrew Grieve Committed: Mon Aug 27 15:05:20 2012 -0400 ---------------------------------------------------------------------- .../src/org/apache/cordova/CordovaWebView.java | 17 +++++++++++--- 1 files changed, 13 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/07439ff9/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 3f7a504..e878a74 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -215,10 +215,10 @@ public class CordovaWebView extends WebView { if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) settings.setNavDump(true); - //Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist - //while we do this - if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) - settings.setAllowUniversalAccessFromFileURLs(true); + // Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist + // while we do this + if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) + Level16Apis.enableUniversalAccess(settings); // Enable database settings.setDatabaseEnabled(true); String databasePath = this.cordova.getActivity().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath(); @@ -891,4 +891,13 @@ public class CordovaWebView extends WebView { public boolean hadKeyEvent() { return handleButton; } + + // Wrapping these functions in their own class prevents warnings in adb like: + // VFY: unable to resolve virtual method 285: Landroid/webkit/WebSettings;.setAllowUniversalAccessFromFileURLs + @TargetApi(16) + private static class Level16Apis { + static void enableUniversalAccess(WebSettings settings) { + settings.setAllowUniversalAccessFromFileURLs(true); + } + } }