summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-10-27 07:55:41 (GMT)
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-31 07:51:57 (GMT)
commit6b83f49effb4b69ec710866cf183f5bccea2dfae (patch)
treed2033041c595ff3d50661c57366e2178a58ef301
parent279db5cf167f886e38cfb75b40e7829e6da3256c (diff)
downloadconnman-6b83f49effb4b69ec710866cf183f5bccea2dfae.zip
connman-6b83f49effb4b69ec710866cf183f5bccea2dfae.tar.gz
connman-6b83f49effb4b69ec710866cf183f5bccea2dfae.tar.bz2
Tizen: Add always on feature
Run auto connection when default service is NULL, and it will not auto connect MMS cellular service. Change-Id: Ie2332b9014a900fc23afaac6d3759424dfd38e31
-rw-r--r--src/service.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index 4435916..b046514 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1412,6 +1412,24 @@ static void reset_stats(struct connman_service *service)
g_timer_reset(service->stats_roaming.timer);
}
+#if defined TIZEN_EXT
+static bool __connman_service_is_internet_profile(
+ struct connman_service *cellular)
+{
+ DBG("Service path: %s", cellular->path);
+
+ const char internet_suffix[] = "_1";
+ char *suffix = NULL;
+
+ suffix = strrchr(cellular->path, '_');
+ if (strcmp(suffix, internet_suffix) == 0)
+ return TRUE;
+
+ DBG("Not Internet profile.");
+ return FALSE;
+}
+#endif
+
struct connman_service *__connman_service_get_default(void)
{
struct connman_service *service;
@@ -1421,6 +1439,17 @@ struct connman_service *__connman_service_get_default(void)
service = service_list->data;
+#if defined TIZEN_EXT
+ if (service->type == CONNMAN_SERVICE_TYPE_CELLULAR &&
+ !__connman_service_is_internet_profile(service)) {
+
+ if (!service_list->next)
+ return NULL;
+
+ service = service_list->next->data;
+ }
+#endif
+
if (!is_connected(service))
return NULL;
@@ -3748,6 +3777,11 @@ static bool auto_connect_service(GList *services,
continue;
}
+#if defined TIZEN_EXT
+ if (service->type == CONNMAN_SERVICE_TYPE_CELLULAR &&
+ !__connman_service_is_internet_profile(service))
+ continue;
+#endif
DBG("service %p %s %s", service, service->name,
(preferred) ? "preferred" : reason2string(reason));
@@ -5528,6 +5562,10 @@ static int service_indicate_state(struct connman_service *service)
service_list_sort();
+#if defined TIZEN_EXT
+ if (!__connman_service_get_default())
+ __connman_service_auto_connect(CONNMAN_SERVICE_CONNECT_REASON_AUTO);
+#endif
__connman_connection_update_gateway();
if ((old_state == CONNMAN_SERVICE_STATE_ONLINE &&