Add mode to get technology state 65/232565/1 accepted/tizen/unified/20200507.052343 submit/tizen/20200506.120225
authorhyunuk.tak <hyunuk.tak@samsung.com>
Wed, 6 May 2020 09:58:10 +0000 (18:58 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Wed, 6 May 2020 09:58:16 +0000 (18:58 +0900)
Change-Id: I63cc9312452e7aafa679f521f504de682fa196de
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
include/wifi-state.h
src/signal-handler.c
src/wifi-background-scan.c
src/wifi-bssid-scan.c
src/wifi-power.c
src/wifi-state.c

index 4f75bb99c525215503ac5aa5d7fe4b0e3fcc9f41..ae39694773ad5a872c4804f38c60fd4ce91d4e7f 100755 (executable)
@@ -69,7 +69,7 @@ void                                  wifi_state_set_service_state(wifi_service_state_e new_state);
 wifi_service_state_e   wifi_state_get_service_state(void);
 
 void                                   wifi_state_set_tech_state(wifi_tech_state_e new_state);
-wifi_tech_state_e              wifi_state_get_technology_state(void);
+wifi_tech_state_e              wifi_state_get_technology_state(bool mode);
 gboolean                               wifi_state_is_technology_available(void);
 
 void                                   wifi_state_set_connected_essid(void);
index 3894c482a958bb2120126faf6d0353b6aedfc9fd..08fd2a84e6d088c46adcbdc6c6c7f5501992cca5 100755 (executable)
@@ -840,12 +840,12 @@ static void _supplicant_scan_done(GDBusConnection *conn,
 
        if (netconfig_wifi_is_bssid_scan_started() == TRUE) {
                netconfig_wifi_bssid_signal_scandone();
-               if (wifi_state_get_technology_state() < NETCONFIG_WIFI_TECH_POWERED)
+               if (wifi_state_get_technology_state(FALSE) < NETCONFIG_WIFI_TECH_POWERED)
                        return;
        }
 
        if (netconfig_wifi_get_bgscan_state() == TRUE) {
-               if (wifi_state_get_technology_state() >=
+               if (wifi_state_get_technology_state(FALSE) >=
                                NETCONFIG_WIFI_TECH_POWERED)
                        netconfig_wifi_bgscan_start(FALSE);
 
index 09874efe7f9e7fcddc83f43b6cd8d15018f3d60f..8c7f8925f73a67aa3827e77b2d6264d53ebc0d4d 100755 (executable)
@@ -248,7 +248,7 @@ void netconfig_wifi_bgscan_start(gboolean immediate_scan)
        if (data->timer_id > 0)
                __netconfig_wifi_bgscan_stop_timer(data);
 
-       wifi_tech_state = wifi_state_get_technology_state();
+       wifi_tech_state = wifi_state_get_technology_state(FALSE);
        wifi_service_state = wifi_state_get_service_state();
        DBG("wifi tech state [%s] service state [%s]",
                _convert_wifi_technology_state_to_string(wifi_tech_state),
index ea1d5928714132c303544c1eb1016c3521b73b52..d5804d5cba08601e6eb554c482583fe639b0a4d4 100755 (executable)
@@ -480,7 +480,7 @@ static int __netconfig_wifi_bssid_scan(void)
        if (netconfig_is_device_scanning == TRUE)
                return -EINPROGRESS;
 
-       wifi_tech_state = wifi_state_get_technology_state();
+       wifi_tech_state = wifi_state_get_technology_state(FALSE);
        if (wifi_tech_state <= NETCONFIG_WIFI_TECH_OFF)
                err = wifi_power_driver_and_supplicant(TRUE);
 
@@ -526,7 +526,7 @@ gboolean handle_request_bssid_scan(Wifi *wifi, GDBusMethodInvocation *context)
        }
 #endif
 
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(FALSE);
        if (tech_state <= NETCONFIG_WIFI_TECH_OFF) {
 #if !defined TIZEN_WEARABLE
                enabled = 1;
index 2226d3a4960679d71cd7e8abbf46f896f00c252a..be60606fa594aa25c1157e28a0710228a3486c18 100755 (executable)
@@ -175,7 +175,7 @@ static int _load_driver_and_supplicant(void)
        int err = 0;
        wifi_tech_state_e tech_state;
 
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(FALSE);
        if (tech_state > NETCONFIG_WIFI_TECH_OFF)
                return -EALREADY;
 
@@ -701,7 +701,7 @@ int wifi_power_on(void)
        int err = 0;
        wifi_tech_state_e tech_state;
 
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(TRUE);
        if (tech_state >= NETCONFIG_WIFI_TECH_POWERED) {
                /* There can be a scenario where wifi is automatically *
                 * activated by connman if wifi was powered in last boot. *
@@ -756,7 +756,7 @@ int wifi_power_on_wearable(gboolean device_picker_test)
        int err = 0;
        wifi_tech_state_e tech_state;
 
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(TRUE);
        if (tech_state >= NETCONFIG_WIFI_TECH_POWERED)
                return -EALREADY;
 
index c6b964fbb2a9de22fbcead757c889084176dac72..68cc0b7146dc664390405eec9cdd08048921d748 100755 (executable)
@@ -243,7 +243,7 @@ static gboolean _check_network_notification(gpointer data)
        wifi_tech_state_e tech_state;
        wifi_service_state_e service_state;
 
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(FALSE);
        if (tech_state < NETCONFIG_WIFI_TECH_POWERED) {
                DBG("Wi-Fi off or WPS only supported[%d]", tech_state);
                goto cleanup;
@@ -430,7 +430,7 @@ void wifi_state_update_power_state(gboolean powered)
         * DO NOT update manually
         * It includes Wi-Fi state configuration
         */
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(FALSE);
 
        if (powered == TRUE) {
                if (tech_state < NETCONFIG_WIFI_TECH_POWERED && netconfig_is_wifi_tethering_on() != TRUE) {
@@ -612,7 +612,7 @@ void wifi_state_set_tech_state(wifi_tech_state_e new_state)
                _convert_wifi_technology_state_to_string(old_state), _convert_wifi_technology_state_to_string(new_state));
 }
 
-wifi_tech_state_e wifi_state_get_technology_state(void)
+wifi_tech_state_e wifi_state_get_technology_state(bool mode)
 {
        GVariant *message = NULL, *variant;
        GVariantIter *iter, *next;
@@ -622,7 +622,7 @@ wifi_tech_state_e wifi_state_get_technology_state(void)
        const char *path;
        gchar *key;
 
-       if (g_tech_state > NETCONFIG_WIFI_TECH_UNKNOWN)
+       if (!mode && g_tech_state > NETCONFIG_WIFI_TECH_UNKNOWN)
                return g_tech_state;
 
        message = netconfig_invoke_dbus_method(CONNMAN_SERVICE,
@@ -733,7 +733,7 @@ gboolean handle_get_wifi_state(Wifi *wifi, GDBusMethodInvocation *context)
        GVariant *param = NULL;
        wifi_tech_state_e tech_state = NETCONFIG_WIFI_TECH_UNKNOWN;
        wifi_service_state_e service_state = NETCONFIG_WIFI_UNKNOWN;
-       tech_state = wifi_state_get_technology_state();
+       tech_state = wifi_state_get_technology_state(FALSE);
        service_state = wifi_state_get_service_state();
 
        if (tech_state == NETCONFIG_WIFI_TECH_UNKNOWN)