summaryrefslogtreecommitdiff
path: root/src/com/android/browser/Controller.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r--src/com/android/browser/Controller.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 7acdfe56..a2caf900 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -249,7 +249,14 @@ public class Controller
mUi.needsRestoreAllTabs())) {
// there is no quit on Android. But if we can't restore the state,
// we can treat it as a new Browser, remove the old session cookies.
- CookieManager.getInstance().removeSessionCookie();
+ AsyncTask cookieCleaningTask = new AsyncTask<Object, Void, Void>() {
+ protected Void doInBackground(Object... none) {
+ CookieManager.getInstance().removeSessionCookie();
+ return null;
+ }
+ };
+ cookieCleaningTask.execute();
+
// remove any incognito files
WebView.cleanupPrivateBrowsingFiles();
final Bundle extra = intent.getExtras();
@@ -277,6 +284,11 @@ public class Controller
}
}
+ // Wait for sessions cookies to be cleared before loading urls
+ try {
+ cookieCleaningTask.get();
+ } catch(InterruptedException e) {
+ } catch(java.util.concurrent.ExecutionException e) {}
if (urlData.isEmpty()) {
loadUrl(webView, mSettings.getHomePage());
} else {