diff options
author | guoqiang.liu <guoqiang.liu@archermind.com> | 2013-12-27 14:22:52 +0800 |
---|---|---|
committer | guoqiang.liu <guoqiang.liu@archermind.com> | 2014-01-09 11:42:12 +0800 |
commit | 53079821adda0c10c25306eb3fe1db252c517884 (patch) | |
tree | 3bf61876d9d7279f6f0665b382882facb21e0680 | |
parent | 7a3541b4f5e6d21fa39385bc9c12cb0e3b377358 (diff) | |
download | connman-53079821adda0c10c25306eb3fe1db252c517884.tar.gz connman-53079821adda0c10c25306eb3fe1db252c517884.tar.bz2 connman-53079821adda0c10c25306eb3fe1db252c517884.zip |
telephony: Check some flag before active context
Active maybe failed if data_allowed or ps_attached is false, so
check is before actived
When data_allowed is false, connman will start auto connect. if
connman connect 3G service, it will result in service state failure
And it will not connect it next time.
Change-Id: Ibdd9c34fee7a612c1788a364c69550c4f7e79123
Signed-off-by: guoqiang.liu <guoqiang.liu@archermind.com>
-rw-r--r-- | plugins/telephony.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/telephony.c b/plugins/telephony.c index 57888be0..4234a627 100644 --- a/plugins/telephony.c +++ b/plugins/telephony.c @@ -323,6 +323,7 @@ static int __network_connect(struct connman_network *network) { struct connman_device *device; struct telephony_modem *modem; + struct telephony_service *service; DBG("network %p", network); @@ -334,9 +335,16 @@ static int __network_connect(struct connman_network *network) if (modem == NULL) return -ENODEV; + service = modem->s_service; + if (service == NULL) + return -ENOLINK; + if (modem->powered == FALSE) return -ENOLINK; + if (modem->data_allowed == FALSE || service->ps_attached == FALSE) + return -ENOLINK; + /* if (modem->online == FALSE) return -ENOLINK; |