SDL/android-project
Ryan C. Gordon 366adae360 android: More robust fix for screen locking in landscape (thanks, Sylvain!).
Fixes Bugzilla #3562.

From Sylvain:

"With an android landscape application, if you quickly lock, then unlock your
device, you can see sometimes a quick glitch: screen badly draws in portrait,
then it correctly displays in landscape.

Not talking of a smooth rotation, it's a drawing glitch. And you need to have
a plain lock screen, with no model nor passphrase.


I think it happens because the call to "nativeResume()" occurs sometimes too
early.

It should be done once you have *all* those three things (in any sequence):
- onWindowsFocusChanged() set to true
- onResume() called
- a valid call to onSurfaceChanged()


Currently, this is not the case: you don't need to have onResume() called.
Just need to have isPaused, (eg onPaused()).
So "isPaused" should be renamed as "isResumedCalled".
But you also need some kind of isPaused state to make sure to don't call
nativePause() twice (and deadlocks...).
There are also redundant checks to "mHasFocus" and some creation of the
initialisation thread code from onSurfaceChanged() that could me moved.

So here's this patch:
- add some states, so we have cleaner transitions.
- make sure "onResume()" is called.
- some clean up
- it also goes faster in pause state (focus changed, onPause, without requiring isSurfaceReady which does seems to be needed).


Tested on a few devices and it removes the glitch.
But I haven't tested when the activity goes back to "init" state."
2017-04-07 20:17:30 -04:00
..
jni Fixed bug 2758 - Android issues with NDK r10c and API-21 2016-10-14 06:57:55 -07:00
res Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
src/org/libsdl/app android: More robust fix for screen locking in landscape (thanks, Sylvain!). 2017-04-07 20:17:30 -04:00
AndroidManifest.xml android: implement audio capture support. 2016-08-11 22:04:49 -04:00
ant.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
build.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
build.xml Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
default.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
proguard-project.txt Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
project.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00