Return TRUE in gdbus method call handler 34/175034/1
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 6 Apr 2018 05:28:31 +0000 (14:28 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 6 Apr 2018 05:28:39 +0000 (14:28 +0900)
Change-Id: I86b35af20fe17ae7879156abb0def23229707a30

packaging/mobileap-agent.spec
src/mobileap_bluetooth.c
src/mobileap_common.c
src/mobileap_p2p.c
src/mobileap_usb.c
src/mobileap_wifi.c

index 4489008..e0244df 100644 (file)
@@ -1,6 +1,6 @@
 Name: mobileap-agent
 Summary: Mobile AP daemon for setting tethering environments
-Version: 1.0.118
+Version: 1.0.119
 Release: 1
 Group: System/Network
 License: Apache-2.0
index dd855bf..3c9d3ba 100755 (executable)
@@ -576,7 +576,6 @@ gboolean tethering_enable_bt_tethering(Tethering *obj,
                GDBusMethodInvocation *context, mobile_ap_address_type_e address_type)
 {
        mobile_ap_error_code_e ret;
-       gboolean ret_val = FALSE;
 
        DBG("+\n");
 
@@ -590,7 +589,7 @@ gboolean tethering_enable_bt_tethering(Tethering *obj,
                tethering_complete_enable_bt_tethering(obj, context,
                                MOBILE_AP_ERROR_IN_PROGRESS);
 #endif
-               return FALSE;
+               return TRUE;
        }
 
        g_context = context;
@@ -662,7 +661,6 @@ gboolean tethering_enable_bt_tethering(Tethering *obj,
                tethering_emit_bluetooth_on(obj);
                _create_tethering_active_noti();
                __handle_bt_adapter_visibility();
-               ret_val = TRUE;
        }
 
 DONE:
@@ -673,7 +671,7 @@ DONE:
 
        _unblock_device_sleep();
        DBG("-\n");
-       return ret_val;
+       return TRUE;
 }
 
 gboolean tethering_disable_bt_tethering(Tethering *obj,
@@ -693,7 +691,7 @@ gboolean tethering_disable_bt_tethering(Tethering *obj,
                tethering_complete_disable_bt_tethering(obj, context,
                                MOBILE_AP_DISABLE_BT_TETHERING_CFM, ret);
 #endif
-               return FALSE;
+               return TRUE;
        }
 
        tethering_emit_bluetooth_off(obj, "");
index f712025..627ad91 100755 (executable)
@@ -752,7 +752,7 @@ gboolean tethering_disable(Tethering *obj, GDBusMethodInvocation *context)
 #ifndef TIZEN_FEATURE_UNITTEST
                tethering_complete_disable(obj, context, MOBILE_AP_DISABLE_CFM, ret);
 #endif
-               return FALSE;
+               return TRUE;
        }
 
        if (_mobileap_get_ipv6_state(MOBILE_AP_STATE_WIFI))
@@ -815,7 +815,7 @@ gboolean tethering_get_data_packet_usage(Tethering *obj,
                                MOBILE_AP_GET_DATA_PACKET_USAGE_CFM,
                                0ULL, 0ULL);
 #endif
-               return FALSE;
+               return TRUE;
        }
 
        if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI))
index 95c5d46..ab02294 100644 (file)
@@ -527,15 +527,13 @@ gboolean tethering_p2p_enable(Tethering *obj,
                goto done;
        }
 
-       rv = TRUE;
-
 done:
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_enable_p2p_tethering(obj, context, error_code);
 #endif
        g_context = NULL;
        DBG("-\n");
-       return rv;
+       return TRUE;
 }
 
 /* Disable P2P Tethering API */
index 8bba0e2..a832e14 100755 (executable)
@@ -371,7 +371,6 @@ mobile_ap_error_code_e _disable_usb_tethering(Tethering *obj)
 gboolean tethering_enable_usb_tethering(Tethering *obj, GDBusMethodInvocation *context)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
-       gboolean ret_val = FALSE;
 
        DBG("+\n");
 
@@ -384,7 +383,7 @@ gboolean tethering_enable_usb_tethering(Tethering *obj, GDBusMethodInvocation *c
 #ifndef TIZEN_FEATURE_UNITTEST
                tethering_complete_enable_usb_tethering(obj, g_context, MOBILE_AP_ERROR_IN_PROGRESS);
 #endif
-               return FALSE;
+               return TRUE;
        }
 
        g_context = context;
@@ -404,7 +403,6 @@ gboolean tethering_enable_usb_tethering(Tethering *obj, GDBusMethodInvocation *c
                DBG("Don't need to wait for usb-setting\n"); //LCOV_EXCL_LINE
                tethering_emit_usb_on(obj);
                _create_tethering_active_noti();
-               ret_val = TRUE;
        }
 
 DONE:
@@ -414,7 +412,7 @@ DONE:
 
        g_context = NULL;
 
