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>
{
struct connman_device *device;
struct telephony_modem *modem;
+ struct telephony_service *service;
DBG("network %p", 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;