summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguoqiang.liu <guoqiang.liu@archermind.com>2013-12-27 14:22:52 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-31 15:51:57 +0800
commit25fc1601c76f5ae060d3312657e8d6feebcb8406 (patch)
tree4d4c1109eaac3cb7278442fa249aeeade7bb4575
parent6b83f49effb4b69ec710866cf183f5bccea2dfae (diff)
downloadconnman-25fc1601c76f5ae060d3312657e8d6feebcb8406.tar.gz
connman-25fc1601c76f5ae060d3312657e8d6feebcb8406.tar.bz2
connman-25fc1601c76f5ae060d3312657e8d6feebcb8406.zip
Tizen: Check some telephony flags before active context
Telephony active maybe fail if data_allowed or ps_attached is false, so check it before actived. When data_allowed is false, if connman starts to auto connect 3G service, it will result in 3G service auto connected fail, which leads to it will not be auto connected next time. Change-Id: Ibdd9c34fee7a612c1788a364c69550c4f7e79123 Signed-off-by: guoqiang.liu <guoqiang.liu@archermind.com>
-rw-r--r--plugins/telephony.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/telephony.c b/plugins/telephony.c
index 63e7f6e3..ea0bf655 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;
+
return __request_network_activate(network);
}