Mehdisouid / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

GoogleAuthUtil.getToken() deadlock #683

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Developing an app for Android using Google Play Services 2.0, the Drive SDK and 
google-api-client-android-1.12.0-beta.jar. Occasionally, the app will deadlock 
and I see the following stack in Eclipse after breaking:

        Thread [<15> AsyncTask #1] (Suspended)  
            Object.wait(long, int) line: not available [native method]  
            Thread.parkFor(long) line: 1231 
            Unsafe.park(boolean, long) line: 323    
            LockSupport.park(Object) line: 157  
            AbstractQueuedSynchronizer$ConditionObject.await() line: 2022   
            LinkedBlockingQueue.take() line: 413    
            ao$a.a(Context, String, int) line: not available    
            ao.i(Context) line: not available   
            GoogleAuthUtil.getToken(Context, String, String, Bundle) line: not available    
            GoogleAuthUtil.getToken(Context, String, String) line: not available    
            GoogleAccountCredential.getToken() line: 192    
            GoogleAccountCredential$RequestHandler.intercept(HttpRequest) line: 217 
            HttpRequest.execute() line: 859 

What are the possible causes for this and how can I avoid it?

Original issue reported on code.google.com by d4ma...@gmail.com on 12 Dec 2012 at 5:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am wondering if this issue may be caused by using a GoogleAccountCredential 
to access the Drive API in an IntentService. GoogleAccountCredential calls 
GoogleAuthUtil.getToken(), which could cause a UserRecoverableAuthException. 
Since there is no way to directly interact with the user from the IntentService 
(other than a Notification), then perhaps GoogleAuthUtil.getToken() is getting 
stuck when it needs the user to confirm access to the account? Thoughts?

Original comment by d4ma...@gmail.com on 18 Dec 2012 at 9:27