2 * Maemo hardware specific functions
15 #include <osso-ic-dbus.h>
23 #include "ui-common.h"
26 dbus_cb_default(const gchar *interface, const gchar *method,
27 GArray *arguments, gpointer data, osso_rpc_t *retval)
29 printf("%s()\n", __PRETTY_FUNCTION__);
31 if(!strcmp(method, "top_application"))
32 gtk_idle_add((GSourceFunc)window_present, NULL);
34 retval->type = DBUS_TYPE_INVALID;
36 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
41 void osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
43 static gboolean _must_save_data = FALSE;
44 printf("%s()\n", __PRETTY_FUNCTION__);
46 if (state->system_inactivity_ind) {
48 _must_save_data = FALSE;
50 if (_conn_state > RCVR_OFF) {
51 GConfClient *gconf_client =
52 gconf_client_get_default();
54 || gconf_client_get_bool(gconf_client,
55 GCONF_KEY_DISCONNECT_ON_COVER,
57 gconf_client_clear_cache(gconf_client);
58 g_object_unref(gconf_client);
59 set_conn_state(RCVR_OFF);
62 /* Pretend autoroute is in progress to avoid download. */
63 if (_autoroute_data.enabled)
64 _autoroute_data.in_progress = TRUE;
68 g_source_remove(_curl_sid);
72 } else if (state->save_unsaved_data_ind) {
74 _must_save_data = TRUE;
75 } else if (state->memory_low_ind) {
76 /* Drop any memory we can.. */
78 if (_conn_state == RCVR_OFF && _enable_gps) {
79 set_conn_state(RCVR_DOWN);
81 if (_autoroute_data.enabled)
82 _autoroute_data.in_progress = TRUE;
85 /* Start curl in case there are downloads pending. */
86 if (_iap_connected && !_curl_sid)
87 _curl_sid = g_timeout_add(100,
89 curl_download_timeout, NULL);
92 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
97 void osso_cb_hw_state(void *state, gpointer data)