Obsolete
Status Update
Comments
ni...@gmail.com <ni...@gmail.com> #2
For now I am working around this issue by checking isCanceled and isDone on the returned AccountManagerFuture in my Activity's onResume method. If the future is still blocked, I cancel it. I have observed that onResume is invoked after the call to AccountManager.getResult() returns in the case of a user entering either a valid or invalid password. Unfortunately, I don't know if that will always be true. If onResume were to be invoked before getResult returns, my code would break in the case of a successful auth. Any workaround advice is appreciated.
pl...@gmail.com <pl...@gmail.com> #3
I was just dealing with this problem myself. The callback is never called (and the Future will never be "done") if user intervention is required, and it would seem to be by design.
As an alternative, I am now using "getAuthToken(Account, String, android.os.Bundle, boolean, AccountManagerCallback, android.os.Handler)". It always calls the callback and puts the Future in a reasonable state. If the returned bundle contains the auth token you know it succeeded, and if it contains an Intent you know user intervention is required and you can start the intent with that knowledge.
As an alternative, I am now using "getAuthToken(Account, String, android.os.Bundle, boolean, AccountManagerCallback, android.os.Handler)". It always calls the callback and puts the Future in a reasonable state. If the returned bundle contains the auth token you know it succeeded, and if it contains an Intent you know user intervention is required and you can start the intent with that knowledge.
en...@google.com <en...@google.com>
mo...@googlemail.com <mo...@googlemail.com> #4
Is this fixed in Lollipop?
It's not fixed in 4.4.4, I was wrestling with it last week; I agree with the first two comments my workaround rather hacky involving queuing a Runnable to be executed by the Activity's onResume().
One of my Nexus5-owning testers complained they ran into this after updating to Lollipop, I've not confirmed it myself yet though.
It is odd the issue only has 4 stars though, maybe everyone else knows something we don't!?
It's not fixed in 4.4.4, I was wrestling with it last week; I agree with the first two comments my workaround rather hacky involving queuing a Runnable to be executed by the Activity's onResume().
One of my Nexus5-owning testers complained they ran into this after updating to Lollipop, I've not confirmed it myself yet though.
It is odd the issue only has 4 stars though, maybe everyone else knows something we don't!?
ku...@gmail.com <ku...@gmail.com> #5
I was facing the same issue on 4.4.4 and 4.4.2 but it worked after factory reset. Its wired.
ja...@gmail.com <ja...@gmail.com> #6
im facing the same issue here. i used getAuthToken(Account, String, android.os.Bundle, boolean, AccountManagerCallback, android.os.Handler) and the future.getResult() is hang after i reset the authToken and try to getAuthToken later. if i did not reset the authToken, future.getResult() will always return bundle with authToken string.
Description
Steps:
From an Activity, start an AsyncTask
From the AsyncTask, call AccountManager.getAuthToken (Account account, String authTokenType, Bundle options, Activity activity, AccountManagerCallback<Bundle> callback, Handler handler)
From the AsyncTask, call AccountManagerFuture.getResult() on the Future returned from getAuthToken
Tap the "back" button shown on the password activity launched by getAuthToken
Observed behavior:
The original Activity resumes, the AsyncTask never completes.
Expected behavior:
The JavaDoc indicates an OperationCanceledException will be thrown.