From 86a183778b5b123f6556ecbe53ec7d06d6e7c575 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sat, 1 Aug 2020 09:59:13 +0200 Subject: api,sim: new 'Active' property In preparation for the multi-SIM setup, we need a way to tell whether a given SIM card is active or not in the system. On systems with one single SIM slot, the available SIM card will always be active. On Multi-SIM Single-Standby setups we may have multiple SIM slots with multiple SIM cards, but only one of them will be active at any given time. On Multi-SIM Multi-Standby setups we may have multiple SIM slots with multiple SIM cards that may be active at the same time. E.g. the QMI protocol allows up to 5 different active SIM cards (primary, secondary, tertiary...). --- libmm-glib/mm-sim.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libmm-glib/mm-sim.c') diff --git a/libmm-glib/mm-sim.c b/libmm-glib/mm-sim.c index 7246fff4..d59f7990 100644 --- a/libmm-glib/mm-sim.c +++ b/libmm-glib/mm-sim.c @@ -86,6 +86,26 @@ mm_sim_dup_path (MMSim *self) /*****************************************************************************/ +/** + * mm_sim_get_active: + * @self: A #MMSim. + * + * Checks whether the #MMSim is currently active. + * + * Returns: %TRUE if the SIM is active, %FALSE otherwise. + * + * Since: 1.16 + */ +gboolean +mm_sim_get_active (MMSim *self) +{ + g_return_val_if_fail (MM_IS_SIM (self), FALSE); + + return mm_gdbus_sim_get_active (MM_GDBUS_SIM (self)); +} + +/*****************************************************************************/ + /** * mm_sim_get_identifier: * @self: A #MMSim. -- cgit v1.2.3-70-g09d2