Always online policy
[Policy modules]


Classes

struct  always_online_data

Defines

#define POLICY_ALWAYS_ONLINE_MCE_TIMEOUT   5000
#define POLICY_ALWAYS_ONLINE_MCE_FILTER   "member='" MCE_DEVICE_MODE_SIG "'"
#define POLICY_ALWAYS_ONLINE_IAP_TIMEOUT   500

Functions

static void policy_always_online_run (struct always_online_data *data, gboolean immediately)
static void policy_always_online_cancel_timer (struct always_online_data *data)
static void policy_always_online_make_request (struct always_online_data *data)
static gboolean policy_always_online_make_request_cb (gpointer user_data)
static void policy_always_online_connected (struct icd_policy_request *network, GSList *existing_connections, gpointer *private)
static void policy_always_online_disconnected (struct icd_policy_request *network, const gchar *err_str, GSList *existing_connections, gpointer *private)
static void policy_always_online_flightmode (DBusMessage *message, struct always_online_data *data)
static DBusHandlerResult policy_always_online_flightmode_sig (DBusConnection *connection, DBusMessage *message, void *user_data)
static void policy_always_online_flightmode_cb (DBusPendingCall *pending, void *user_data)
static gboolean policy_always_online_flightmode_init (struct always_online_data *data)
static void policy_always_online_cancel_pending (struct always_online_data *data)
static void policy_always_online_destruct (gpointer *private)
static guint policy_always_online_count_iaps (void)
static gboolean policy_always_online_check (gpointer user_data)
static void policy_always_online_nw_params_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
static void policy_always_online_connections_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
static gboolean policy_always_online_gconf_init (struct always_online_data *data)

Define Documentation

#define POLICY_ALWAYS_ONLINE_IAP_TIMEOUT   500

how long to wait befor counting IAPs after gconf has changed

Referenced by policy_always_online_connections_changed(), and policy_always_online_nw_params_changed().

#define POLICY_ALWAYS_ONLINE_MCE_FILTER   "member='" MCE_DEVICE_MODE_SIG "'"

extra filter for mce signals

Referenced by icd_policy_init(), and policy_always_online_destruct().

#define POLICY_ALWAYS_ONLINE_MCE_TIMEOUT   5000

timeout for MCE method call

Referenced by policy_always_online_flightmode_init().


Function Documentation

static void policy_always_online_cancel_pending ( struct always_online_data data  )  [static]

Cancel pending call to MCE

Parameters:
data always online policy data

References ILOG_INFO, and always_online_data::pending_flightmode.

Referenced by policy_always_online_destruct().

static void policy_always_online_cancel_timer ( struct always_online_data data  )  [static]

Cancel always online timer

Parameters:
data always online policy data

References ILOG_INFO, and always_online_data::timeout_id.

Referenced by policy_always_online_connected(), policy_always_online_destruct(), policy_always_online_flightmode(), and policy_always_online_run().

static gboolean policy_always_online_check ( gpointer  user_data  )  [static]

Check the number of IAPs in gconf and whether always online gconf settings were changed. Connect automatically when needed

Parameters:
user_data always_online_policy_data
Returns:
FALSE;

References always_online_data::always_online_value_changed, always_online_data::count_iaps_id, always_online_data::iap_count, ILOG_DEBUG, ILOG_INFO, policy_always_online_count_iaps(), and policy_always_online_run().

Referenced by policy_always_online_connections_changed(), and policy_always_online_nw_params_changed().

static void policy_always_online_connected ( struct icd_policy_request network,
GSList *  existing_connections,
gpointer *  private 
) [static]

Informational policy called when a network has been successfully connected

Parameters:
network the network to connect
existing_connections existing network connections
private private data

References always_online_data::always_change, always_online_data::connection_count, always_online_data::highest_network_priority, ILOG_DEBUG, icd_policy_request::network_attrs, icd_policy_request::network_id, icd_policy_request::network_type, policy_always_online_cancel_timer(), always_online_data::priority, icd_policy_request::service_id, and icd_policy_request::service_type.

Referenced by icd_policy_init().

static void policy_always_online_connections_changed ( GConfClient *  client,
guint  cnxn_id,
GConfEntry *  entry,
gpointer  user_data 
) [static]

Notice a changed value in gconf

