2 * This file is a part of MAFW
4 * Copyright (C) 2007, 2008, 2009 Nokia Corporation, all rights reserved.
6 * Contact: Visa Smolander <visa.smolander@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 #include <mce/dbus-names.h>
27 #include <dbus/dbus.h>
31 #define KEYPAD_TIMER_INTERVAL 50
35 void keypadlocking_allow(void)
39 g_source_remove(toutid);
44 static gboolean no_keylock_timeout(gpointer udata)
46 static DBusMessage *msg = NULL;
47 static DBusConnection *sysbus = NULL;
53 dbus_error_init(&err);
54 sysbus = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
56 g_assert(!dbus_error_is_set(&err));
60 msg = dbus_message_new_method_call(MCE_SERVICE,
61 MCE_REQUEST_PATH, MCE_REQUEST_IF,
62 MCE_PREVENT_KEYPAD_OFF_REQ);
65 g_assert(dbus_connection_send(sysbus, msg,NULL));
66 dbus_connection_flush(sysbus);
70 void keypadlocking_prohibit(void)
74 toutid = g_timeout_add_seconds(KEYPAD_TIMER_INTERVAL,
77 no_keylock_timeout(NULL);