I have inspected provided links, android source codes, internal crash analytics and it seems that problem exists only on android 4.0 - 4.0.4. I have tested my suggestion on android 2.3.6, 4.0.3, 4.4.2 and it seems to be correct. So i finished with following workaround for this issue:
package com.android.example;
import android.content.Context;
import android.os.Build;
public class WebViewUtil {
private static final String WEBVIEW_DATABASE_FILE = "webview.db";
public static boolean isWebViewCorrupted(Context context) {
try {
int currentSdk = Build.VERSION.SDK_INT;
if (currentSdk == Build.VERSION_CODES.ICE_CREAM_SANDWICH
|| currentSdk == Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
try {
context.openOrCreateDatabase(WEBVIEW_DATABASE_FILE, 0, null);
} catch (Throwable t) {
// try again by deleting the old db and create a new one
context.deleteDatabase(WEBVIEW_DATABASE_FILE);
context.openOrCreateDatabase(WEBVIEW_DATABASE_FILE, 0, null);
}
}
return false;
} catch (Throwable t) {
}
return true;
}
}