Parameters:
client GConf client
cnxn_id connection id
entry GConf entry
user_data always online policy data

References always_online_data::count_iaps_id, ILOG_DEBUG, policy_always_online_check(), and POLICY_ALWAYS_ONLINE_IAP_TIMEOUT.

Referenced by policy_always_online_gconf_init().

static guint policy_always_online_count_iaps ( void   )  [static]

Count how many IAPs there are in GConf

Returns:
number of IAPs

Referenced by icd_policy_init(), and policy_always_online_check().

static void policy_always_online_destruct ( gpointer *  private  )  [static]

static void policy_always_online_disconnected ( struct icd_policy_request network,
const gchar *  err_str,
GSList *  existing_connections,
gpointer *  private 
) [static]

Informational policy called when a network has been disconnected

Parameters:
network the network to connect
err_str NULL if the network was disconnected normally, any ICD_DBUS_ERROR_* from osso-ic-dbus.h on error
existing_connections existing network connections
private private data

References always_online_data::connection_count, always_online_data::highest_network_priority, ILOG_DEBUG, and policy_always_online_run().

Referenced by icd_policy_init().

static void policy_always_online_flightmode ( DBusMessage *  message,
struct always_online_data data 
) [static]

static void policy_always_online_flightmode_cb ( DBusPendingCall *  pending,
void *  user_data 
) [static]

Flight mode status pending call callback

Parameters:
pending the pending call
user_data always online policy data

References always_online_data::pending_flightmode, and policy_always_online_flightmode().

Referenced by policy_always_online_flightmode_init().

static gboolean policy_always_online_flightmode_init ( struct always_online_data data  )  [static]

Initialize flight mode information fetching from MCE

Parameters:
data always online policy data
Returns:
TRUE on success, FALSE on failure

References icd_dbus_send_system_mcall(), ILOG_CRIT, always_online_data::pending_flightmode, policy_always_online_flightmode_cb(), and POLICY_ALWAYS_ONLINE_MCE_TIMEOUT.

Referenced by icd_policy_init().

static DBusHandlerResult policy_always_online_flightmode_sig ( DBusConnection *  connection,
DBusMessage *  message,
void *  user_data 
) [static]

Flight mode signal handling function; used also by policy_always_online_flightmode_cb()

Parameters:
connection D-Bus connection or NULL if called from policy_always_online_flightmode_cb()
message D-Bus flight mode status message
user_data always online policy data
Returns:
DBUS_HANDLER_RESULT_NOT_YET_HANDLED as some other part of this program might also be interested in the signal

References policy_always_online_flightmode().

Referenced by icd_policy_init(), and policy_always_online_destruct().

static gboolean policy_always_online_gconf_init ( struct always_online_data data  )  [static]

Initialize GConf notifications

Parameters:
data always online policy data
Returns:
TRUE on success, FALSE on failure

References ILOG_ERR, always_online_data::notify_connections, always_online_data::notify_nw_params, policy_always_online_connections_changed(), and policy_always_online_nw_params_changed().

Referenced by icd_policy_init().

static void policy_always_online_make_request ( struct always_online_data data  )  [static]

static gboolean policy_always_online_make_request_cb ( gpointer  user_data  )  [static]

Timeout callback for a new request

Parameters:
user_data always online policy data
Returns:
TRUE to run again

References ILOG_DEBUG, policy_always_online_run(), and always_online_data::timeout_id.

Referenced by policy_always_online_flightmode(), and policy_always_online_run().

static void policy_always_online_nw_params_changed ( GConfClient *  client,
guint  cnxn_id,
GConfEntry *  entry,
gpointer  user_data 
) [static]

Notice a changed value in gconf

Parameters:
client GConf client
cnxn_id connection id
entry GConf entry
user_data always online policy data

References always_online_data::always_change, always_online_data::always_online_value_changed, always_online_data::auto_conn, always_online_data::count_iaps_id, ILOG_DEBUG, ILOG_INFO, policy_always_online_check(), POLICY_ALWAYS_ONLINE_IAP_TIMEOUT, and always_online_data::timeout.

Referenced by policy_always_online_gconf_init().

static void policy_always_online_run ( struct always_online_data data,
gboolean  immediately 
) [static]


Generated on Thu Mar 11 09:04:50 2010 for ICd2 by  doxygen 1.5.6