-       return ret_val;
+       return TRUE;
 }
 
 gboolean tethering_disable_usb_tethering(Tethering *obj,
@@ -438,7 +436,7 @@ gboolean tethering_disable_usb_tethering(Tethering *obj,
                                MOBILE_AP_DISABLE_USB_TETHERING_CFM,
                                MOBILE_AP_ERROR_IN_PROGRESS);
 #endif
-               return FALSE;
+               return TRUE;
        }
 
        g_context = context;
@@ -450,7 +448,7 @@ gboolean tethering_disable_usb_tethering(Tethering *obj,
                                MOBILE_AP_DISABLE_USB_TETHERING_CFM, ret);
 #endif
                g_context = NULL;
-               return FALSE;
+               return TRUE;
        }
 
 #ifndef TIZEN_FEATURE_UNITTEST
index c3295f2..e388925 100755 (executable)
@@ -887,7 +887,6 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
 {
        DBG("+\n");
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
-       gboolean ret_val = FALSE;
        bool wifi_state = false;
        g_assert(obj != NULL);
 #ifndef TIZEN_FEATURE_UNITTEST
@@ -898,7 +897,7 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
                DBG("It is turnning on\n"); //LCOV_EXCL_LINE
                tethering_complete_enable_wifi_tethering(obj, g_context,
                                MOBILE_AP_ERROR_IN_PROGRESS);
-               return FALSE;
+               return TRUE;
        }
        g_context = context;
 
@@ -982,7 +981,6 @@ gboolean tethering_enable_wifi_tethering(Tethering *obj,
 #ifndef TIZEN_FEATURE_HEADLESS
                _create_tethering_active_noti();
 #endif
-               ret_val = TRUE;
        }
 
 DONE:
@@ -991,8 +989,7 @@ DONE:
 #endif
        g_context = NULL;
        memset(&wifi_settings, 0, sizeof(wifi_settings));
