Wednesday, 11 September 2013

Decipher - Excessive wake lock

Decipher - Excessive wake lock

I am getting message in log as below and then app is dying:
Excessive wake lock in domain.mobile.app.MusicPlayer pid zzz held xxxx
during yyyy
My application is a music player. I didn't obtain any wake lock in initial
version and player kept playing for hours without any stop. Then I decide
to make things clever and added the wake lock. So far so good, player
didn't change playing pattern if I play big music fragment for example CD
image with duration of 74 minutes. However if I split the images on tracks
and release and obtain lock for every separate track, I am getting a
message as in subject approximately after 30 minutes playiback and my
application gets ejected. As work around I can simply return to my
original idea to do not use the lock. However I obtained a curiosity why
it behaves in this way and what numbers in error message mean, perhaps it
will give me some clue. more details : I am obtaining PARTIAL_WAKE_LOCK
once and then play with acquire and release during track changing.
Interesting that some gentleman was complaining about stopping app doing
network communication here Application running in background getting
closed due to Excessive Wake lock error I have a solution for him, since
in my cases phone can keep connection in active state for hours, but
unfortunately I am black out from answering questions.
Attention experts moderators of the system, I highly respect your
experience and unbelievable brain power but be even smarter and do not try
to point me to some other questions and tell it is duplicate, ok?

No comments:

Post a Comment