From ef18de60e02b4b2a7227d9e9751487cc74baec36 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Thu, 24 Feb 2011 13:54:23 -0500 Subject: Make sure timers are running during pre-login. Pause/resume timers is really broken. If the user exits the Browser, the process is still around with paused timers. If pre-login needs to run, timers will be stalled during the process. This is because there is no current tab during onResume. Make sure to call resumeTimers and start the cookie sync manager before handling pre-login. Bug: 3474608 Change-Id: I12be617947f3ae54a206e31760a2973f81252f50 --- src/com/android/browser/GoogleAccountLogin.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/com/android/browser/GoogleAccountLogin.java') diff --git a/src/com/android/browser/GoogleAccountLogin.java b/src/com/android/browser/GoogleAccountLogin.java index 3712490e0..f4ccfd1f7 100644 --- a/src/com/android/browser/GoogleAccountLogin.java +++ b/src/com/android/browser/GoogleAccountLogin.java @@ -41,6 +41,7 @@ import android.os.Handler; import android.preference.PreferenceManager; import android.util.Log; import android.webkit.CookieManager; +import android.webkit.CookieSyncManager; import android.webkit.WebView; import android.webkit.WebViewClient; @@ -86,6 +87,12 @@ public class GoogleAccountLogin implements Runnable, mWebView = new WebView(mActivity); mRunnable = runnable; + // XXX: Doing pre-login causes onResume to skip calling + // resumeWebViewTimers. So to avoid problems with timers not running, we + // duplicate the work here using the off-screen WebView. + CookieSyncManager.getInstance().startSync(); + mWebView.resumeTimers(); + mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { -- cgit v1.2.3