I have a service that launches a download stream that sometimes downloads large files. I realized that as soon as the phone falls asleep, the download flow will slow down significantly, and then stop.
Obvious remedy, wakeles. Therefore, I would think that it would be normal to get partial_wake_lock, just for the processor to handle the load. This does not work, though, with the same behavior, loading slows down and then stops when the screen turns off.
Then I tried screen_dim_wake_lock. This time the screen remained (darkened), and the download continued until full speed, until it was done, wakelock was released, and then the phone slept.
My question is, why can I not continue to work in the stream if I hold partial_wake_lock the same way as during screen_dim_wake_lock? Is there any undocumented behavior regarding the difference between the two? Is it because I may not be working in the user interface thread?
EDIT:
I added wifilock. Wi-Fi doesn't go to bed, but my thread is still dying. If any other process wakes up the system, the download will continue at normal speed and then slow down. If I wake up on the phone, it will continue at a normal speed than at a slow pace when the screen goes blank. It seems that the flow is superimposed on the background by the system. I wonder if I can prevent this.
Jonathan S.
source share