2 * Maemo hardware specific functions
17 #include <osso-ic-dbus.h>
21 #include "map-download.h"
23 #include "mapper-types.h"
26 #include "settings-gconf.h"
28 #include "config-gconf.h"
29 #include "ui-common.h"
32 dbus_cb_default(const gchar *interface, const gchar *method, GArray *arguments, gpointer data, osso_rpc_t *retval)
34 if(!strcmp(method, "top_application"))
35 gtk_idle_add((GSourceFunc)window_present, NULL);
36 retval->type = DBUS_TYPE_INVALID;
42 osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
44 static gboolean _must_save_data = FALSE;
46 if (state->system_inactivity_ind) {
48 _must_save_data = FALSE;
50 if (_conn_state > RCVR_OFF) {
51 if (gconf_client_get_bool(gconf_client, GCONF_KEY_DISCONNECT_ON_COVER, NULL)) {
52 gconf_client_clear_cache(gconf_client);
53 gps_conn_set_state(RCVR_OFF);
56 /* Pretend autoroute is in progress to avoid download. */
57 if (_autoroute_data.enabled)
58 _autoroute_data.in_progress = TRUE;
62 g_source_remove(_curl_sid);
66 } else if (state->save_unsaved_data_ind) {
68 _must_save_data = TRUE;
69 } else if (state->memory_low_ind) {
70 /* Drop any memory we can.. */
72 if (_conn_state == RCVR_OFF && _enable_gps) {
73 gps_conn_set_state(RCVR_DOWN);
75 if (_autoroute_data.enabled)
76 _autoroute_data.in_progress = TRUE;
79 /* Start curl in case there are downloads pending. */
80 if (iap_is_connected() && !_curl_sid)
81 _curl_sid = g_timeout_add(100, (GSourceFunc)map_download_timeout, NULL);
88 osso_cb_hw_state(void *state, gpointer data)