Index: chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
index fbd05efd33e71ad69644fc4b4cf7e980d6af0ea3..51b7c70e07929f49aa3e65e18f0c3b59d7b77e0a 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java |
@@ -156,11 +156,8 @@ public class ExternalAuthUtils { |
/** |
* Checks whether Google Play Services can be used, applying the specified error-handling |
- * policy if a user-recoverable error occurs. To avoid undue burden on the user, the error |
- * handling policy will be applied at most one time per browser startup (i.e., a dialog or |
- * a system notification). |
- * This method is threadsafe. If the specified error-handling policy requires UI interaction, |
- * an asynchronous task will be posted to the main thread to perform such interaction. |
+ * policy if a user-recoverable error occurs. This method is threadsafe. If the specified |
+ * error-handling policy requires UI interaction, it will be run on the UI thread. |
* @param context The current context. |
* @param errorHandler How to handle user-recoverable errors; must be non-null. |
* @return true if and only if Google Play Services can be used |
@@ -171,11 +168,16 @@ public class ExternalAuthUtils { |
if (errorCode == ConnectionResult.SUCCESS) { |
return true; // Hooray! |
} |
- // The rest of the method is error-handling bits. |
Log.v(TAG, "Unable to use Google Play Services: %s", |
GooglePlayServicesUtil.getErrorString(errorCode)); |
if (GooglePlayServicesUtil.isUserRecoverableError(errorCode)) { |
- ThreadUtils.runOnUiThread(errorHandler); |
+ Runnable errorHandlerTask = new Runnable() { |
+ @Override |
+ public void run() { |
+ errorHandler.handleError(context, errorCode); |
+ } |
+ }; |
+ ThreadUtils.runOnUiThread(errorHandlerTask); |
} |
return false; |
} |