Merge "[SPIN] Enable the ntp by connman if device does not use the cellular." into...
[platform/upstream/connman.git] / src / service.c
index 1ee4c4c..ca29119 100755 (executable)
@@ -472,6 +472,7 @@ connman_service_is_user_allowed(struct connman_service *service, uid_t uid)
        return true;
 }
 
+#if !defined TIZEN_EXT
 static GList *connman_service_get_login_users()
 {
        struct utmpx *utmp;
@@ -497,9 +498,13 @@ static GList *connman_service_get_login_users()
 
        return user_list;
 }
+#endif
 
 static bool is_service_owner_user_login(struct connman_service *service)
 {
+#if defined TIZEN_EXT
+       return true;
+#else
        GList *list, *user_list;
        bool ret = false;
 
@@ -529,6 +534,7 @@ static bool is_service_owner_user_login(struct connman_service *service)
        g_list_free(user_list);
 
        return ret;
+#endif
 }
 
 int __connman_service_load_modifiable(struct connman_service *service)
@@ -674,6 +680,8 @@ static int service_load(struct connman_service *service)
 
                                connman_network_set_blob(service->network,
                                        "WiFi.SSID", ssid, hex_ssid_len / 2);
+
+                               g_free(ssid);
                        }
 
                        g_free(hex_ssid);
@@ -1888,8 +1896,10 @@ static void state_changed(struct connman_service *service)
        if (!str)
                return;
 
+#if !defined TIZEN_EXT
        if (!allow_property_changed(service))
                return;
+#endif
 
        connman_dbus_property_changed_basic(service->path,
                                CONNMAN_SERVICE_INTERFACE, "State",
@@ -2708,11 +2718,13 @@ static void append_wifi_ext_info(DBusMessageIter *dict,
        unsigned int maxrate;
        uint16_t frequency;
        const char *enc_mode;
+       gboolean passpoint;
 
        bssid = connman_network_get_bssid(network);
        maxrate = connman_network_get_maxrate(network);
        frequency = connman_network_get_frequency(network);
        enc_mode = connman_network_get_enc_mode(network);
+       passpoint = connman_network_get_is_hs20AP(network);
 
        snprintf(bssid_str, WIFI_BSSID_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x",
                                bssid[0], bssid[1], bssid[2],
@@ -2726,6 +2738,8 @@ static void append_wifi_ext_info(DBusMessageIter *dict,
                                        DBUS_TYPE_UINT16, &frequency);
        connman_dbus_dict_append_basic(dict, "EncryptionMode",
                                        DBUS_TYPE_STRING, &enc_mode);
+       connman_dbus_dict_append_basic(dict, "Passpoint",
+                                       DBUS_TYPE_BOOLEAN, &passpoint);
 }
 #endif
 
@@ -5136,6 +5150,10 @@ static void service_schedule_removed(struct connman_service *service)
 
 static bool allow_property_changed(struct connman_service *service)
 {
+#if defined TIZEN_EXT
+       if (service->path == NULL)
+               return FALSE;
+#endif
        if (g_hash_table_lookup_extended(services_notify->add, service->path,
                                        NULL, NULL)) {
                DBG("no property updates for service %p", service);
@@ -6224,6 +6242,11 @@ static void single_connected_tech(struct connman_service *allowed)
 
        DBG("keeping %p %s", allowed, allowed->path);
 
+#if defined TIZEN_EXT
+       if (!allowed || allowed->type == CONNMAN_SERVICE_TYPE_CELLULAR)
+               return;
+#endif
+
        for (iter = service_list; iter; iter = iter->next) {
                service = iter->data;
 
@@ -6833,6 +6856,19 @@ int __connman_service_ipconfig_indicate_state(struct connman_service *service,
                        is_connected_state(service, new_state))
                nameserver_add_all(service);
 
+#if defined TIZEN_EXT
+       int ret = service_indicate_state(service);
+       /*Sent the Ready changed signal again in case IPv4 IP set
+         after IPv6 IP set*/
+
+       if(ret == -EALREADY && type == CONNMAN_IPCONFIG_TYPE_IPV4
+                       && new_state == CONNMAN_SERVICE_STATE_READY) {
+               DBG("Notify IPv4 state new/old %d/%d", new_state,old_state);
+               state_changed(service);
+       }
+
+       return ret;
+#endif
        return service_indicate_state(service);
 }