connection_unset_type_changed_cb
connection_unset_ethernet_cable_state_chaged_cb
connection_update_profile
+connection_is_metered_network
extern int utc_connection_get_proxy_n(void);
extern int utc_connection_get_type_n(void);
extern int utc_connection_get_type_p(void);
+extern int utc_connection_is_metered_network_n(void);
+extern int utc_connection_is_metered_network_p(void);
extern int utc_connection_get_cellular_state_n(void);
extern int utc_connection_get_cellular_state_p(void);
extern int utc_connection_get_ethernet_state_n(void);
{"utc_connection_get_proxy_n", utc_connection_get_proxy_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_type_n", utc_connection_get_type_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_type_p", utc_connection_get_type_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_is_metered_network_n", utc_connection_is_metered_network_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_is_metered_network_p", utc_connection_is_metered_network_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_cellular_state_n", utc_connection_get_cellular_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
extern int utc_connection_get_proxy_n(void);
extern int utc_connection_get_type_n(void);
extern int utc_connection_get_type_p(void);
+extern int utc_connection_is_metered_network_n(void);
+extern int utc_connection_is_metered_network_p(void);
extern int utc_connection_get_cellular_state_n(void);
extern int utc_connection_get_cellular_state_p(void);
extern int utc_connection_get_ethernet_state_n(void);
{"utc_connection_get_proxy_n", utc_connection_get_proxy_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_type_n", utc_connection_get_type_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_type_p", utc_connection_get_type_p, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_is_metered_network_n", utc_connection_is_metered_network_n, utc_network_connection_startup, utc_network_connection_cleanup},
+ {"utc_connection_is_metered_network_p", utc_connection_is_metered_network_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_cellular_state_n", utc_connection_get_cellular_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup},
{"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup},
return 0;
}
+/**
+ * @testcase utc_connection_is_metered_network_n
+ * @since_tizen 4.0
+ * @type Negative
+ * @description connection_is_metered_network should fail with invalid parameter.
+ * @scenario Verify utc_connection_is_metered_network_n by passing invalid parameter.
+ */
+int utc_connection_is_metered_network_n(void)
+{
+ int ret;
+ bool state;
+
+ if (all_features_not_supported) {
+ ret = connection_is_metered_network(connection, NULL);
+ CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = connection_is_metered_network(NULL, NULL);
+ CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_is_metered_network(NULL, &state);
+ CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+ ret = connection_is_metered_network(connection, NULL);
+ CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_connection_is_metered_network_p
+ * @since_tizen 4.0
+ * @type Positive
+ * @description Gets if the current connection is metered.
+ * @scenario Invoking utc_connection_is_metered_network_p with valid parameter.
+ */
+int utc_connection_is_metered_network_p(void)
+{
+ bool state = false;
+ connection_type_e type;
+
+ int ret = connection_is_metered_network(connection, &state);
+ int err = connection_get_type(connection, &type);
+
+ if (all_features_not_supported) {
+ CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_NOT_SUPPORTED);
+ } else if (state) {
+ CHECK_RETURN("connection_is_metered_network", type, CONNECTION_TYPE_CELLULAR);
+ } else {
+ CHECK_RETURN("connection_is_metered_network", ret, CONNECTION_ERROR_NONE);
+ }
+
+ return 0;
+}
+
/**
* @testcase utc_connection_get_cellular_state_n
* @since_tizen 2.3