2 * Maemo hardware specific functions
15 #include <osso-helplib.h>
16 #include <osso-ic-dbus.h>
20 #include "map-download.h"
22 #include "mapper-types.h"
25 #include "settings-gconf.h"
27 #include "ui-common.h"
30 dbus_cb_default(const gchar *interface, const gchar *method,
31 GArray *arguments, gpointer data, osso_rpc_t *retval)
33 if(!strcmp(method, "top_application"))
34 gtk_idle_add((GSourceFunc)window_present, NULL);
35 retval->type = DBUS_TYPE_INVALID;
40 void osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
42 static gboolean _must_save_data = FALSE;
43 printf("%s()\n", __PRETTY_FUNCTION__);
45 if (state->system_inactivity_ind) {
47 _must_save_data = FALSE;
49 if (_conn_state > RCVR_OFF) {
50 if (gconf_client_get_bool(gconf_client, GCONF_KEY_DISCONNECT_ON_COVER, NULL)) {
51 gconf_client_clear_cache(gconf_client);
52 set_conn_state(RCVR_OFF);
55 /* Pretend autoroute is in progress to avoid download. */
56 if (_autoroute_data.enabled)
57 _autoroute_data.in_progress = TRUE;
61 g_source_remove(_curl_sid);
65 } else if (state->save_unsaved_data_ind) {
67 _must_save_data = TRUE;
68 } else if (state->memory_low_ind) {
69 /* Drop any memory we can.. */
71 if (_conn_state == RCVR_OFF && _enable_gps) {
72 set_conn_state(RCVR_DOWN);
74 if (_autoroute_data.enabled)
75 _autoroute_data.in_progress = TRUE;
78 /* Start curl in case there are downloads pending. */
79 if (iap_is_connected() && !_curl_sid)
80 _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL);
82 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
87 void osso_cb_hw_state(void *state, gpointer data)