2 * Maemo hardware specific functions
15 #include <osso-helplib.h>
16 #include <osso-ic-dbus.h>
21 #include "mapper-types.h"
24 #include "settings-gconf.h"
26 #include "ui-common.h"
29 dbus_cb_default(const gchar *interface, const gchar *method,
30 GArray *arguments, gpointer data, osso_rpc_t *retval)
32 if(!strcmp(method, "top_application"))
33 gtk_idle_add((GSourceFunc)window_present, NULL);
34 retval->type = DBUS_TYPE_INVALID;
39 void osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
41 static gboolean _must_save_data = FALSE;
42 printf("%s()\n", __PRETTY_FUNCTION__);
44 if (state->system_inactivity_ind) {
46 _must_save_data = FALSE;
48 if (_conn_state > RCVR_OFF) {
49 GConfClient *gconf_client = gconf_client_get_default();
50 if (!gconf_client || gconf_client_get_bool(gconf_client,
51 GCONF_KEY_DISCONNECT_ON_COVER,
53 gconf_client_clear_cache(gconf_client);
54 g_object_unref(gconf_client);
55 set_conn_state(RCVR_OFF);
58 /* Pretend autoroute is in progress to avoid download. */
59 if (_autoroute_data.enabled)
60 _autoroute_data.in_progress = TRUE;
64 g_source_remove(_curl_sid);
68 } else if (state->save_unsaved_data_ind) {
70 _must_save_data = TRUE;
71 } else if (state->memory_low_ind) {
72 /* Drop any memory we can.. */
74 if (_conn_state == RCVR_OFF && _enable_gps) {
75 set_conn_state(RCVR_DOWN);
77 if (_autoroute_data.enabled)
78 _autoroute_data.in_progress = TRUE;
81 /* Start curl in case there are downloads pending. */
82 if (iap_is_connected() && !_curl_sid)
83 _curl_sid = g_timeout_add(100,
85 curl_download_timeout, NULL);
87 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
92 void osso_cb_hw_state(void *state, gpointer data)