OSDN Git Service

Fix for 10530176 - CookieSyncManager must be created by WebView c'tor
authorJonathan Dixon <joth@google.com>
Thu, 29 Aug 2013 03:29:39 +0000 (20:29 -0700)
committerJonathan Dixon <joth@google.com>
Thu, 29 Aug 2013 03:29:39 +0000 (20:29 -0700)
WebViewClassic created the CookieSyncManager instane as a side effect of
starting up its internal WebCoreThread. As this forms part of th API
contract (app doesn't need to call CookieSyncManager.createInstance if
it already made a WebView instance) promote this logic up to the API
layer.

Change-Id: I0e92d97be987dfef90162ad379c79b066aae34e0

core/java/android/webkit/WebView.java

index 1b57d50..3923539 100644 (file)
@@ -498,6 +498,8 @@ public class WebView extends AbsoluteLayout
 
         ensureProviderCreated();
         mProvider.init(javaScriptInterfaces, privateBrowsing);
+        // Post condition of creating a webview is the CookieSyncManager instance exists.
+        CookieSyncManager.createInstance(getContext());
     }
 
     /**