summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2011-02-24 13:54:23 -0500
committerPatrick Scott <phanna@android.com>2011-02-24 15:23:32 -0500
commitef18de60e02b4b2a7227d9e9751487cc74baec36 (patch)
treedd440da2790b1e3f67fbb8a3c2223bcb03bb9038 /src
parent29ccf8a32bf65a5512191d3633353132bb2cd88b (diff)
downloadpackages_apps_Browser-ef18de60e02b4b2a7227d9e9751487cc74baec36.tar.gz
packages_apps_Browser-ef18de60e02b4b2a7227d9e9751487cc74baec36.tar.bz2
packages_apps_Browser-ef18de60e02b4b2a7227d9e9751487cc74baec36.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/GoogleAccountLogin.java7
1 files changed, 7 insertions, 0 deletions
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) {