View Single Post
laasonen's Avatar
Posts: 565 | Thanked: 618 times | Joined on Jun 2010 @ Finland
#17
Originally Posted by jstokes View Post
Excuse me if I'm misunderstanding anything, but instead of watching to see if the power button is pressed and then calling the SystemUI D-Bus method that unlocks the device..
The python version is using dbus, but the idea is the same:
Code:
self.bus.add_signal_receiver(self.unlock, path='/com/nokia/mce/signal', dbus_interface='com.nokia.mce.signal', signal_name='tklock_mode_ind')
Originally Posted by jstokes View Post
...why not just disable locking when a selected network is connected to and then re-enable it when the device disconnects?

You can turn off the autolock by changing the value of GConf key /system/osso/dsm/locks/devicelock_autolock_enabled
Tried it and at least this doesn't open it, when it's already locked:
Code:
gconftool -s -t bool /system/osso/dsm/locks/devicelock_autolock_enabled false
So if you you lock your device when you are at work for example and then you go home, it will ask the password when you open it.

I have been testing the dbus devlock_close call more.

If I lock the device with dbus like this:
Code:
dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_open string:"com.nokia.mce" string:"/com/nokia/mce/request" string:"com.nokia.mce.request" string:"devlock_callback" uint32:'3'
And then unlock it like this:
Code:
dbus-send --system --type=method_call --dest=com.nokia.system_ui /com/nokia/system_ui/request com.nokia.system_ui.request.devlock_close string:"com.nokia.mce" string:"/com/nokia/mce/request" string:"com.nokia.mce.request" string:"devlock_callback" uint32:'0'
Everything works great, but when I lock it with the power button menu and then use dbus to unlock, the power button menu stops working, until I use dbus to lock it again and then open it with password. Could someone confirm this?

Last edited by laasonen; 2011-04-09 at 20:57.
 

The Following User Says Thank You to laasonen For This Useful Post: