OSDN Git Service

Fix CookieSyncManager for WebViewClassic
authorJonathan Dixon <joth@google.com>
Fri, 4 Oct 2013 12:01:47 +0000 (13:01 +0100)
committerJonathan Dixon <joth@google.com>
Fri, 4 Oct 2013 13:23:47 +0000 (14:23 +0100)
Add a workaround to ensure that the WebViewDatabase and JniUtil can
still be initialized as side effect of making a CookieSyncManager

This was collateral damage from the fixes for Bug 10932261

Change-Id: If5ba65a7822d5b0afc14139dd84125058bf96897

core/java/android/webkit/CookieSyncManager.java

index 13aa43f..154a290 100644 (file)
@@ -89,6 +89,10 @@ public final class CookieSyncManager extends WebSyncManager {
         if (context == null) {
             throw new IllegalArgumentException("Invalid context argument");
         }
+        // TODO: Remove this workaround after webview classic is no longer supported.
+        if (WebViewFactory.getProvider().getClass().getName().contains("WebViewClassic")) {
+            WebViewDatabase.getInstance(context);
+        }
 
         setGetInstanceIsAllowed();
         return getInstance();