开发者

HTTPS via HttpClient during a Service failing on gingerbread

开发者 https://www.devze.com 2023-02-08 11:27 出处:网络
I\'ve got a strange problem ... My service that uses HTTPS via HttpClient almost always fails on Gingerbread when the screen is turned off and USB/power disconnected. The error is javax.net.ssl.SSLP

I've got a strange problem ...

My service that uses HTTPS via HttpClient almost always fails on Gingerbread when the screen is turned off and USB/power disconnected. The error is javax.net.ssl.SSLPeerUnverifiedException.

Never saw this behaviour with Froyo or older, and of course can't repro in emulator as can't disconnect power or turn off screen.

Also, seems to be only failing when using mobile data. Wifi (set to always on) seems to work fine.

My phone is a CyanogenMod7/HTC Hero. This is the only gingerbread I have available to test on. Works fine on friends Froyo and Eclair

Have tried extending timeouts with

HttpConnectionParams.setConnectionTimeout(httpClientParams,3*60*1000);
HttpConnectionPara开发者_如何学编程ms.setSoTimeout(httpClientParams,3*60*1000);

but didn't help.

feels like gingerbread or CM7 has added some sleep low power stuff that screws with me?

any ideas?


Yes, power management was improved in 2.3... it's more aggressive about suspending non-foreground processes while the screen's off.

I suspect you will need to acquire a partial wakelock for the duration of your network usage.

0

精彩评论

暂无评论...
验证码 换一张
取 消