| Summary: | Deadlock in android after locking screen | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Alexey <alexey.petruchik> |
| Component: | *don't know* | Assignee: | Gabriel Jacobo <gabomdq> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | gabomdq |
| Version: | 2.0.0 | Keywords: | target-2.0.0 |
| Hardware: | All | ||
| OS: | Android (All) | ||
| Attachments: | Wait for more events before blocking | ||
|
Description
Alexey
2013-08-08 11:09:39 UTC
*** Bug 2023 has been marked as a duplicate of this bug. *** Created attachment 1276 [details]
Wait for more events before blocking
Let me know if this patch fixes things. Thanks!
This patch really fixes missing SDL_APP_DIDENTERBACKGROUND. But the real issue is deadlock upon screen lock caused by onDestroy(). After some search I found solution. Activity is destroyed because after screen lock screen orientation changes from landscape to portrait. To disable activity recreation we need add line to AndroidManifest.xml: android:configChanges="orientation|keyboardHidden|screenSize" More details here: http://stackoverflow.com/questions/16771319/android-activity-ondestroy-called-on-screen-lock http://stackoverflow.com/questions/9948315/activity-lifecycle-x-power-button-x-lock-screen This should fix it: http://hg.libsdl.org/SDL/rev/171a7ab71f28 Instead of pausing/resuming on surfaceChanged, we only pause/resume on onWindowFocusChanged. I was able to reproduce and fix the problem in my phone, and as far as I could tell there were no side effects to this patch, but please feel free to reopen if something got broken because of this change. |