From 18877bf80e7b8c779f5a949d5717ee61e76f37ae Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Thu, 4 Apr 2013 16:05:35 -0700 Subject: [PATCH] Adding additional condition that the phone must be made by HTC for the setNavDump to be set to true to try and work around CB-2907, if it's still a problem on HTC devices running Android 2.2, that's just the luck of the draw. --- framework/src/org/apache/cordova/CordovaWebView.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index e653a95c..60a46a35 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -24,6 +24,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.Stack; +import java.util.regex.Pattern; import org.apache.cordova.Config; import org.apache.cordova.api.CordovaInterface; @@ -237,7 +238,11 @@ public class CordovaWebView extends WebView { // Set the nav dump for HTC 2.x devices (disabling for ICS, deprecated entirely for Jellybean 4.2) try { Method gingerbread_getMethod = WebSettings.class.getMethod("setNavDump", new Class[] { boolean.class }); - if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) + + String manufacturer = android.os.Build.MANUFACTURER; + Log.d(TAG, "CordovaWebView is running on device made by: " + manufacturer); + if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB && + android.os.Build.MANUFACTURER.contains("HTC")) { gingerbread_getMethod.invoke(settings, true); }