summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-07-28 22:34:00 +0200
committerBen Chan <benchan@chromium.org>2018-10-26 09:41:44 -0700
commit025fcb7e92dde84c45085a1087375413c23d8ab7 (patch)
tree8d78deedfe0586738decaabc7687a099ca6701f4
parent408a2a9c6cef91e11a3ed5e09c140e175534822d (diff)
downloadModemManager-025fcb7e92dde84c45085a1087375413c23d8ab7.tar.gz
api: deprecate SubscriptionState property
-rw-r--r--introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml4
-rw-r--r--libmm-glib/mm-modem-3gpp.c12
-rw-r--r--libmm-glib/mm-modem-3gpp.h5
-rw-r--r--src/mm-broadband-modem.c33
-rw-r--r--src/mm-iface-modem-3gpp.c80
-rw-r--r--src/mm-iface-modem-3gpp.h8
6 files changed, 17 insertions, 125 deletions
diff --git a/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml b/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml
index 423ee0b62..5542fb6b8 100644
--- a/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml
+++ b/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml
@@ -152,6 +152,10 @@
A <link linkend="MMModem3gppSubscriptionState">MMModem3gppSubscriptionState</link>
value representing the subscription status of the account and whether there
is any data remaining, given as an unsigned integer (signature <literal>"u"</literal>).
+
+ Deprecated: 1.10.0. The value of this property can only be obtained with operator
+ specific logic (e.g. processing specific PCO info), and therefore it doesn't make sense
+ to expose it in the ModemManager interface.
-->
<property name="SubscriptionState" type="u" access="read" />
diff --git a/libmm-glib/mm-modem-3gpp.c b/libmm-glib/mm-modem-3gpp.c
index 80746f983..3bfe87f34 100644
--- a/libmm-glib/mm-modem-3gpp.c
+++ b/libmm-glib/mm-modem-3gpp.c
@@ -253,14 +253,20 @@ mm_modem_3gpp_get_registration_state (MMModem3gpp *self)
* Get the current subscription status of the account. This value is only
* available after the modem attempts to register with the network.
*
+ * The value of this property can only be obtained with operator specific logic (e.g.
+ * processing specific PCO info), and therefore it doesn't make sense to expose it in
+ * the ModemManager interface.
+ *
* Returns: A #MMModem3gppSubscriptionState value, specifying the current subscription state.
+ *
+ * Deprecated: 1.10.0. The value of this property can only be obtained with operator
+ * specific logic (e.g. processing specific PCO info), and therefore it doesn't make sense
+ * to expose it in the ModemManager interface.
*/
MMModem3gppSubscriptionState
mm_modem_3gpp_get_subscription_state (MMModem3gpp *self)
{
- g_return_val_if_fail (MM_IS_MODEM_3GPP (self), MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN);
-
- return mm_gdbus_modem3gpp_get_subscription_state (MM_GDBUS_MODEM3GPP (self));
+ return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN;
}
/*****************************************************************************/
diff --git a/libmm-glib/mm-modem-3gpp.h b/libmm-glib/mm-modem-3gpp.h
index 539674f78..f71d8a612 100644
--- a/libmm-glib/mm-modem-3gpp.h
+++ b/libmm-glib/mm-modem-3gpp.h
@@ -76,7 +76,6 @@ const gchar *mm_modem_3gpp_get_operator_name (MMModem3gpp *self);
gchar *mm_modem_3gpp_dup_operator_name (MMModem3gpp *self);
MMModem3gppRegistrationState mm_modem_3gpp_get_registration_state (MMModem3gpp *self);
-MMModem3gppSubscriptionState mm_modem_3gpp_get_subscription_state (MMModem3gpp *self);
MMModem3gppFacility mm_modem_3gpp_get_enabled_facility_locks (MMModem3gpp *self);
@@ -136,6 +135,10 @@ gboolean mm_modem_3gpp_set_eps_ue_mode_operation_sync (MMModem3gpp
GCancellable *cancellable,
GError **error);
+/* Deprecated APIs */
+G_DEPRECATED
+MMModem3gppSubscriptionState mm_modem_3gpp_get_subscription_state (MMModem3gpp *self);
+
G_END_DECLS
#endif /* _MM_MODEM_3GPP_H_ */
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 92c87e456..7ee68d37a 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -3955,37 +3955,6 @@ modem_3gpp_load_operator_name (MMIfaceModem3gpp *self,
}
/*****************************************************************************/
-/* Subscription State Loading (3GPP interface) */
-
-static MMModem3gppSubscriptionState
-modem_3gpp_load_subscription_state_finish (MMIfaceModem3gpp *self,
- GAsyncResult *res,
- GError **error)
-{
- GError *inner_error = NULL;
- gssize value;
-
- value = g_task_propagate_int (G_TASK (res), &inner_error);
- if (inner_error) {
- g_propagate_error (error, inner_error);
- return MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN;
- }
- return (MMModem3gppSubscriptionState)value;
-}
-
-static void
-modem_3gpp_load_subscription_state (MMIfaceModem3gpp *self,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GTask *task;
-
- task = g_task_new (self, NULL, callback, user_data);
- g_task_return_int (task, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN);
- g_object_unref (task);
-}
-
-/*****************************************************************************/
/* UE mode of operation for EPS loading (3GPP interface) */
static MMModem3gppEpsUeModeOperation
@@ -11182,8 +11151,6 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface)
iface->load_operator_code_finish = modem_3gpp_load_operator_code_finish;
iface->load_operator_name = modem_3gpp_load_operator_name;
iface->load_operator_name_finish = modem_3gpp_load_operator_name_finish;
- iface->load_subscription_state = modem_3gpp_load_subscription_state;
- iface->load_subscription_state_finish = modem_3gpp_load_subscription_state_finish;
iface->run_registration_checks = modem_3gpp_run_registration_checks;
iface->run_registration_checks_finish = modem_3gpp_run_registration_checks_finish;
iface->register_in_network = modem_3gpp_register_in_network;
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index d57e59826..9e6261263 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -64,10 +64,6 @@ mm_iface_modem_3gpp_bind_simple_status (MMIfaceModem3gpp *self,
status, MM_SIMPLE_PROPERTY_3GPP_OPERATOR_NAME,
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
- g_object_bind_property (skeleton, "subscription-state",
- status, MM_SIMPLE_PROPERTY_3GPP_SUBSCRIPTION_STATE,
- G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
-
g_object_unref (skeleton);
}
@@ -962,7 +958,6 @@ typedef struct {
MmGdbusModem3gpp *skeleton;
gboolean operator_code_loaded;
gboolean operator_name_loaded;
- gboolean subscription_state_loaded;
} ReloadCurrentRegistrationInfoContext;
static void
@@ -1044,31 +1039,6 @@ load_operator_code_ready (MMIfaceModem3gpp *self,
}
static void
-load_subscription_state_ready (MMIfaceModem3gpp *self,
- GAsyncResult *res,
- GTask *task)
-{
- ReloadCurrentRegistrationInfoContext *ctx;
- GError *error = NULL;
- MMModem3gppSubscriptionState subscription_state = MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN;
-
- ctx = g_task_get_task_data (task);
-
- subscription_state = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state_finish (self, res, &error);
- if (error) {
- mm_warn ("Couldn't load Subscription State: '%s'", error->message);
- g_error_free (error);
- }
-
- if (ctx->skeleton)
- mm_gdbus_modem3gpp_set_subscription_state (ctx->skeleton, subscription_state);
-
- ctx->subscription_state_loaded = TRUE;
- reload_current_registration_info_context_step (task);
-}
-
-
-static void
reload_current_registration_info_context_step (GTask *task)
{
MMIfaceModem3gpp *self;
@@ -1095,15 +1065,6 @@ reload_current_registration_info_context_step (GTask *task)
return;
}
- if (!ctx->subscription_state_loaded) {
- /* Launch subscription state update */
- MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state (
- self,
- (GAsyncReadyCallback)load_subscription_state_ready,
- task);
- return;
- }
-
/* If all are loaded, all done */
g_task_return_boolean (task, TRUE);
g_object_unref (task);
@@ -1147,11 +1108,6 @@ mm_iface_modem_3gpp_reload_current_registration_info (MMIfaceModem3gpp *self,
if (ctx->operator_name_loaded)
mm_gdbus_modem3gpp_set_operator_name (ctx->skeleton, NULL);
- ctx->subscription_state_loaded = !(MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state &&
- MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_subscription_state_finish);
- if (ctx->subscription_state_loaded)
- mm_gdbus_modem3gpp_set_subscription_state (ctx->skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN);
-
reload_current_registration_info_context_step (task);
}
@@ -1172,19 +1128,6 @@ mm_iface_modem_3gpp_clear_current_operator (MMIfaceModem3gpp *self)
mm_iface_modem_location_3gpp_update_mcc_mnc (MM_IFACE_MODEM_LOCATION (self), 0, 0);
}
-static void
-clear_subscription_state (MMIfaceModem3gpp *self)
-{
- MmGdbusModem3gpp *skeleton = NULL;
-
- g_object_get (self,
- MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton,
- NULL);
- if (!skeleton)
- return;
- mm_gdbus_modem3gpp_set_subscription_state (skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN);
-}
-
/*****************************************************************************/
void
@@ -1286,13 +1229,6 @@ update_non_registered_state (MMIfaceModem3gpp *self,
/* Not registered neither in home nor roaming network */
mm_iface_modem_3gpp_clear_current_operator (self);
- /* The subscription state can be computed in two ways: a) via PCO which is
- * sent by the carrier during registration or b) by looking at the
- * registration reject error code. If b), we want to make sure we
- * preserve the subscription state */
- if (reg_state_is_registered (old_state))
- clear_subscription_state (self);
-
/* The property in the interface is bound to the property
* in the skeleton, so just updating here is enough */
g_object_set (self,
@@ -1429,22 +1365,6 @@ mm_iface_modem_3gpp_update_eps_registration_state (MMIfaceModem3gpp *self,
update_registration_state (self, get_consolidated_reg_state (ctx), TRUE);
}
-void
-mm_iface_modem_3gpp_update_subscription_state (MMIfaceModem3gpp *self,
- MMModem3gppSubscriptionState state)
-{
- MmGdbusModem3gpp *skeleton = NULL;
-
- g_object_get (self,
- MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton,
- NULL);
- if (skeleton) {
- mm_dbg ("Setting subscription state to: %s", mm_modem_3gpp_subscription_state_get_string (state));
- mm_gdbus_modem3gpp_set_subscription_state (skeleton, state);
- g_object_unref (skeleton);
- }
-}
-
/*****************************************************************************/
typedef struct {
diff --git a/src/mm-iface-modem-3gpp.h b/src/mm-iface-modem-3gpp.h
index 7ea190a21..920d01a00 100644
--- a/src/mm-iface-modem-3gpp.h
+++ b/src/mm-iface-modem-3gpp.h
@@ -184,14 +184,6 @@ struct _MMIfaceModem3gpp {
GAsyncResult *res,
GError **error);
- /* Loading of the subscription state property */
- void (*load_subscription_state) (MMIfaceModem3gpp *self,
- GAsyncReadyCallback callback,
- gpointer user_data);
- MMModem3gppSubscriptionState (*load_subscription_state_finish) (MMIfaceModem3gpp *self,
- GAsyncResult *res,
- GError **error);
-
/* Scan current networks, expect a GList of MMModem3gppNetworkInfo */
void (* scan_networks) (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,