I think I may have found an issue within the

My understanding is that to properly hold a device awake after an
alarm is triggered you have to aquire a WakeLock in the onReceive()
event, call a Service, then perform the work in the Service, releasing
the lock within the Service when complete.

http://groups.google.com/group/android-developers/browse_thread/thread/28bdb5f08ee93ec8/fb852bf905122546?lnk=gst&q=wakelock#fb852bf905122546

http://www.mail-archive.com/[email protected]/msg66837.html

This pattern can also be found in the CommonWare Advanced Android
Development book.

I tried this, but I found that the AlarmManager, when calling the
BroadcastReceiver, runs on a separate PID than the IntentService when
started from the BroadcastReceiver's onReceive() event.  This makes
the static variable on the lock manager.

I tried this, and my logs indicate that the PID is definately not the
same, and my understanding is that the DalikVM instances act like a
standard JVM, whereby objects and variables are no shared between
JVMs.

Furthermore, since the WakeLock is not serializable, there is really
no way to pass the reference to the lock via an "extra" in the Intent.

Has anyone else seen this pattern work or fail?  I have an example
project (with compiled APK) if you'd like to test it yourself, where
shall I post this?  I have tested this on the emulator on versions 1.6
and 2.0.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to