On Friday, May 11, 2012 4:57:35 AM UTC-7, ste1024 wrote:
 

> Sorry for digging up this ancient topic, but an trying to find an answer 
> to the same question.
> In my app so I am able to receive location updates even if I put the 
> device to sleep, without explicitly holding a WakeLock.
> I came across what appears to be the Android 2.2 source of the 
> GpsLocationProvider<http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/location/GpsLocationProvider.java/?v=source>,
>  
> and assuming I did not misinterpret the code, it looks like it is really 
> able to wake up the device via the AlarmManager.
>
> Can anyone confirm this?
>

I am experiencing the same thing. My GPS app runs for hours and hours 
getting coordinates every 6 seconds, whether it's asleep or not. Either 
WakeLock is not needed for the LocationManager to work non-stop or one of 
the other apps I have installed is using WakeLock. I'm assuming the latter, 
since I have Tasker and AutomateIt running, both off which are time-based 
services. I guess I should check their permissions for WakeLock. Or they 
could just be waking the CPU via the AlarmManager?

It makes me wonder if it's necessary for me to add a WakeLock to my app or 
just rely on the fact that other apps will keep the CPU alive for me.

-- 
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