当屏幕关闭时,Android是否会降低下载速度?

我观察到,如果我使用wget与screen on应用程序,我可以更快地下载一个文件,
在没有本应用程序的情况下获得screen dim wake lock而不是做同样的事情
屏幕关闭..我下载完全相同的文件(从我的apache网络服务器),当我在应用程序上使用屏幕时,时间几乎是两倍.要下载文件我使用移植版本的wget ..这是我的问题:

当屏幕关闭时,Android是否会降低下载速度?

或者由于应用程序上的屏幕获取了一个唤醒锁,迫使CPU始终处于开启状态,因此更多的CPU周期用于下载过程..我有点困惑..

最佳答案
简短的答案是肯定的,Android有时会在屏幕关闭时降低下载速度.据this Android bug report(由90位用户主演),

It seems that, even with “Wifi Sleep Policy” set to “Never”, the wifi on some Android devices will enter Power Save mode (a.k.a. PSP mode) when the screen turns off.

PSP mode apparently causes the wifi device to sleep, but wake up periodically and ask its access point to deliver packets that were addressed to to the device while it was asleep. This necessarily causes additional, “spiky” network latency. This additional latency means that some network-oriented applications experience problems when the screen turns off.

这或多或少与您所描述的行为相关.此问题仅影响一些手机,而不是全部,仅影响一些Android版本.我建议你访问上面的错误报告,这个问题有很长的讨论.

如何解决这个问题

至少有一个Android 2.3的解决方法:您需要获取WIFI_MODE_HIGH_PERF lock

In this Wi-Fi lock mode, Wi-Fi will be kept active as in mode WIFI_MODE_FULL but it operates at high performance with minimum packet loss and low packet latency even when the device screen is off. This mode will consume more power and hence should be used only when there is a need for such an active connection.

Android中的CPU时钟缩放

Android基于Linux内核,并使用CPUFreq Governors调整CPU频率以节省电池.确切的政策和频率因供应商而异,并可能会发生变化.还有utilities可以让您调整这些策略,但都需要rooted手机.通常,Android手机降低CPU频率,并在屏幕关闭时使用“powersave”调速器.

但是,我不认为手机上的网络流量是CPU限制的.也就是说,即使在电力安全模式下,网络吞吐量也是瓶颈,而不是CPU速度.

转载注明原文:当屏幕关闭时,Android是否会降低下载速度? - 代码日志