kuangzhenglin / gcm

Automatically exported from code.google.com/p/gcm
Apache License 2.0
0 stars 0 forks source link

WakeLock under-locked GCM_LIB issue. #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My app uses gcm-android library r3 and
I've got a few error reports about this error.

java.lang.RuntimeException: WakeLock under-locked GCM_LIB
at android.os.PowerManager$WakeLock.release(PowerManager.java:325)
at android.os.PowerManager$WakeLock.release(PowerManager.java:300)
at 
com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.
java:252)

I used same way as sample and when I saw the gcm source this couldn't happen, 
but... it seems it does.

Am I using it wrong or is it gcm but?

Original issue reported on code.google.com by noranb...@gmail.com on 31 Mar 2013 at 8:54

GoogleCodeExporter commented 9 years ago
Sorry for typo in the last line.
 -> Am I using it wrong or is it gcm bug?

Original comment by noranb...@gmail.com on 31 Mar 2013 at 8:55

GoogleCodeExporter commented 9 years ago
I saw a related post.
https://groups.google.com/d/msg/cw-android/lxa8EBznL7Q/nTiCgku1Qy4J
The interesting scenario is,
-- You acquire the static lock in a BroadcastReceiver
-- You call startService() in the BroadcastReceiver
-- Android creates and starts the service *in a different process*
(e.g., Android terminated the process that held the BroadcastReceiver)
-- The service tries to unlock and gets this error, because we're using
a different WakeLock object, because we're in a different process.

Is this possible case? If it is, what is the solution?

Original comment by noranb...@gmail.com on 4 Apr 2013 at 6:30