mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
CB-6971 Fix infinite recursion for onReceiveError
This commit is contained in:
parent
693ec14df5
commit
3a9898a6a6
@ -480,7 +480,7 @@ public class AndroidWebView extends WebView implements CordovaWebView {
|
||||
me.stopLoading();
|
||||
LOG.e(TAG, "CordovaWebView: TIMEOUT ERROR!");
|
||||
if (viewClient != null) {
|
||||
viewClient.onReceivedError(me, -6, "The connection to the server was unsuccessful.", url);
|
||||
viewClient.onReceivedError(-6, "The connection to the server was unsuccessful.", url);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -59,7 +59,7 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie
|
||||
private static final String TAG = "CordovaWebViewClient";
|
||||
private static final String CORDOVA_EXEC_URL_PREFIX = "http://cdv_exec/";
|
||||
CordovaInterface cordova;
|
||||
CordovaWebView appView;
|
||||
AndroidWebView appView;
|
||||
private boolean doClearHistory = false;
|
||||
boolean isCurrentlyLoading;
|
||||
|
||||
@ -81,7 +81,7 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie
|
||||
* @param cordova
|
||||
* @param view
|
||||
*/
|
||||
public AndroidWebViewClient(CordovaInterface cordova, CordovaWebView view) {
|
||||
public AndroidWebViewClient(CordovaInterface cordova, AndroidWebView view) {
|
||||
this.cordova = cordova;
|
||||
this.appView = view;
|
||||
}
|
||||
@ -91,7 +91,7 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
public void setWebView(CordovaWebView view) {
|
||||
public void setWebView(AndroidWebView view) {
|
||||
this.appView = view;
|
||||
}
|
||||
|
||||
@ -483,14 +483,8 @@ public class AndroidWebViewClient extends WebViewClient implements CordovaWebVie
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(CordovaWebView me, int i, String string,
|
||||
String url) {
|
||||
// Only deal with this if we're dealing with a proper classic webview.
|
||||
if(WebView.class.isInstance(me))
|
||||
{
|
||||
this.onReceivedError(me, i, string, url);
|
||||
}
|
||||
|
||||
public void onReceivedError(int errorCode, String description, String url) {
|
||||
this.onReceivedError(appView, errorCode, description, url);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -299,8 +299,6 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
|
||||
this.appView.setWebViewClient(webViewClient);
|
||||
this.appView.setWebChromeClient(webChromeClient);
|
||||
webViewClient.setWebView(this.appView);
|
||||
webChromeClient.setWebView(this.appView);
|
||||
|
||||
this.appView.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
|
@ -1,9 +1,5 @@
|
||||
package org.apache.cordova;
|
||||
|
||||
public interface CordovaWebViewClient {
|
||||
|
||||
void setWebView(CordovaWebView appView);
|
||||
|
||||
void onReceivedError(CordovaWebView me, int i, String string, String url);
|
||||
|
||||
void onReceivedError(int errorCode, String description, String url);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class IceCreamCordovaWebViewClient extends AndroidWebViewClient implement
|
||||
super(cordova);
|
||||
}
|
||||
|
||||
public IceCreamCordovaWebViewClient(CordovaInterface cordova, CordovaWebView view) {
|
||||
public IceCreamCordovaWebViewClient(CordovaInterface cordova, AndroidWebView view) {
|
||||
super(cordova, view);
|
||||
}
|
||||
|
||||
@ -97,10 +97,4 @@ public class IceCreamCordovaWebViewClient extends AndroidWebViewClient implement
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedError(CordovaWebView me, int i, String string,
|
||||
String url) {
|
||||
super.onReceivedError(me, i, string, url);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user