Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Sample app problem with Leaked Window when Permission request is refused #57

Closed
wonderfly opened this issue Jan 9, 2015 · 2 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@wonderfly
Copy link
Contributor

From cumis...@gmail.com on December 30, 2011 13:40:09

Affects: all versions of google-http-java-client (problem is with the sample apps)

Java environment (Android 4.x)

when you start the sample Android app the account picker dialog is displayed as usual. If you select an account and then pick 'No, thanks' at the Account Manager generated Permission Request dialog the app crashes with a leaked window. If you select 'Allow access' the app proceeds as designed.

It looks like the app is failing when trying to redisplay the account picker dialog. It's not an API bug but a problem with the sample app. Here is my LogCat of the failure:

LogCat showing problem is attached.

Attachment: log.txt

Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=57

@wonderfly wonderfly self-assigned this Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From yan...@google.com on January 04, 2012 09:16:11

Labels: -Type-Defect -Priority-Medium Type-Sample Priority-High

@wonderfly
Copy link
Contributor Author

From cumis...@gmail.com on January 04, 2012 09:34:37

fyi I spent some more time on this yesterday.

The problem is not at the manager.getAuthToken(account, AUTH_TOKEN_TYPE, true, null, null).getResult(); line which seems to fire normally....instead the issue occurs when startActivityForResult(intent, REQUEST_AUTHENTICATE); is called.

For some reason rather than going into onPause() and waiting for the response from the Permission request dialog the UI thread goes straight through onStop() and onDestroy(). If the back key is pressed in the Permission request dialog or 'No thanks' selected then the activity reinitializes and everything goes nuts.

Posting the symptoms on Android Developer got a response from another dev who could NOT replicate the problem but who was using emulator rather than physical device....so I guess it could possibly be a setup issue.

I've managed to reproduce the problem on various levels of the SDK (8, 13, 14, 15) and using Eclipse v3.5 and 3.7. Exactly the same code works fine with Honeycomb or lower devices.

In my own app I've put in a rather kludgy workaround that sets a Boolean in the default preferences just before the startActivityForResult() is called and avoids restarting the auth process in onCreate() if that Boolean is set. The Boolean is cleared in onActivityResult(). This seems to work fine.

@wonderfly wonderfly removed their assignment May 20, 2016
@ejona86 ejona86 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. docs labels Feb 22, 2017
@mattwhisenhunt mattwhisenhunt added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed Priority-High labels Dec 11, 2017
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
@JustinBeckwith JustinBeckwith self-assigned this Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

5 participants