sgastudio / wagic

Automatically exported from code.google.com/p/wagic
Other
0 stars 0 forks source link

Wagic crashes when Android sleeps or screenlocks #876

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Play Wagic.
2. Put the phone down until the screen shuts off, or press the lock key.
3. Press the lock key again to turn the screen on. Unlock the phone.

What is the expected output?
The game of Wagic I was playing.
What do you see instead?
A black screen. I can wait indefinitely and never get the app to come back, 
however if I try to tap the screen several times, or if I press either of the 
Menu or Back soft keys, then about 5-10 seconds later I will get a system 
notification that the app is hung, do I want to Wait, Force Close, or Report? I 
have Haptic Feedback setting on (phone vibrates when pressing soft keys) and 
the vibrate is also delayed by quite a few seconds when the app is in this 
state.

What version of the product are you using?
0.18.6 core
On what operating system?
Android 2.3.5 Build EJ06 on Samsung Galaxy Prevail (SPH-M820-BST) kernel 
version 2.6.35.7

Please provide any additional information below.
I had been running Wagic 0.17.1 previously and it handled screen locks and 
device sleep just fine.

Original issue reported on code.google.com by Dansi...@gmail.com on 18 May 2012 at 3:58

GoogleCodeExporter commented 9 years ago
Same issue.
What steps will reproduce the problem?
1. Play Wagic.
2. Put the phone down until the screen shuts off, or press the lock key.
3. Press the lock key again to turn the screen on. Unlock the phone.

What is the expected output?
The game of Wagic I was playing.
What do you see instead?
A black screen. I can wait indefinitely and never get the app to come back, 
however if I try to tap the screen several times, or if I press either of the 
Menu or Back soft keys, then about 5-10 seconds later I will get a system 
notification that the app is hung, do I want to Wait, Force Close, or Report? I 
have Haptic Feedback setting on (phone vibrates when pressing soft keys) and 
the vibrate is also delayed by quite a few seconds when the app is in this 
state.

What version of the product are you using?
0.18.6 core
On what operating system?
Android 2.3.5 on Cyanogenmod 7.2 nightly on LG P500h (Otimus one)

Please provide any additional information below.
I had been running Wagic 0.17.1 previously and it handled screen locks and 
device sleep just fine.

Original comment by anic...@gmail.com on 21 May 2012 at 3:37

GoogleCodeExporter commented 9 years ago
Update: I have found that if I press the Home button prior to locking the 
screen, the app usually does survive. So the problem is only if the app is in 
the foreground when the phone sleeps.

Original comment by Dansi...@gmail.com on 24 May 2012 at 8:49

GoogleCodeExporter commented 9 years ago
Crap didn't see this before I submitted.  I found out that the game only 
crashes if the orientation is changed when in the lockscreen.  Otherwise Wagic 
survives, and resumes as normal.  

Original comment by Cameron....@gmail.com on 15 Jun 2012 at 11:18

GoogleCodeExporter commented 9 years ago
Just tested looking the screen while carefully holding the phone steadily in 
the one horizontal orientation, then unlocking the screen again. Wagic still 
crashes. I do remember reading that one new feature in 0.18.6 is that the app 
uses the orientation sensor, so it can be either side up. Perhaps that change 
is related to this problem? The lock screen is always a vertical orientation. I 
remember in 0.17.1 that when I unlocked the screen I would usually see, for a 
few seconds, the game screen drawn wrong, in a vertical orientation, then it 
would flip itself back to horizontal and be good to go.

Original comment by Dansi...@gmail.com on 15 Jun 2012 at 2:29

GoogleCodeExporter commented 9 years ago
It looks as though issue 886 and issue 894 are duplicates or at least very 
similar to this one.

Attached is a patch that I have tested on:
Nexus one - CyanogenMod 7.2.0 (Android 2.3.7)

Using this as a reference:
http://stackoverflow.com/questions/6772988/ondestroy-gets-called-each-time-the-s
creen-goes-on

Possible cause:
I believe that the issue may have been introduced in a previous fix for issue 
774 and issue 832 committed in r4405.

While testing I made sure that the orientation still flips when the device was 
tilted and it doesn't appear that the empty onConfigChanged() catch interferes 
with the accelerometer handling of orientation change.  The idea is that the 
empty onConfigChanged() simply stops the Activity from destroying/recreating 
(which caused "joining" the SDLThread) on device lock.

The added bonus, depending on opinion, is that now the Ad seems to display on 
screen where I never noticed it before.

Original comment by rolzad73@gmail.com on 15 Aug 2012 at 3:59

Attachments:

GoogleCodeExporter commented 9 years ago
There's an ad? </surprise>

Original comment by Dansi...@gmail.com on 15 Aug 2012 at 6:48

GoogleCodeExporter commented 9 years ago
Anyway, thanks so much for this. Kudos!

Original comment by Dansi...@gmail.com on 15 Aug 2012 at 6:50

GoogleCodeExporter commented 9 years ago

Original comment by omegabla...@gmail.com on 19 Aug 2012 at 10:30

GoogleCodeExporter commented 9 years ago
Zeth, the fix hasnt been submitted yet, has it?

Original comment by wagic.the.homebrew@gmail.com on 19 Aug 2012 at 10:48

GoogleCodeExporter commented 9 years ago
My bad, it has been submitted

Original comment by wagic.the.homebrew@gmail.com on 19 Aug 2012 at 10:49