So focusing on the fact that the listener is being invoked, doesn't this 
mean Android is being woken up specifically to handle the signal updates? 

Also, now that you mention wake-locks, isn't registering a 
phonestatelistener similar to a boardcast receiver? For the latter, I have 
been made to believe that the receiver function will internally have a lock 
already in place, and as long as it doesn't create a new thread to do its 
work, it should be good. Doesn't this also apply to the callback function 
of the state listener?

Thanks.

On Friday, August 24, 2012 12:24:13 AM UTC+3, Dianne Hackborn wrote:
>
> Are you holding a wake lock?  If not, you have no guarantees about how 
> much stuff will run to give you such reports.  The difference between these 
> two devices could simply be that one of the devices has more stuff running 
> that is holding wake locks to let you run more as a side-effect.  (That 
> said, this only applies if the device is running on battery.  While plugged 
> in Android holds a wake lock to keep the CPU from sleeping.)
>
> On Thu, Aug 23, 2012 at 2:20 PM, sebouh00 <[email protected] <javascript:>
> > wrote:
>
>> It would be good if someone can back me up, but I think it doesn't matter 
>> if I register a listener or not. The RIL will send up the update and 
>> Android has to wake up and handle it. Then from what I see in the 
>> TelephoneRegistry class, it has to check for registered records and call 
>> their callback function.
>>
>> If so, my question would be: wouldn't this be killing the battery if 
>> there are constant signal or cell updates, say if the device is moving fast 
>> from one cell to the other? The device would never have the chance to sleep.
>>
>>
>> On Wednesday, August 22, 2012 11:33:40 PM UTC+3, sebouh00 wrote:
>>>
>>> Hi. I'm wondering if anyone can explain to me the following.
>>>
>>> I have two devices, an HTC Desire and a Samsung Galaxy Nexus. I have the 
>>> same app running on both. The app has a foreground service listening to 
>>> Cell Location and Signal Strength updates by registering to the 
>>> PhoneStateListener.
>>>
>>> Both work similarly when the phone is fully awake. When the phones go to 
>>> sleep, the nexus keeps updating the signal strength (and sometimes the cell 
>>> location) but the Desire stops. This I reckon is due to how each RIL is 
>>> handling the SCREEN_OFF intent.
>>>
>>> What I would like to understand is, what is the effect of the 
>>> cell/signal updates on the nexus when the phone is sleep. I have a logger 
>>> in the listener and I keep getting update logs during sleep.
>>>
>>> 1) Does this mean Android is waking up on each signal strength update?
>>> 2) If I deregister from this listener on screen off, will Android still 
>>> wake up because of the way the RIL is implemented?
>>>
>>> I don't hold any cpu locks inside the listener.
>>>
>>> Thanks.
>>>
>>  -- 
>> 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]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>
>
> -- 
> Dianne Hackborn
> Android framework engineer
> [email protected] <javascript:>
>
> Note: please don't send private questions to me, as I don't have time to 
> provide private support, and so won't reply to such e-mails.  All such 
> questions should be posted on public forums, where I and others can see and 
> answer them.
>
>

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