-
-       return ret_val;
+       return TRUE;
 }
 
 gboolean tethering_disable_wifi_tethering(Tethering *obj,
@@ -1014,7 +1011,7 @@ gboolean tethering_disable_wifi_tethering(Tethering *obj,
                        MOBILE_AP_DISABLE_WIFI_TETHERING_CFM, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_reload_wifi_settings(Tethering *obj,
@@ -1022,7 +1019,6 @@ gboolean tethering_reload_wifi_settings(Tethering *obj,
                gchar *key, gchar *mode, gint channel, gint visibility, gint mac_filter, gint max_sta, gint security_type)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
-       gboolean ret_val = TRUE;
        softap_settings_t settings = {0, };
 
        DBG("+\n");
@@ -1059,16 +1055,14 @@ gboolean tethering_reload_wifi_settings(Tethering *obj,
        g_strlcpy(settings.vendor_elements, "", sizeof(settings.vendor_elements));
 
        ret = _reload_softap_settings(obj, &settings);
-       if (ret != MOBILE_AP_ERROR_NONE) {
+       if (ret != MOBILE_AP_ERROR_NONE)
                ERR("_reload_softap_settings is failed\n"); //LCOV_EXCL_LINE
-               ret_val = FALSE;
-       }
 
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_reload_wifi_settings(obj, context, ret);
 #endif
 
-       return ret_val;
+       return TRUE;
 }
 
 gboolean tethering_set_mtu(Tethering *obj,
@@ -1081,7 +1075,7 @@ gboolean tethering_set_mtu(Tethering *obj,
        tethering_complete_set_mtu(obj, context, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_change_mac(Tethering *obj,
@@ -1107,7 +1101,7 @@ gboolean tethering_enable_port_forwarding(Tethering *obj,
        tethering_complete_enable_port_forwarding(obj, context, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_add_port_forwarding_rule(Tethering *obj, GDBusMethodInvocation *context,
@@ -1156,7 +1150,7 @@ gboolean tethering_add_port_filtering_rule(Tethering *obj,
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_add_port_filtering_rule(obj, context, ret);
 #endif
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_add_custom_port_filtering_rule(Tethering *obj,
@@ -1168,7 +1162,7 @@ gboolean tethering_add_custom_port_filtering_rule(Tethering *obj,
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_add_custom_port_filtering_rule(obj, context, ret);
 #endif
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_set_vpn_passthrough_rule(Tethering *obj,
@@ -1199,12 +1193,7 @@ gboolean tethering_set_wps_pin(Tethering *obj,
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_set_wps_pin(obj, context, ret);
 #endif
-
-#ifdef TIZEN_FEATURE_WLAN_BOARD_SPRD
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
-#else
        return TRUE;
-#endif
 }
 
 gboolean tethering_push_wps_button(Tethering *obj,
@@ -1223,11 +1212,7 @@ gboolean tethering_push_wps_button(Tethering *obj,
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_push_wps_button(obj, context, ret);
 #endif
-#ifdef TIZEN_FEATURE_WLAN_BOARD_SPRD
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
-#else
        return TRUE;
-#endif
 }
 
 gboolean _is_trying_wifi_operation(void)
@@ -1371,7 +1356,7 @@ gboolean tethering_enable_dhcp(Tethering *obj,
        tethering_complete_enable_dhcp(obj, context, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_dhcp_range(Tethering *obj,
@@ -1384,7 +1369,7 @@ gboolean tethering_dhcp_range(Tethering *obj,
        tethering_complete_dhcp_range(obj, context, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_get_wifi_tethering_passphrase(Tethering *obj,
@@ -1405,7 +1390,7 @@ gboolean tethering_get_wifi_tethering_passphrase(Tethering *obj,
                        (len > 0 ? passphrase_buf : NULL), len, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_set_wifi_tethering_passphrase(Tethering *obj,
@@ -1428,7 +1413,7 @@ DONE:
 #ifndef TIZEN_FEATURE_UNITTEST
        tethering_complete_set_wifi_tethering_passphrase(obj, context, ret);
 #endif
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean tethering_set_hostapd_tx_power(Tethering *obj,
@@ -1481,7 +1466,6 @@ gboolean tethering_get_hostapd_tx_power(Tethering *obj,
 gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context, GVariant *settings)
 {
        mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
-       gboolean ret_val = FALSE;
        bool wifi_state = false;
 
        DBG("+");
@@ -1497,7 +1481,7 @@ gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context, GVariant *se
 #ifndef TIZEN_FEATURE_UNITTEST
                softap_complete_enable(obj, g_context, MOBILE_AP_ERROR_IN_PROGRESS);
 #endif
-               return FALSE;
+               return TRUE;
        }
        g_context = context;
        is_softap = TRUE;
@@ -1505,7 +1489,7 @@ gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context, GVariant *se
        ret = _extract_softap_settings(settings, &wifi_ap_settings);
        if (ret != MOBILE_AP_ERROR_NONE) {
                ERR("Failed to get SoftAP settings"); //LCOV_EXCL_LINE
-               return FALSE;
+               return TRUE;
        }
 
 #ifdef TIZEN_FEATURE_ENABLE_WIFI_DIRECT
@@ -1523,12 +1507,10 @@ gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context, GVariant *se
                goto DONE;
        }
        ret = _enable_soft_ap(obj, &wifi_ap_settings);
-       if (ret != MOBILE_AP_ERROR_NONE) {
+       if (ret != MOBILE_AP_ERROR_NONE)
                ERR("_enable_soft_ap is failed\n"); //LCOV_EXCL_LINE
-       } else {
+       else
                softap_emit_soft_ap_on(obj);
-               ret_val = TRUE;
-       }
 
 DONE:
 #ifndef TIZEN_FEATURE_UNITTEST
@@ -1538,7 +1520,7 @@ DONE:
        g_context = NULL;
        memset(&wifi_ap_settings, 0, sizeof(wifi_ap_settings));
 
-       return ret_val;
+       return TRUE;
 }
 
 gboolean softap_disable(Softap *obj,
@@ -1558,7 +1540,7 @@ gboolean softap_disable(Softap *obj,
        softap_complete_disable(obj, context, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean softap_reload_settings(Softap *obj,
@@ -1590,7 +1572,7 @@ DONE:
 #ifndef TIZEN_FEATURE_UNITTEST
        softap_complete_reload_settings(obj, context, ret);
 #endif
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean softap_set_wps_pin(Softap *obj,
@@ -1608,11 +1590,7 @@ gboolean softap_set_wps_pin(Softap *obj,
        softap_complete_set_wps_pin(obj, context, ret);
 #endif
 
-#ifdef TIZEN_FEATURE_WLAN_BOARD_SPRD
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
-#else
        return TRUE;
-#endif
 }
 
 gboolean softap_push_wps_button(Softap *obj, GDBusMethodInvocation *context)
@@ -1629,11 +1607,7 @@ gboolean softap_push_wps_button(Softap *obj, GDBusMethodInvocation *context)
        softap_complete_push_wps_button(obj, context, ret);
 #endif
 
-#ifdef TIZEN_FEATURE_WLAN_BOARD_SPRD
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
-#else
        return TRUE;
-#endif
 }
 
 gboolean softap_enable_dhcp(Softap *obj,
@@ -1646,7 +1620,7 @@ gboolean softap_enable_dhcp(Softap *obj,
        softap_complete_enable_dhcp(obj, context, ret);
 #endif
 
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 gboolean softap_disable_dhcp(Softap *obj,
@@ -1670,7 +1644,7 @@ gboolean softap_enable_dhcp_with_range(Softap *obj,
 #ifndef TIZEN_FEATURE_UNITTEST
        softap_complete_enable_dhcp_with_range(obj, context, ret);
 #endif
-       return (ret == MOBILE_AP_ERROR_NONE ? TRUE : FALSE);
+       return TRUE;
 }
 
 
@@ -1700,5 +1674,5 @@ gboolean softap_get_station_info(Softap *obj,
 #endif
        g_variant_unref(var);
 
-       return (var != NULL ? TRUE : FALSE);
+       return TRUE;
 }