2 * Maemo hardware specific functions
14 #include <osso-helplib.h>
15 #include <osso-ic-dbus.h>
20 #include "mapper-types.h"
23 #include "settings-gconf.h"
26 void osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
28 static gboolean _must_save_data = FALSE;
29 printf("%s()\n", __PRETTY_FUNCTION__);
31 if (state->system_inactivity_ind) {
33 _must_save_data = FALSE;
35 if (_conn_state > RCVR_OFF) {
36 GConfClient *gconf_client = gconf_client_get_default();
37 if (!gconf_client || gconf_client_get_bool(gconf_client,
38 GCONF_KEY_DISCONNECT_ON_COVER,
40 gconf_client_clear_cache(gconf_client);
41 g_object_unref(gconf_client);
42 set_conn_state(RCVR_OFF);
45 /* Pretend autoroute is in progress to avoid download. */
46 if (_autoroute_data.enabled)
47 _autoroute_data.in_progress = TRUE;
51 g_source_remove(_curl_sid);
55 } else if (state->save_unsaved_data_ind) {
57 _must_save_data = TRUE;
58 } else if (state->memory_low_ind) {
59 /* Drop any memory we can.. */
61 if (_conn_state == RCVR_OFF && _enable_gps) {
62 set_conn_state(RCVR_DOWN);
64 if (_autoroute_data.enabled)
65 _autoroute_data.in_progress = TRUE;
68 /* Start curl in case there are downloads pending. */
69 if (iap_is_connected() && !_curl_sid)
70 _curl_sid = g_timeout_add(100,
72 curl_download_timeout, NULL);
74 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
79 void osso_cb_hw_state(void *state, gpointer data)